This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 305331 - Unsigned eclipselink.jar doesn't work with signed ejb3-persistence.jar for JPA testing on JBOSS EAP 5.0.0 GA
Summary: Unsigned eclipselink.jar doesn't work with signed ejb3-persistence.jar for JP...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL: http://wiki.eclipse.org/EclipseLink/B...
Whiteboard:
Keywords:
Depends on:
Blocks: 305330 316511 327937
  Show dependency tree
 
Reported: 2010-03-10 09:58 EST by Yiping Zhao CLA
Modified: 2022-06-09 10:24 EDT (History)
4 users (show)

See Also:


Attachments
Base container managed HQSL JTA JPA 1.0 EAR for testing scenarios (40.14 KB, application/x-zip-compressed)
2010-03-11 15:28 EST, Michael OBrien CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yiping Zhao CLA 2010-03-10 09:58:01 EST
In JBOSS 5.0.0 GA EAP install, it has signed ejb3-persistence.jar under JBOSS_HOME/common/lib, but eclipselink.jar used in JPA testing is unsigned one, it caused the errors:

12:59:05,885 WARN  [HDScanner] Failed to process changes 
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of 
incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS): 

DEPLOYMENTS MISSING DEPENDENCIES: 
  Deployment 
"jboss.j2ee:ear=eclipselink-advanced-field-access-model.ear,jar=eclipselink-ad 
vanced-field-access-model_ejb.jar,name=TestRunner,service=EJB3" is missing 
the following dependencies: 
    Dependency "<UNKNOWN 
jboss.j2ee:ear=eclipselink-advanced-field-access-model.ear,jar=eclipselink-adv 
anced-field-access-model_ejb.jar,name=TestRunner,service=EJB3>" (should be in 
state "Described", but is actually in state "** UNRESOLVED Demands 
'persistence.unit:unitName=eclipselink-advanced-field-access-model.ear/eclipse 
link-advanced-field-access-model_ejb.jar#fieldaccess' **") 
  Deployment 
"jboss.j2ee:ear=eclipselink-advanced-field-access-model.ear,jar=eclipselink-ad 
vanced-field-access-model_ejb.jar,name=TestRunner,service=EJB3_endpoint" is 
missing the following dependencies: 
    Dependency 
"jboss.j2ee:ear=eclipselink-advanced-field-access-model.ear,jar=eclipselink-ad 
vanced-field-access-model_ejb.jar,name=TestRunner,service=EJB3" (should be in 
state "Configured", but is actually in state "PreInstall") 

DEPLOYMENTS IN ERROR: 
  Deployment "<UNKNOWN 
jboss.j2ee:ear=eclipselink-advanced-field-access-model.ear,jar=eclipselink-adv 
anced-field-access-model_ejb.jar,name=TestRunner,service=EJB3>" is in error 
due to the following reason(s): ** UNRESOLVED Demands 
'persistence.unit:unitName=eclipselink-advanced-field-access-model.ear/eclipse 
link-advanced-field-access-model_ejb.jar#fieldaccess' ** 
  Deployment 
"persistence.unit:unitName=eclipselink-advanced-field-access-model.ear/eclipse 
link-advanced-field-access-model_ejb.jar#fieldaccess" is in error due to the 
following reason(s): java.lang.SecurityException: class 
"javax.persistence.spi.ProviderUtil"'s signer information does not match 
signer information of other classes in the same package 

at 
org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImp 
l.java:994) 
at 
org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImp 
l.java:940) 
at 
org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerIm 
pl.java:873) 
at 
org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkCom 
plete(MainDeployerAdapter.java:128) 
at 
org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java 
:378) 
at 
org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java: 
256) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) 
at 
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) 
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) 
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$10 
1(ScheduledThreadPoolExecutor.java:98) 
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriod 
ic(ScheduledThreadPoolExecutor.java:181) 
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Sched 
uledThreadPoolExecutor.java:205) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java 
:886) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908 
) 
at java.lang.Thread.run(Thread.java:619)
Comment 1 Doug Clarke CLA 2010-03-10 14:29:07 EST
It should be well known that the signed JPA 1.0 JAR from Orbit cannot be used with the EclipseLink 2.0 JAR.

See table on release notes page - 

http://wiki.eclipse.org/EclipseLink/Release/2.0.0
Comment 2 Tom Ware CLA 2010-03-10 14:53:52 EST
JBoss ships with the signed jar.
Comment 3 Michael OBrien CLA 2010-03-11 09:31:39 EST
>Installing the EAP server and starting investigation
Comment 4 Michael OBrien CLA 2010-03-11 11:21:37 EST
>Step 1: reproduction in standalone EAR (outside of test framework configuration)
>Details: 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
>result: unsigned/signed conflict SecurityException - expected

>logs
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: class "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
Comment 5 Michael OBrien CLA 2010-03-11 11:23:37 EST
>Step 1: reproduction in standalone EAR (outside of test framework configuration)
>Details: 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
>result: unsigned/signed conflict SecurityException - expected

>logs
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: class "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
Comment 6 Michael OBrien CLA 2010-03-11 12:05:00 EST
>Step 2: verify that the signed ejb3-persistence.jar is the cause of the exception - yes
- replace 5.0.0 (ejb3-persistence.jar) with version from 5.1.0 (community edition) - both JPA 1.0 versions
- restart server, deploy EAR
- JPA 1.0 application runs fine
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)
Comment 7 Michael OBrien CLA 2010-03-11 15:28:16 EST
Created attachment 161810 [details]
Base container managed HQSL JTA JPA 1.0 EAR for testing scenarios

>Matches Trunk example
>Launch URL
http://127.0.0.1:8080/enterprise
Comment 8 Michael OBrien CLA 2010-03-12 11:13:55 EST
>recommending Option 1 (replace ejb3-persistence.jar with one from community edition) until options 3,4 and 5 are validated shortly.

http://wiki.eclipse.org/EclipseLink/Bugs/305331#Option_1:_Replace_signed_ejb3-persistence.jar_with_an_unsigned_version_from_JBoss_5.1.0_community_edition_-_valid
Comment 9 Michael OBrien CLA 2010-03-22 10:45:57 EDT
>See option 7: copy eclipselink and javax.persistence spec jars to server/default/lib to override signed ejb3-persistence.jar in common/lib
>Server Configuration 7:
* keep the signed ejb3-persistence.jar from common/lib on the server in place. 
* copy eclipselink.jar to server/default/lib 
* copy javax.persistence spec jar to server/default/lib 
>Client Configuration 7:
* no changes 
>Results 7:
* EntityManager and EntityManagerFactory injection on the remote stateless session bean is working fine. 
* The JPA war applications that start with the JBoss server deploy fine 
* Weaving is unaffected as currently only static weaving is avaible on JBoss
Comment 10 Michael OBrien CLA 2010-06-22 11:23:59 EDT
>5.0.0 EAP working EAR configuration
Specifying @Remote @Stateless Session Bean using Defaults
The following scenario specifies @Remote on the remote interface and @Stateless on the stateless session bean.
This results in the following JNDI name emitted by the server on EAR deploy

@Stateless(name="ApplicationService", mappedName="ApplicationService")
@Remote(ApplicationServiceRemote.class)
public class ApplicationService implements ApplicationServiceRemote  {
	@PersistenceContext(unitName="example", type=PersistenceContextType.TRANSACTION)	
	private EntityManager entityManager;
...
}

public class FrontController extends HttpServlet implements Servlet {
    public static final String APPLICATION_SERVICE_JNDI_NAME = "org.eclipse.persistence.example.jpa.server.jboss.EnterpriseEAR/ApplicationService/remote-org.eclipse.persistence.example.jpa.server.business.ApplicationServiceRemote";    
    /**
     * Get the SSB ApplicationService bean - using a JNDI context lookup (no EJB injection was used on this servlet)
     * @param viaJNDILookup
     * @return
     */
    public ApplicationServiceRemote getApplicationService(boolean viaJNDILookup) {
        if(null == applicationService && viaJNDILookup) {
            try {
                Hashtable<String, String> env = new Hashtable<String, String>();      
                env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");     
                env.put(Context.PROVIDER_URL, "localhost");      
                env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );     
                InitialContext ctx = new InitialContext(env);
                System.out.println("FrontController.getApplicationService() JNDI lookup of " + APPLICATION_SERVICE_JNDI_NAME);
                return (ApplicationServiceRemote) ctx.lookup(APPLICATION_SERVICE_JNDI_NAME);            
            } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException("couldn't lookup Dao", e);
            }
        } else {
            return applicationService;
        }
    }
...
}
Comment 11 Eclipse Webmaster CLA 2022-06-09 10:24:19 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink