History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: EJBTHREE-724
Type: Bug Bug
Status: Closed Closed
Resolution: Done
Priority: Major Major
Assignee: Carlo de Wolf
Reporter: Heiko W. Rupp
Votes: 7
Watchers: 9
Operations

If you were logged in you would be able to see more operations.
EJB 3.0

persistence.xml jar-file processing

Created: 04/Oct/06 12:16 PM   Updated: 08/Apr/08 10:47 AM
Component/s: None
Affects Version/s: EJB 3.0 RC9 - FD , AS 4.2.0 GA
Fix Version/s: AS 5.0.0.Beta3

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Dependency
 
This issue is a dependency of:
EJBTHREE-1069 persistance.xml with <jar-file> looks... Major Open
JBPAPP-619 EJBTHREE-724: persistence.xml jar-fil... Major Open
Related
This issue related:
EJBTHREE-560 CLONE -Referencing JAR file in persis... Major Resolved
This issue is related to:
EJBTHREE-1252 @PersistenceContext injection from a ... Major Open

Workaround: Workaround Exists
Workaround Description:
Put ../ in front of the jar:

<jar-file>../myentities.jar</jar-file>


 Description  « Hide
EJB 3 persistence spec says in 6.2.1.6, 2nd paragraph about <jar-file>

"Such JAR files are specified relative to the root of the persistence unit (e.g.,utils/myUtils.jar)"

When I have a persistence.xml like this:

<persistence>
    <persistence-unit name="jon">
        <jta-data-source>java:/JONDS</jta-data-source>
        <jar-file>lib/on-enterprise-server-2.0-SNAPSHOT.jar</jar-file>
    </persistence-unit>
</persistence>

The PersistenceUnitDeployment gives
file:/jboss-4.0.5.CR1/bin/lib/on-enterprise-server-2.0-SNAPSHOT.jar]

but the root of the PersistenceUnit is
file:/jboss-4.0.5.CR1/server/jon/deploy/on.ear/on-enterprise-server-entity-ejb-2.0-SNAPSHOT.jar/

2006-10-04 18:00:43,537 DEBUG [org.jboss.ejb3.entity.PersistenceUnitDeployment] Found persistence.xml file in EJB3 jar
2006-10-04 18:00:43,538 DEBUG [org.jboss.ejb3.entity.PersistenceUnitDeployment] adding JarFile URL: file:/jboss-4.0.5.CR1/bin/lib/on-enterprise-server-2.0-SNAPSHOT.jar
2006-10-04 18:00:43,586 INFO [org.hibernate.ejb.Version] Hibernate EntityManager 3.2.0.CR2
2006-10-04 18:00:43,625 INFO [org.hibernate.cfg.annotations.Version] Hibernate Annotations 3.2.0.CR2
2006-10-04 18:00:43,638 INFO [org.hibernate.cfg.Environment] Hibernate 3.2 cr4
2006-10-04 18:00:43,649 INFO [org.hibernate.cfg.Environment] hibernate.properties not found
2006-10-04 18:00:43,654 INFO [org.hibernate.cfg.Environment] Bytecode provider name : javassist
2006-10-04 18:00:43,666 INFO [org.hibernate.cfg.Environment] using JDK 1.4 java.sql.Timestamp handling
2006-10-04 18:00:43,906 DEBUG [org.hibernate.ejb.Ejb3Configuration] Processing PersistenceUnitInfo [
        name: jon
        persistence provider classname: org.hibernate.ejb.HibernatePersistence
        classloader: org.jboss.mx.loading.UnifiedClassLoader3@3b31a6{ url=file:/jboss-4.0.5.CR1/server/jon/deploy/on.ear/ ,addedOrder=43}
        Temporary classloader: null
        excludeUnlistedClasses: false
        JTA datasource: org.jboss.resource.adapter.jdbc.WrapperDataSource@c90acb
        Non JTA datasource: null
        Transaction type: JTA
        PU root URL: file:/jboss-4.0.5.CR1/server/jon/deploy/on.ear/on-enterprise-server-entity-ejb-2.0-SNAPSHOT.jar/
        Jar files URLs [
                file:/jboss-4.0.5.CR1/bin/lib/on-enterprise-server-2.0-SNAPSHOT.jar]
        Managed classes names []
        Mapping files names []
        Properties [



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order:
Benjamin Graf [21/Feb/08 09:52 AM]
The workaround does not fit in every case.

If running a application out of JBDS (hot deployment) the server looks for the jar-file in:
"jboss-as/server/default/deploy/xxx.ear/xxx-ejb.jar/xxx-entity.jar"

same application deployed as ear-file it looks in:
"jboss-as/server/default/tmp/deploy/tmp21951xxx.ear-contents/xxx-entity.jar"