[ 
https://issues.apache.org/jira/browse/GERONIMO-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665054#action_12665054
 ] 

Ivan commented on GERONIMO-4468:
--------------------------------

Maybe I do not express the issue clearly  :-(
For the classloader of the ear package, only those jars in the library folder 
(default is "lib") and those modules defined in the application.xml are loaded. 
While in the ear provided by Janko, he moved a jar file from the lib folder to 
its parent folder. The structure is like 
ear
---a.jar
lib3.jar <- (This jar is moved from the sub folder "lib")
---lib
    ---lib1.jar
    ---lib2.jar

For lib3.jar is not defined in the applications.xml via module element and not 
in the library folder, but the persistence.xml links it via a jar-file element, 
 and we just copy the temp classloader  from the ear classloader, so the entity 
classes in it  could not find by the OpenJPA. That is why I wish to pass the 
jars of the jar-file, and we could include those jars while building the 
temporary classloader.
About exclude-unlisted-classes, I just find the codes is somewhat conflict with 
some descriptions in an online document, so I mentioned it. Actually, even the 
jar files take no effect, we also need to pass the jar files for the reason 
above, if I do not miss anything :-)



> <jar-file> elements are interpreted relatively to EAR root
> ----------------------------------------------------------
>
>                 Key: GERONIMO-4468
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4468
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.3
>            Reporter: Janko Heilgeist
>            Assignee: Ivan
>         Attachments: Geronimo-4468-01.patch, Geronimo-4468.patch, 
> geronimo-jarfile.tar.gz, my-ear-1.0-SNAPSHOT.ear
>
>
> The <jar-file> elements in a persistence.xml are wrongly interpreted as 
> relative to the EAR's root.
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> [...] A persistence unit is defined by a persistence.xml file. The jar file 
> or directory whose META-INF directory contains the persistence.xml file is 
> termed the root of the persistence unit. [...]
> {quote}
> EJB 3.0 persistence spec, section 6.2:
> {quote}
> One or more JAR files may be specified using the jar-file elements [...] Such 
> JAR files are specified relative to the root of the persistence unit [...].
> {quote}
> The attached EAR is correctly verified by the Glassfish verifier. Deploying 
> it on Geronimo 2.1.3 or 2.2-SNAPSHOT results in a successful deployment, 
> while on the console OpenJPA throws exceptions because it tries to resolve 
> the jar-file paths relative to the EAR's root:
> {quote}
> <openjpa-1.0.3-r420667:677674 nonfatal general error> 
> org.apache.openjpa.persistence.PersistenceException: 
> $HOME/geronimo-tomcat6-javaee5-2.1.3/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-ear-1.0-SNAPSHOT.ear/my-entities1-1.0-SNAPSHOT.jar
>  (No such file or directory)
> <openjpa-1.2.0-r422266:683325 nonfatal general error> 
> org.apache.openjpa.persistence.PersistenceException: 
> $HOME/geronimo-tomcat6-javaee5-2.2-SNAPSHOT/repository/com/heilgeist/testcase/geronimo/jarfile/my-ear/1.0-SNAPSHOT/my-entities2-1.0-SNAPSHOT.jar
>  (No such file or directory)
> {quote}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to