[jboss-jira] [JBoss JIRA] (AS7-5474) Url returned by PersistenceUnitInfo#getPersistenceUnitRootUrl() point to an empty folder

Scott Marlow (JIRA) jira-events at lists.jboss.org
Fri Nov 16 16:51:21 EST 2012


    [ https://issues.jboss.org/browse/AS7-5474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735022#comment-12735022 ] 

Scott Marlow commented on AS7-5474:
-----------------------------------

Adriano, for the case of when jboss.as.jpa.vfs is false, we are actually spec compliant (the wording is vague and we could clarify but the javadoc for javax.persistence.spi.PersistenceUnitInfo.getPersistenceUnitRootUrl() is:

{quote}
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.
{quote}

The VFS url is the other URL mentioned.  
                
> Url returned by PersistenceUnitInfo#getPersistenceUnitRootUrl() point to an empty folder
> ----------------------------------------------------------------------------------------
>
>                 Key: AS7-5474
>                 URL: https://issues.jboss.org/browse/AS7-5474
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: JPA / Hibernate
>    Affects Versions: 7.2.0.Alpha1
>         Environment: $ java -version
> java version "1.6.0_31"
> Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
> Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)
> Windows 7 x64
>            Reporter: Adriano Verona
>            Assignee: Scott Marlow
>             Fix For: 7.2.0.Alpha1
>
>         Attachments: vjpa_jboss_example.jar
>
>
> When setting "jboss.as.jpa.vfs" property to false in persistence.xml PersistenceUnitInfo#getPersistenceUnitRootUrl() returns an Url  that points to an empty folder (named "Contents"). The parent of this folder does holds the application jar.
> file:/D:/Java/jboss-as-7.2.0.Alpha1/standalone/tmp/vfs/temp9c270668d311f0c4/vjpa_jboss_example.jar-7ef91a4c66eeff18/contents/
> Observed this at PersistenceProvider#createContainerEntityManagerFactory() method call.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list