344 words

Enhancer -s broken

#1
2014-03-04 11:53

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

mlaggner
mlaggner's picture
Joined on 2013-12-16
User Post #4
#2
2014-03-04 18:00

little update:

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

mlaggner
mlaggner's picture
Joined on 2013-12-16
User Post #5
#3
2014-03-05 02:01

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
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,813
#4
2014-03-20 08:55

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

mlaggner
mlaggner's picture
Joined on 2013-12-16
User Post #6
#5
2014-03-20 14:29

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
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,829
#6
2014-03-20 14:51

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

mlaggner
mlaggner's picture
Joined on 2013-12-16
User Post #7
#7
2014-03-20 16:08

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
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #1,830

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel