[ 
https://issues.apache.org/jira/browse/OPENJPA-2094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jody Grassel resolved OPENJPA-2094.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.0
                   2.2.1
                   2.2.2
                   2.4.0
                   2.3.1
                   2.3.0

> Metadata processing needs to support jar:file URLs that address Jar 
> directories
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2094
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2094
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: lib
>            Reporter: Jody Grassel
>            Assignee: Jody Grassel
>             Fix For: 2.3.0, 2.3.1, 2.4.0, 2.2.2, 2.2.1, 2.2.0
>
>
> The JPA specification makes the following assertion about 
> PersistenceUnitInfo's PersistenceUnitRootUrl value:
> /**
>  * Returns the URL for the jar file or directory that is the
>  * root of the persistence unit. (If the persistence unit is
>  * rooted in the WEB-INF/classes directory, this will be the
>  * URL of that directory.)
>  * The URL will either be a file: URL referring to a jar file
>  * or referring to a directory that contains an exploded jar
>  * file, or some other URL from which an InputStream in jar
>  * format can be obtained.
>  *
>  * @return a URL referring to a jar file or directory.
>  */
> public URL getPersistenceUnitRootUrl();
> Currently, OpenJPA supports the following URL patterns:
>   1) file: URL which addresses a jar file or an exploded jar file (directory)
>   2) jar: URL which addresses a jar file that terminates with "!/" (i.e., 
> jar:file:somepath/myjar!/)
>   3) Any URL that ends with ".jar"
> What it does not support is a jar URL of this pattern: 
> jar:file:somepath/myjar!/WEB-INF/classes
> OpenJPA's AbstractCFMetaDataFactory.parsePersistentTypeNames() method will 
> find that the
> URL doesn't match the three scenarios listed above, and defaults to 
> attempting to parse it as an
> XML file, which is obviously not an appropriate behavior for processing a Jar 
> file.
> The "jar:file:somepath/myjar!/WEB-INF/classes" pattern must be supported to 
> accommodate
> J2EE application servers that pass such a URL into 
> PersistenceUnitInfo._persistenceUnitRootUrl



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to