Java 8 Enhancer Problem

#1

Hello!

I am currently migrating my project to Java 8. I'm using Spring and AspectJ load time weaving. Unluckily the LTW option of Spring is global. If it's enabled it also tries to find other class transformers on the classpath. This is normaly not a problem because the ObjectDB enhancer ignores non @Entity or already enhanced classes but in conjunction with new Java 8 class files it throws an exception which causes Spring to stop weaving. 

Caused by: com.objectdb.o.InternalException
at com.objectdb.o.InternalException.f(InternalException.java:236)
at com.objectdb.o.JCP.p(JCP.java:195)
at com.objectdb.o.JCP.k(JCP.java:141)
at com.objectdb.o.JCE.<init>(JCE.java:58)
at com.objectdb.o.JCP.<init>(JCP.java:80)
at com.objectdb.o.JCL.F(JCL.java:423)
at com.objectdb.o.JCL.<init>(JCL.java:120)
at com.objectdb.JEnhancerAgent.transform(JEnhancerAgent.java:152)
at org.springframework.orm.jpa.persistenceunit.ClassFileTransformerAdapter.transform(ClassFileTransformerAdapter.java:57)
... 98 more

I don't use any of the new Java 8 features in my entity classes. So the hotfix would be pretty easy. Just catch the exception and output a log message like "Java 8 weaving currently not supported." instead.

Regards
Ralph

 

#2

Thank you for this report. Please check if  build 2.5.5_01 fixes this issue.

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

Build 2.5.5_01 fixes this issue but it has a new bug. When I fetch, detach, change and merge an object I get the following exception:

Caused by: com.objectdb.o._IllegalArgumentException: Specified object is not an entity object
at com.objectdb.o._IllegalArgumentException.b(_IllegalArgumentException.java:43)
at com.objectdb.o.JPE.g(JPE.java:107)
at com.objectdb.o.ERR.f(ERR.java:56)
at com.objectdb.o.OBC.onObjectDBError(OBC.java:1506)
at com.objectdb.jpa.EMImpl.merge(EMImpl.java:518)

Inserting new objects works. Also merging ones created after the update to 2.5.5_01.

#4

The new error is not related to the Enhancer fix, but to another fix (issue #1373).

Please try build 2.5.5_02.

 

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

Post Reply

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