ObjectDB ObjectDB

Enhancer -s broken

#1

Hi,

after upgrading to ObjectDB 2.5.4_04 we noticed that the enhancer option -s is currently broken.

According to your docs


<java classname="com.objectdb.Enhancer" fork="true" classpath="c:\objectdb\bin\objectdb.jar">
  <arg line="-s c:\my-project\classes\*.class"/>
</java>

we've added the enhancer to our ant build:

<java classname="com.objectdb.Enhancer" fork="true" classpathref="classpath.default">
  <arg line="-s ${bin.dir}/org/tinymediamanager/core/*.class"/>
</java>

unfortunalety is is only enhancing ${bin.dir}/org/tinymediamanager/core/ and no sub packages/directories. With earlier versions (2.5.0:05) it worked like a charm.

Am I doing anything wrong?

Kind regards,

Manuel Laggner

edit
delete
#2

little update:

in linux (openJDK 1.7.0_51) the same ant script works...

edit
delete
#3

We are not aware to any relevant change in ObjectDB in the recent versions.

Since it does work in one environment and not in another, it me be the result of automatic shell wildcard expansion, i.e. ObjectDB Enhancer does not get the * wildcard but a list of class files in the main directory (that the OS found), without any directory to use the -s switch on. Try disabling wildcard expansion.

ObjectDB Support
edit
delete
#4

Sorry for the late response.

You were absolutely right. The snippet from your docs does work on Linux, but not on a windows machine due to the wildcard expansion.

We changed it to:

<java classname="com.objectdb.Enhancer" fork="true" classpathref="classpath.default">
   <arg line="-s"/>
   <arg line="${bin.dir}/org/tinymediamanager/core/*"/>
</java>

this way it works in both Windows and Linux (Eclipse & Ant).

Thanks for your support
Manuel

edit
delete
#5

Thank you for the update.

Currently the manual suggests:

<java classname="com.objectdb.Enhancer" fork="true"
    classpath="c:\objectdb\bin\objectdb.jar">
  <arg line="-s c:\my-project\classes\*.class"/>
</java>

What is the main difference that can make it work on Windows, splitting the arguments to two elements, e.g.:

<java classname="com.objectdb.Enhancer" fork="true"
    classpath="c:\objectdb\bin\objectdb.jar">
  <arg line="-s"/>
  <arg line="c:\my-project\classes\*.class"/>
</java>

Anything else?

ObjectDB Support
edit
delete
#6

just tried it again and the following happened:

a) with your suggestion

[ObjectDB 2.5.4 Enhancer]
     27 NON persistable types have been enhanced:
     ...

b) without the ".class"

<java classname="com.objectdb.Enhancer" fork="true" classpathref="classpath.default">
  <arg line="-s"/>
  <arg line="${bin.dir}/org/tinymediamanager/core/*"/>
</java>

[ObjectDB 2.5.4 Enhancer]
     11 persistable types have been enhanced:
     ....
     120 NON persistable types have been enhanced:
     ....

 

it seems the wildcard expansion (and/or recursive resolving of the classes) is not working with the *.class but with only a *
Windows only; Linux works as intended

Hope that helps,
Manuel

edit
delete
#7

That makes sense. In both cases Windows expands the wildcards rather than passing it to ObjectDB.

*.class does not cover directories. * does.

The documentation will be fixed accordingly. Thanks for your help.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.