Re: [Resin-interest] IllegalAccessError with Resin-Professional 4.0.20 and EclipseLink 2.2

2011-08-19 Thread Scott Ferguson
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

2011-08-19 Thread BUSCH Steffen
 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)