[jboss-jira] [JBoss JIRA] (WFLY-13714) JPA PersistenceUnitInfo.persistenceUnitRootUrl vfs URL should be resolved
Scott Marlow (Jira)
issues at jboss.org
Tue Aug 4 15:37:05 EDT 2020
[ https://issues.redhat.com/browse/WFLY-13714?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14353906#comment-14353906 ]
Scott Marlow commented on WFLY-13714:
-------------------------------------
Is this for a particular Java persistence provider that you care to mention?
>From [Persistence 3.0 SPEC|https://jakarta.ee/specifications/persistence/3.0/persistence_3.0-RC2.html#a13160] which is the same as earlier JPA versions:
{code}
/**
* 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();
{code}
The last form can also be used ("some other URL from which an InputStream in jar format can be obtained").
I do agree that your suggestion would be easier for the persistence provider to deal with.
> JPA PersistenceUnitInfo.persistenceUnitRootUrl vfs URL should be resolved
> -------------------------------------------------------------------------
>
> Key: WFLY-13714
> URL: https://issues.redhat.com/browse/WFLY-13714
> Project: WildFly
> Issue Type: Bug
> Components: JPA / Hibernate
> Affects Versions: 20.0.1.Final
> Reporter: Java Java
> Assignee: Scott Marlow
> Priority: Major
>
> Wildlfy passes a PersistenceUnitInfo object to JPA provider using vfs URL as persistenceUnitRootUrl, e.g.,
> vfs:/C:/wildfly-20.0.1.Final/bin/content/foo.ear/myejb.jar/
> A JPA provider can not resolve this URL without using a third-party library and thus force
> the JPA provider to have dependency on 3rd party libraries or wildfly.
>
> The vfs url should be resolved to a plain file or jar URL that actually exists on file system before passing the URL to a JPA provider when creating an EntityManagerFactory.
>
>
>
>
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list