Skip to main content
Jump to: navigation, search

Difference between revisions of "EclipseLink/Bugs/305331"

m (Option 3: Global Shared Library - Server level scope - verifying)
m (Bug Analysis Document: 305331: EclipseLink deployment on JBoss EAP 5.0.0 GA using signed JPA 1.0 ejb3-persistence.jar)
Line 2: Line 2:
  
 
* [http://bugs.eclipse.org/305331 Bugzilla Bug 305331 Unsigned eclipselink.jar doesn't work with signed ejb3-persistence.jar for JPA testing on JBOSS EAP 5.0.0 GA ]
 
* [http://bugs.eclipse.org/305331 Bugzilla Bug 305331 Unsigned eclipselink.jar doesn't work with signed ejb3-persistence.jar for JPA testing on JBOSS EAP 5.0.0 GA ]
* [http://bugs.eclipse.org/305330 Bugzilla Bug 305330 EclipseLink JPA tests failed On JBOSS EAP 5.0.0 GA JNDI lookup failure of Proxy FactoryA ]
 
 
 
== Document History ==
 
== Document History ==
 
{|{{BMTableStyle}}
 
{|{{BMTableStyle}}
Line 17: Line 15:
  
 
== Status ==
 
== Status ==
*In progress 20100311 for options 3,4 and 5.
+
*In progress 20100311
*<font color="red">Currently recommending '''[[EclipseLink/Bugs/305331#Option_1:_Replace_signed_ejb3-persistence.jar_with_an_unsigned_version_from_JBoss_5.1.0_community_edition_-_valid|Option 1]]'''</font> - until options 3,4 and 5 are validated
+
 
+
 
== Overview ==
 
== Overview ==
 
*The EAP 5.0.0 GA version of the JBoss Application Server ships with signed library jars.  This presents a problem for users of EclipseLink that place our unsigned implementation jar '''eclipselink.jar''' beside the JPA 1.0 ''javax specification'' jar - '''ejb3-persistence.jar''' in the '''common/lib''' library folder off the server.  On deploymehnt in EAP 5.0.0 GA we receive a '''Security Exception''' because of the difference in security levels.
 
*The EAP 5.0.0 GA version of the JBoss Application Server ships with signed library jars.  This presents a problem for users of EclipseLink that place our unsigned implementation jar '''eclipselink.jar''' beside the JPA 1.0 ''javax specification'' jar - '''ejb3-persistence.jar''' in the '''common/lib''' library folder off the server.  On deploymehnt in EAP 5.0.0 GA we receive a '''Security Exception''' because of the difference in security levels.
 
*The Community Edition of JBoss 5.1.0 and 6.0.0 M1 do not have these issues because their library jars are unsigned.
 
*The Community Edition of JBoss 5.1.0 and 6.0.0 M1 do not have these issues because their library jars are unsigned.
 
*This document details several possible solutions to this ''signed jar'' issue and recommends the best approach.
 
*This document details several possible solutions to this ''signed jar'' issue and recommends the best approach.
*JBoss '''[https://jira.jboss.org/jira/browse/JBPAPP-2971 JIRA JBPAPP-2971]''' is encountering the same issue with cglib.jar - one of the alternatives for this JIRA are the same as [[EclipseLink/Bugs/305331#Option_1:_Replace_signed_ejb3-persistence.jar_with_an_unsigned_version_from_JBoss_5.1.0_community_edition_-_valid|Option 1]]
 
 
 
== Concepts ==
 
== Concepts ==
 
===JPA Specification Notes===
 
===JPA Specification Notes===
Line 31: Line 25:
 
====JPA 2.0 Specification====
 
====JPA 2.0 Specification====
 
== Reproduction ==
 
== Reproduction ==
*Reproduction in standalone EAR (outside of test framework configuration)
 
**trunk examples JBoss EAR with commented JPA 2.0 calls and persistence.xml tags
 
***http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEJB/ejbModule/META-INF/persistence.xml
 
****copy unsigned trunk eclipselink.jar to common/lib
 
****create default JBoss 5 server in Eclipse IDE
 
****deploy jboss.EnterpriseEAR (with default HSQL datasource) to JBoss 5.0 EAP
 
===Results: unsigned/signed conflict SecurityException - expected===
 
====Logs:====
 
<pre>
 
2010-03-11 11:10:08,988 INFO  [org.jboss.bootstrap.microcontainer.ServerImpl] (main) JBoss (Microcontainer) [5.0.0.GA (build: SVNTag=JBPAPP_5_0_0_GA
 
date=200910202128)] Started in 1m:3s:180ms
 
2010-03-11 11:10:47,698 INFO [org.jboss.ejb3.deployers.Ejb3DependenciesDeployer] (HDScanner) Encountered deployment
 
AbstractVFSDeploymentContext@26267218{vfszip:/C:/opt/jboss-eap-5.0/jboss-as/server/default/deploy/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR.ear/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEJB.jar/}
 
2010-03-11 11:10:48,059 INFO [org.jboss.jpa.deployment.PersistenceUnitDeployment] (HDScanner) Starting persistence unit
 
persistence.unit:unitName=org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR.ear/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEJB.jar#example
 
2010-03-11 11:10:48,069 WARN [org.jboss.detailed.classloader.ClassLoaderManager] (HDScanner) Unexpected error during load of:javax.persistence.spi.ProviderUtil java.lang.SecurityException:  lass "javax.persistence.spi.ProviderUtil"'s signer information does not match signer information of other classes in the
 
same package
 
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:769)
 
...
 
    at
 
org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:285)
 
>and resultant secondary exception CNFE because the signed JPA 1.0 specification class was not loaded 2010-03-11 11:10:48,069 ERROR
 
[org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Start:
 
name=persistence.unit:unitName=org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR.ear/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEJB.jar#example
 
state=Create
 
java.lang.NoClassDefFoundError: javax/persistence/spi/ProviderUtil
 
Caused by: java.lang.ClassNotFoundException: Unexpected error during load of: javax.persistence.spi.ProviderUtil, msg=class
 
"javax.persistence.spi.ProviderUtil"'s signer information does not match signer information of other classes in the same package
 
</pre>
 
 
===Prerequisites===
 
===Prerequisites===
 
===Data Model===
 
===Data Model===
 
*The testing models for reproduction are based off of the [http://wiki.eclipse.org/EclipseLink/Examples/JPA/JBoss_Web_Tutorial JBoss server example] in the SVN trunk.
 
*The testing models for reproduction are based off of the [http://wiki.eclipse.org/EclipseLink/Examples/JPA/JBoss_Web_Tutorial JBoss server example] in the SVN trunk.
===Use Case 1: Container managed Persistence Unit injected on a Stateless Session Bean invoked via a Servlet client===
+
 
*This use case is valid for options 1, 2, 5
+
===Use Case 1: ===
===Use Case 2: Application managed Persistence Unit injected on Servlet client===
+
*This use case is valid for options 1, 2, 3, 4, 5
+
 
====StackTrace====
 
====StackTrace====
 
====Logs====
 
====Logs====
Line 72: Line 35:
 
===<font color="green">Option 1: Replace signed ejb3-persistence.jar with an unsigned version from JBoss 5.1.0 community edition - valid</font>===
 
===<font color="green">Option 1: Replace signed ejb3-persistence.jar with an unsigned version from JBoss 5.1.0 community edition - valid</font>===
 
====Server Configuration 1:====
 
====Server Configuration 1:====
* place '''eclipselink.jar''' into '''common/lib'''.
 
* replace the signed JBoss EAP 5.0.0 (ejb3-persistence.jar) with the unsigned version from JBoss 5.1.0 (community edition) - both JPA 1.0 versions in '''common/lib'''
 
*restart server, deploy EAR
 
 
====Client Configuration 1:====
 
====Client Configuration 1:====
* Remove the JPA 2.0 API in the stateless session bean and revert persistence.xml from a JPA 2.0 to JPA 1.0 level before running the example project in trunk
 
* Client EAR runs out of the box using default HSQL TX datasource - https://bugs.eclipse.org/bugs/attachment.cgi?id=161810
 
 
====Results 1:====
 
====Results 1:====
*JPA 1.0 application runs fine
+
===<font color="red">Option 2: Ship signed eclipselink.jar - invalid</font>===
<pre>
+
12:01:41,308 INFO  [STDOUT] [EL Finest]: 2010-03-11 12:01:41.308--UnitOfWork(11747982)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--Register the existing object org.eclipse.persistence.example.jpa.server.business.Cell@3324876( id: 2 state: null left: null right: null parent: HashSet@34627602 references: HashSet@34627602)
+
</pre>
+
 
+
===''<font color="red">Option 2: Ship signed eclipselink.jar - invalid</font>''===
+
 
*This option has us sign our eclipselink.jar with jarsigner - however we do not have access to the private keys used to sign the JBoss libraries so this is currently not feasible.
 
*This option has us sign our eclipselink.jar with jarsigner - however we do not have access to the private keys used to sign the JBoss libraries so this is currently not feasible.
*If the user's application is signed (IE: they are running a signed applet persistence client) - they will need to resign the jar.
+
====Server Configuration 2:====
 
+
====Client Configuration 2:====
 +
====Results 2: ====
 
===<font color="orange">Option 3: Global Shared Library - Server level scope - verifying</font>===
 
===<font color="orange">Option 3: Global Shared Library - Server level scope - verifying</font>===
 
*In this option we create a global shared library on the server or in a jar-only EAR that is accessible to all server applications.
 
*In this option we create a global shared library on the server or in a jar-only EAR that is accessible to all server applications.
 
*This shared library must override the '''common/lib/ejb3-persistence.jar'''.
 
*This shared library must override the '''common/lib/ejb3-persistence.jar'''.
 
====Server Configuration 3:====
 
====Server Configuration 3:====
* no '''eclipselink.jar''' into '''common/lib'''.
 
 
=====Shared Library on EAR/lib=====
 
*Add EAR/lib/eclipselink.jar and EAR/lib/javax.persistence_2.0.0.v201002051058.jar
 
*Reference these two jars in the '''war/src/META-INF/manifest.MF
 
**Class-Path: javax.persistence_2.0.0.v201002051058.jar eclipselink.jar
 
*Getting CCE because the ejb3.persistence.jar on the server is taking precedence by default over the specification jar shipped with the EAR - IE: you cannot have two javax.persistence jars.
 
**java.lang.ClassCastException: org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to javax.persistence.spi.PersistenceProvider
 
*Solution would be a similar override as for ''WebLogic'' via '''<pre><wls:prefer-application-packages></pre>'''
 
 
 
====Client Configuration 3:====
 
====Client Configuration 3:====
* place '''eclipselink.jar''' and the '''jpa 1.0/2.0 specification jar''' into '''EAR/lib'''.
 
 
*One of
 
**jboss-app.xml
 
**EAR/lib
 
**application.xml
 
 
 
====Results 3:====
 
====Results 3:====
 
 
===<font color="orange">Option 4: Application Shared Library - Local EAR level scope - verifying</font>===
 
===<font color="orange">Option 4: Application Shared Library - Local EAR level scope - verifying</font>===
 
====Server Configuration 4:====
 
====Server Configuration 4:====
Line 148: Line 84:
  
 
== References ==
 
== References ==
*[http://wiki.eclipse.org/EclipseLink/Examples/JPA/JBoss_Web_Tutorial EclipseLink JPA Tutorial EAR for JBoss 5.1.0 and 6.0.0 M1]
 
**EclipseLink JBoss Tutorial [http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR/ EAR], [http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEJB/ EJB] and [http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.server.jboss.EnterpriseWeb/ WAR] projects in SVN.
 

Revision as of 11:54, 12 March 2010

Bug Analysis Document: 305331: EclipseLink deployment on JBoss EAP 5.0.0 GA using signed JPA 1.0 ejb3-persistence.jar

Document History

Date Author Version Description & Notes
20100312 Michael O'Brien 1.0 Initial investigation of solution scenarios

Status

  • In progress 20100311

Overview

  • The EAP 5.0.0 GA version of the JBoss Application Server ships with signed library jars. This presents a problem for users of EclipseLink that place our unsigned implementation jar eclipselink.jar beside the JPA 1.0 javax specification jar - ejb3-persistence.jar in the common/lib library folder off the server. On deploymehnt in EAP 5.0.0 GA we receive a Security Exception because of the difference in security levels.
  • The Community Edition of JBoss 5.1.0 and 6.0.0 M1 do not have these issues because their library jars are unsigned.
  • This document details several possible solutions to this signed jar issue and recommends the best approach.

Concepts

JPA Specification Notes

JPA 1.0 Specification

JPA 2.0 Specification

Reproduction

Prerequisites

Data Model

Use Case 1:

StackTrace

Logs

Analysis

Option 1: Replace signed ejb3-persistence.jar with an unsigned version from JBoss 5.1.0 community edition - valid

Server Configuration 1:

Client Configuration 1:

Results 1:

Option 2: Ship signed eclipselink.jar - invalid

  • This option has us sign our eclipselink.jar with jarsigner - however we do not have access to the private keys used to sign the JBoss libraries so this is currently not feasible.

Server Configuration 2:

Client Configuration 2:

Results 2:

Option 3: Global Shared Library - Server level scope - verifying

  • In this option we create a global shared library on the server or in a jar-only EAR that is accessible to all server applications.
  • This shared library must override the common/lib/ejb3-persistence.jar.

Server Configuration 3:

Client Configuration 3:

Results 3:

Option 4: Application Shared Library - Local EAR level scope - verifying

Server Configuration 4:

Client Configuration 4:

Results 4:

Option 5: Generate an eclipselink jar with the JPA 2.0 dependencies removed

Server Configuration 5:

Client Configuration 5:

Results 5:

Open Issues

Issue # Owner Description / Notes
I1 mobrien -

Decisions

Issue # Description / Notes Decision

Future Considerations

References

Back to the top