Home » Support » Forum » Maven Enhancement with OSGi Plugins

Maven Enhancement with OSGi Plugins

#1

Hello,

I've an OSGi environment and try to enhance Classes with Maven as it is described in your tutorials. Now I get ClassNotFoundException's with some entity classes, which contains enums from other plugins. Is there a way to include classes in enhancement process? Thanks for your help.

[ObjectDB 2.4.6_01] Failed to process class file of type 'com.xxx.' (error 422)
com.objectdb.o.UserException: Failed to process class file of type 'com.xxx.'
at com.objectdb.o.MSG.d(MSG.java:74)
at com.objectdb.o.JEL.A(JEL.java:442)
at com.objectdb.o.JEN.k(JEN.java:93)
at com.objectdb.Enhancer.main(Enhancer.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoClassDefFoundError: xxx;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredFields(Class.java:1743)
at com.objectdb.o.ANT.q(ANT.java:153)
at com.objectdb.o.SCM.r(SCM.java:229)
at com.objectdb.o.JEW.aK(JEW.java:185)
at com.objectdb.o.JEL.A(JEL.java:433)
... 8 more
Caused by: java.lang.ClassNotFoundException: xxx
at java.lang.ClassLoader.findClass(ClassLoader.java:358)
at com.objectdb.o.ACL.loadClass(ACL.java:131)
at com.objectdb.o.BCL.loadClass(BCL.java:63)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
#2

The ObjectDB Enhancer uses standard JVM class loading in order to analyze classes for enhancement. Accordingly, all classes for enhancement have to be ready for load by the JVM. If they reference other classes, these other classes must also be available in the classpath, otherwise load would fail.

If you run ObjectDB in an OSGi environment in which some of the classes are not accessible by the default class loader, consider enhancement as part of the build script, using an external JVM that will have access to all the classes.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login