[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-374) persistence.xml <jar-file> not following JSR220 spec

Marco Dubbeld (JIRA) noreply at atlassian.com
Tue Apr 14 09:11:17 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/EJB-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32868#action_32868 ] 

Marco Dubbeld commented on EJB-374:
-----------------------------------

BTW that fix needs probably one or two extra lines, if it also needs to support absolute pathnames. 

But I am confused by the spec so please check the interpretation, I expect the jar files to be found in the classpath, not nested in the jar containing the persistence.xml. 

The spec says in 6.2.1.6: "Such JAR files are specified relative to the root of the persistence unit (e.g.,utils/myUtils.jar)" 
The spec says in 6.2.1.8, example 5: The order.jar is a jar file on the classpath containing another persistence unit,





> persistence.xml <jar-file> not following JSR220 spec
> ----------------------------------------------------
>
>                 Key: EJB-374
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-374
>             Project: Hibernate Entity Manager
>          Issue Type: Bug
>          Components: EntityManager
>    Affects Versions: 3.4.0.CR2
>         Environment: regression: 3.3.2.GA, 3.4.0.CR2
>            Reporter: Jeff Ferber
>         Attachments: Quick_fix_to_EJB-374.patch
>
>
> JSR220 says <jar-file> is relative to the root of the persistence unit, which is the place containing the META-INF/persistence.xml
> This is not the case. Instead, it looks for the jar relative to the JVM working directory. (see JarVisitorFactory.java)
> So providing an absolute file path in <jar-file> works, but not a relative path because the root changes changes based on the situation and environment.  E.g., the directory you run ant, when running tomcat, etc.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list