users@glassfish.java.net

ClassLoading problem while migrating application from GF v2 to GF v3

From: <glassfish_at_javadesktop.org>
Date: Thu, 24 Jun 2010 09:00:08 PDT

Hello all,

I am migrating an application to GFv3 from GFv2 that extensively uses CGLib proxies. It proxies JavaMail classes, which in GFv3 are part of a mail.jar bundle. Of course at first generated proxies were not able to find CGLib, since bundle class loader of the mail bundle does not see classes that are part of a webapp. I solved this problem by deploying CGLib as a bundle, but introduced the new one:
 java.lang.IllegalAccessError: class $javax.mail.internet.MimeBodyPart$MimePartDataHandler$$EnhancerByCGLIB$$bd265e6c_2 cannot access its superclass javax.mail.internet.MimeBodyPart$MimePartDataHandler

CGLib cannot load generated byte code for the proxy (define class) since it cannot access the parent class, which is part of a mail bundle. All classes are available though Class.forName().

There are also the second question: is it possible to change javamail impl and java bean activation framework jars for the domain in GF v3, like it was possible before using lib/ext directory ?


Thanks in advance,
Michael
[Message sent by forum member 'smikesh']

http://forums.java.net/jive/thread.jspa?messageID=475706