[Resin-interest] IllegalAccessError with Resin-Professional 4.0.20 and EclipseLink 2.2
The next evolution of our product (see also http://www.caucho.com/resin/press/wmaccess-delivers-data-services-using- resin/) has been quite successfully tested with most recent Resin Pro 4.0.x versions as long as we were using EclipseLink version 2.1.x. Before heading into the next stage we needed to upgrade to EclipseLink version 2.2 and perform various tests on different Application Servers. Tomcat 6 passed, Websphere passed, but we have troubles with Resin 4.0.20. A collegue of mine was able to isolate the issue and produced two very simple, basic and standalone runable WAR's to reproduce it: http://www.wmaccess.com/public/others/testapp-EclipseLink-2.1.war (6,59 MB) http://www.wmaccess.com/public/others/testapp-EclipseLink-2.2.war (6,96 MB) testapp-EclipseLink-2.1.war is packaged with EclipseLink Library version 2.1.1.v20100817-r8050 testapp-EclipseLink-2.2.war is packaged with EclipseLink Library version 2.2.0.v20110202-r8913 Both WAR files are using an in-memory HSQLDB as data source, so they can be deployed without any other prerequisites. BTW: The .java source files are included in both WARs. The WAR uses the contextPath as prefix in its logging statements. As already mentioned, the WAR with EclipseLink 2.1.1.v20100817-r8050 starts up properly. But the WAR with EclipseLink 2.2.0.v20110202-r8913 throws an IllegalAccessError. Please find below the Output including the complete Stack Trace of the IllegalAccessError: Resin Professional 4.0.20 (built Fri, 15 Jul 2011 01:17:29 PDT) Copyright(c) 1998-2010 Caucho Technology. All rights reserved. 1013253.license -- 2 Resin servers CPB Software Starting Resin Professional on Fri, 19 Aug 2011 11:37:23 +0200 (CEST) [11-08-19 11:37:24.368] {main} Proxy Cache disk-size=1024M memory-size=64M [11-08-19 11:37:24.571] {main} [11-08-19 11:37:24.571] {main} Windows XP 5.1 x86 [11-08-19 11:37:24.571] {main} Java(TM) SE Runtime Environment 1.6.0_03-b05, Cp1252, de [11-08-19 11:37:24.571] {main} Java HotSpot(TM) Client VM 1.6.0_03-b05, 32, mixed mode, Sun Microsystems Inc. [11-08-19 11:37:24.571] {main} [11-08-19 11:37:24.571] {main} user.name = stbu [11-08-19 11:37:25.257] {main} [11-08-19 11:37:25.272] {main} server listening to localhost:6800 [11-08-19 11:37:25.272] {main} [11-08-19 11:37:25.459] {main} [11-08-19 11:37:25.459] {main} resin.home = D:\WMACCESS-4.0\container-testing\resin-pro-4.0.20 [11-08-19 11:37:25.459] {main} resin.root = D:\WMACCESS-4.0\container-testing\resin-pro-4.0.20 [11-08-19 11:37:25.459] {main} resin.conf = D:\WMACCESS-4.0\container-testing\resin-pro-4.0.20\conf\resin.xml [11-08-19 11:37:25.459] {main} [11-08-19 11:37:25.459] {main} server= 127.0.0.1:6800 (app-tier:default) [11-08-19 11:37:25.459] {main} stage = production [11-08-19 11:37:25.787] {main} WebApp[production/webapp/default/ROOT] active [11-08-19 11:37:25.911] {main} WebApp[production/webapp/default/resin-admin] active [11-08-19 11:37:26.254] {main} WebApp[production/webapp/default/resin-doc] active [11-08-19 11:37:26.270] {main} Host[production/host/default] active [11-08-19 11:37:26.270] {main} ProServer[id=default,cluster=app-tier] active [11-08-19 11:37:26.270] {main} JNI keepalive: not available on Windows [11-08-19 11:37:26.270] {main} JNI: file, socket [11-08-19 11:37:26.270] {main} [11-08-19 11:37:26.270] {main} [11-08-19 11:37:26.270] {main} http listening to *:8080 [11-08-19 11:37:26.426] {main} https listening to *:8443 [11-08-19 11:37:26.426] {main} [11-08-19 11:37:26.457] {main} ProResin[id=default] started in 2744ms [11-08-19 11:37:39.476] {resin-51} In-place class redefinition (HotSwap) is available. context /testapp-EclipseLink-2.2: context listener entry point. context /testapp-EclipseLink-2.2: initializing EntityManagerFactory. context /testapp-EclipseLink-2.2: EclipseLink version packaged in .war file: 2.2.0.v20110202-r8913 context /testapp-EclipseLink-2.2: Loaded EclipseLink version: 2.1.2.v20101206-r8635 context /testapp-EclipseLink-2.2: Using EntityManagerFactory org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl@143691d context /testapp-EclipseLink-2.2: Application classloader: EnvironmentClassLoader[web-app:production/webapp/default/testapp-Eclipse Link-2.2] context /testapp-EclipseLink-2.2: EntityManagerFactory classloader: sun.misc.Launcher$AppClassLoader@1a7bf11 context /testapp-EclipseLink-2.2: Invoking EclipseLink 2.2 constructor. java.lang.IllegalAccessError: tried to access method org.eclipse.persistence.internal.jpa.metadata.tables.TableMetadata.init (Ljava/lang/String;)V from class servlet.Listener at servlet.Listener.contextInitialized(Listener.java:51) at com.caucho.server.webapp.WebApp.start(WebApp.java:3520) at com.caucho.env.deploy.DeployController.startImpl(DeployController.java:6 70) at com.caucho.env.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAut oRedeployAutoStrategy.java:77) at com.caucho.env.deploy.DeployController.startOnInit(DeployController.java :523) at
Re: [Resin-interest] IllegalAccessError with Resin-Professional 4.0.20 and EclipseLink 2.2
On 08/19/2011 10:23 AM, BUSCH Steffen wrote: The next evolution of our product (see also http://www.caucho.com/resin/press/wmaccess-delivers-data-services-using- resin/) has been quite successfully tested with most recent Resin Pro 4.0.x versions as long as we were using EclipseLink version 2.1.x. Before heading into the next stage we needed to upgrade to EclipseLink version 2.2 and perform various tests on different Application Servers. Tomcat 6 passed, Websphere passed, but we have troubles with Resin 4.0.20. Even EclipseLink 2.2 is packaged in the WAR, Resin's own EclipseLink Version 2.1.2.v20101206-r8635 from $RESIN_HOME/lib/eclipselink.jar is used. Our Application uses a Constructor of EclipseLink 2.2 which causes the IllegalAccessError. Try removing/replacing the eclipselink.jar from resin/lib. Resin itself doesn't depend on eclipselink, so it's safe to remove or replace. -- Scott When checking the logging output of the EclipseLink 2.1 test WAR (testapp-EclipseLink-2.1.war) it seems that it is working because of the fact that packaged EclipseLink and used one from $RESIN_HOME/lib/eclipselink.jar have the same major/minor version respectivly both are similar enough to properly startup. ... context /testapp-EclipseLink-2.1: initializing EntityManagerFactory. context /testapp-EclipseLink-2.1: EclipseLink version packaged in .war file: 2.1.1.v20100817-r8050 context /testapp-EclipseLink-2.1: Loaded EclipseLink version: 2.1.2.v20101206-r8635 context /testapp-EclipseLink-2.1: Using EntityManagerFactory org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl@76438d context /testapp-EclipseLink-2.1: Application classloader: EnvironmentClassLoader[web-app:production/webapp/default/testapp-Eclipse Link-2.1] context /testapp-EclipseLink-2.1: EntityManagerFactory classloader: sun.misc.Launcher$AppClassLoader@1a7bf11 context /testapp-EclipseLink-2.1: Creating EntityManager [EL Info]: 2011-08-19 11:36:33.961--ServerSession(5181335)--EclipseLink, version: Eclipse Persistence Services - 2.1.2.v20101206-r8635 [EL Info]: 2011-08-19 11:36:34.554--ServerSession(5181335)--file:/D:/WMACCESS-4.0/container-te sting/resin-pro-4.0.20/webapps/testapp-EclipseLink-2.1/WEB-INF/classes/_ JPA_TEST login successful context /testapp-EclipseLink-2.1: Persisting an entity. context /testapp-EclipseLink-2.1: metamodel instance: MetamodelImpl@18521651 [ 2 Types: , 1 ManagedTypes: , 1 EntityTypes: , 0 MappedSuperclassTypes: , 0 EmbeddableTypes: ] context /testapp-EclipseLink-2.1: Closing EntityManager context /testapp-EclipseLink-2.1: context listener finished. [11-08-19 11:36:34.647] {resin-56} WebApp[production/webapp/default/testapp-EclipseLink-2.1] active ... However, our app required EclipseLink 2.2 now and with all other tested servlet containers this issue does not appear (logging output from Tomcat 6 below). Any advice how to solve this issue? Thanks, Steffen Just for the records - Tomcat 6 output: INFO: Deploying web application archive testapp-EclipseLink-2.2.war context /testapp-EclipseLink-2.2: context listener entry point. context /testapp-EclipseLink-2.2: initializing EntityManagerFactory. context /testapp-EclipseLink-2.2: EclipseLink version packaged in .war file: 2.2.0.v20110202-r8913 context /testapp-EclipseLink-2.2: Loaded EclipseLink version: 2.2.0.v20110202-r8913 context /testapp-EclipseLink-2.2: Using EntityManagerFactory org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl@1762027 context /testapp-EclipseLink-2.2: Application classloader: WebappClassLoader context: /testapp-EclipseLink-2.2 delegate: false repositories: /WEB-INF/classes/ -- Parent Classloader: org.apache.catalina.loader.StandardClassLoader@5329c5 context /testapp-EclipseLink-2.2: EntityManagerFactory classloader: WebappClassLoader context: /testapp-EclipseLink-2.2 delegate: false repositories: /WEB-INF/classes/ -- Parent Classloader: org.apache.catalina.loader.StandardClassLoader@5329c5 context /testapp-EclipseLink-2.2: Invoking EclipseLink 2.2 constructor. context /testapp-EclipseLink-2.2: Creating EntityManager [EL Info]: 2011-08-19 12:28:14.456--ServerSession(13685038)--EclipseLink, version: Eclipse Persistence Services - 2.2.0.v20110202-r8913 [EL Info]: 2011-08-19 12:28:14.918--ServerSession(13685038)--file:/D:/WMACCESS-4.0/container-t esting/apache-tomcat-6.0.33/webapps/testapp-EclipseLink-2.2/WEB-INF/clas ses/_JPA_TEST login successful context /testapp-EclipseLink-2.2: Persisting an entity. context /testapp-EclipseLink-2.2: metamodel instance: MetamodelImpl@15703940 [ 2 Types: , 1 ManagedTypes: , 1 EntityTypes: , 0 MappedSuperclassTypes: , 0 EmbeddableTypes: ] context /testapp-EclipseLink-2.2: Closing EntityManager context /testapp-EclipseLink-2.2: context listener finished. ___ resin-interest mailing list
Re: [Resin-interest] IllegalAccessError with Resin-Professional 4.0.20 and EclipseLink 2.2
On 08/19/2011 10:23 AM, BUSCH Steffen wrote: The next evolution of our product (see also http://www.caucho.com/resin/press/wmaccess-delivers-data-services-usin g- resin/) has been quite successfully tested with most recent Resin Pro 4.0.x versions as long as we were using EclipseLink version 2.1.x. Before heading into the next stage we needed to upgrade to EclipseLink version 2.2 and perform various tests on different Application Servers. Tomcat 6 passed, Websphere passed, but we have troubles with Resin 4.0.20. Even EclipseLink 2.2 is packaged in the WAR, Resin's own EclipseLink Version 2.1.2.v20101206-r8635 from $RESIN_HOME/lib/eclipselink.jar is used. Our Application uses a Constructor of EclipseLink 2.2 which causes the IllegalAccessError. Try removing/replacing the eclipselink.jar from resin/lib. Resin itself doesn't depend on eclipselink, so it's safe to remove or replace. -- Scott It's very likely that we need some time to run two versions of our software in parallel. Therefore I've chosen the remove $RESIN_HOME/lib/eclipselink.jar option in order to allow each Web-App our software to use the eclipselink version included in their individual WARs. However, when the $RESIN_HOME/lib/eclipselink.jar is removed, a NoClassDefFoundError is thrown. This is the output / stack trace. [11-08-19 19:40:10.379] {main} resin.home = D:\WMACCESS-4.0\container-testing\resin-pro-4.0.20 [11-08-19 19:40:10.379] {main} resin.root = D:\WMACCESS-4.0\container-testing\resin-pro-4.0.20 [11-08-19 19:40:10.379] {main} resin.conf = D:\WMACCESS-4.0\container-testing\resin-pro-4.0.20\conf\resin.xml [11-08-19 19:40:10.379] {main} [11-08-19 19:40:10.379] {main} server= 127.0.0.1:6800 (app-tier:default) [11-08-19 19:40:10.379] {main} stage = production [11-08-19 19:40:10.706] {main} WebApp[production/webapp/default/ROOT] active [11-08-19 19:40:10.831] {main} WebApp[production/webapp/default/resin-admin] active [11-08-19 19:40:11.189] {main} WebApp[production/webapp/default/resin-doc] active [11-08-19 19:40:11.766] {main} In-place class redefinition (HotSwap) is available. [11-08-19 19:40:11.968] {main} WebApp[production/webapp/default/testapp-EclipseLink-2.2] fail [11-08-19 19:40:11.984] {main} java.lang.NoClassDefFoundError: org/eclipse/persistence/platform/server/ServerPlatformBase at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at com.caucho.loader.DynamicClassLoader.loadClassImpl(DynamicClassLoader.ja va:1456) at com.caucho.loader.SystemClassLoader.loadClassImpl(SystemClassLoader.java :237) at com.caucho.loader.DynamicClassLoader.loadClassImpl(DynamicClassLoader.ja va:1454) at com.caucho.loader.DynamicClassLoader.loadClassImpl(DynamicClassLoader.ja va:1454) at com.caucho.loader.DynamicClassLoader.loadClassImpl(DynamicClassLoader.ja va:1454) at com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1 392) at com.caucho.loader.DynamicClassLoader.loadClass(DynamicClassLoader.java:1 373) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClas sForName(PrivilegedAccessHelper.java:93) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.findClass(En tityManagerSetupImpl.java:697)