Weaver Throws ClassNotFoundException For Available Classes [message #716252] |
Tue, 16 August 2011 19:26 |
Dave M Messages: 20 Registered: July 2009 |
Junior Member |
|
|
We are seeing the EclipseLink 2.3.0 weaver (static and dynamic) throw ClassNotFoundExceptions for classes that are provably available to be class laoded. As the weaver log output below shows, the ClassNotFoundException for the class com.ios.domain.EntityOne occurs immediately after the weaver finished processing the com.ios.doamin.EntityOne class - which it presumably had to have loaded to do its weaving. I'm pretty sure that the weaver uses a temporary class loader, so perhaps that factors into this problem.
We have tried weaving in place and not, weaving jar files and directory structures. We have tried invoking the weaver using the regular eclipselink.jar as well as the OSGI bundles (in both static and dynamic mode). The same error occurs in all cases.
Before I file a bug report, just wanted to check to see if this problem rings a bell with anyone (known/fixed issue, work arounds, likely causes, etc.).
[EL Finest]: 2011-08-16 12:57:34.034--ServerSession(1068678007)--Thread(Thread[main,5,main])--Begin weaver class transformer processing class [com/ios/domain/EntityOne].
[EL Finest]: 2011-08-16 12:57:34.036--ServerSession(1068678007)--Thread(Thread[main,5,main])--End weaver class transformer processing class [com/ios/doamin/EntityOne].
[EL Finest]: 2011-08-16 12:57:34.037--ServerSession(1068678007)--Thread(Thread[main,5,main])--Begin weaver class transformer processing class [com/ios/domain/EntityTwo].
[EL Warning]: 2011-08-16 12:57:34.039--ServerSession(1068678007)--Thread(Thread[main,5,main])--Weaver encountered an exception while trying to weave class com/ios/domain/EntityTwo. The exception was: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.ios.domain.EntityOne
[EL Finest]: 2011-08-16 12:57:34.04--ServerSession(1068678007)--Thread(Thread[main,5,main])--java.lang.RuntimeException: java.lang.ClassNotFoundException: com.ios.domain.EntityOne
at org.eclipse.persistence.internal.libraries.asm.ClassWriter.getCommonSuperClass(Unknown Source)
at org.eclipse.persistence.internal.libraries.asm.ClassWriter.getMergedType(Unknown Source)
at org.eclipse.persistence.internal.libraries.asm.Frame.merge(Unknown Source)
at org.eclipse.persistence.internal.libraries.asm.Frame.merge(Unknown Source)
at org.eclipse.persistence.internal.libraries.asm.MethodWriter.visitMaxs(Unknown Source)
at org.eclipse.persistence.internal.libraries.asm.MethodAdapter.visitMaxs(Unknown Source)
at org.eclipse.persistence.internal.jpa.weaving.MethodWeaver.visitMaxs(MethodWeaver.java:152)
at org.eclipse.persistence.internal.libraries.asm.ClassReader.accept(Unknown Source)
at org.eclipse.persistence.internal.libraries.asm.ClassReader.accept(Unknown Source)
at org.eclipse.persistence.internal.jpa.weaving.PersistenceWeaver.transform(PersistenceWeaver.java:93)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveClassTransformer.transform(StaticWeaveClassTransformer.java:86)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveProcessor.process(StaticWeaveProcessor.java:312)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveProcessor.performWeaving(StaticWeaveProcessor.java:174)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask.start(StaticWeaveAntTask.java:215)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask.execute(StaticWeaveAntTask.java:177)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Thanks,
Dave
|
|
|
|
|
|
|
|
Re: Weaver Throws ClassNotFoundException For Available Classes [message #800259 is a reply to message #799791] |
Thu, 16 February 2012 21:47 |
Dave M Messages: 20 Registered: July 2009 |
Junior Member |
|
|
Hi Chris-
[I replied earlier in the day but for whatever reason that never showed up here in the forum, so this is a second try. Apologies to all if the earlier reply eventually shows up as a duplicate...]
I reported https://bugs.eclipse.org/bugs/show_bug.cgi?id=355016 which Tom Ware closed because I didn't provide a reproduction case, but it sounds like it could be related or the same issue.
Turning off weaving can be very painful in a variety of ways. The impact somewhat depends on whether you are in a Java SE or Java EE environment. In a Java SE environment, no weaving almost certainly means a significant loss of performance and major adverse impact the heap of your JVMs. For example, you would lose lazy loading on 1:1 and M:1 mappings, which means that those relationships will be eagerly loaded. That's not only going to cause a lot of extra database I/O but it will also cause heap to be consumed by objects you would not otherwise have loaded into the JVM. The development cost of over-coming those consequences will be a further time and money impact.
Weaving also supports change tracking, fetch groups and other internal optimizations, so not using weaving means you lose some of those advantages, as well. For more information, you might look at:
http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#What_You_May_Need_to_Know_About_Weaving_JPA_Entities
The bottom line is you want weaving turned on if at all possible.
Dave
|
|
|
|
Powered by
FUDForum. Page generated in 0.03472 seconds