GF3.1.2_b20: Exception while trying to weave class
Hi,
I have come across a strange error when deploying our application on the latest 3.1.2 Glassfish. When deploying, there are the usual log lines "class XYZ actually got transformed" and so on. However, on one class I get a ClassNotFoundException:
Weaver encountered an exception while trying to weave class xyz/OrderBookBean. The exception was: java.lang.RuntimeException:
java.lang.ClassNotFoundException: xyz.OrderBookPositionBean not found by org.eclipse.persistence.asm [117]
The named classes are in the same package and so I do not know why it cannot be found. The classes have a OneToMany relationship with each other.
I have discovered the following EclipseLink bugs which describe the behaviour:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=363238
https://bugs.eclipse.org/bugs/show_bug.cgi?id=365385
Did anyone else encounter this and knows how to fix this? The strange part is that if I change a little bit in the code (replaced a for-each-loop with a normal for-loop) the weaving succeeds. But I would also like to understand this. ;)
What are the performance implications of having weaving disabled?
Any help appreciated.
Thanks,
Chris.
Hi Tom,
thanks for the reply. Unfortunately, I do not have time to follow this up currently. However, the already named bug reports describe my problem exactly. I could also work around the problem by replacing a for-each loop (as in https://bugs.eclipse.org/bugs/show_bug.cgi?id=363238).
Thanks,
Chris.
P.S.: I have also found this EclipseLink forum thread: http://www.eclipse.org/forums/index.php?t=rview&goto=800259
This bug is scheduled for the next EclipseLink patch:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=365385
Without the extra inforamation it is impossible to tell if it is exactly the problem you are seeing. Hopefully the fix will address your issue.
Hi Tom,
of course, I understand. Thank you.
Cheers





Can you please post the full stack trace?
How is your persistence unit setup? What does your persistence.xml look like? How are those classes mapped?