You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Jarek Gawor (JIRA)" <ji...@apache.org> on 2010/09/13 23:30:33 UTC
[jira] Created: (GERONIMO-5606) Bad persistenceUnitRoot for PUs in
jars embedded in WARs
Bad persistenceUnitRoot for PUs in jars embedded in WARs
--------------------------------------------------------
Key: GERONIMO-5606
URL: https://issues.apache.org/jira/browse/GERONIMO-5606
Project: Geronimo
Issue Type: Bug
Security Level: public (Regular issues)
Components: persistence
Affects Versions: 3.0
Reporter: Jarek Gawor
Assignee: Jarek Gawor
Fix For: 3.0
The persistenceUnitRoot for PUs in jars embedded in WARs is computed incorrectly which for example causes the META-INF/orm.xml files not to be discovered by OpenJPA.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (GERONIMO-5606) Bad persistenceUnitRoot for PUs
in jars embedded in WARs
Posted by "Jarek Gawor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/GERONIMO-5606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909431#action_12909431 ]
Jarek Gawor commented on GERONIMO-5606:
---------------------------------------
I updated (in revision 997064 and 997066) the jpa test case to demonstrate the META-INF/orm.xml discovery problem when the persistenceUnitRoot of a PU is computed incorrectly.
> Bad persistenceUnitRoot for PUs in jars embedded in WARs
> --------------------------------------------------------
>
> Key: GERONIMO-5606
> URL: https://issues.apache.org/jira/browse/GERONIMO-5606
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: persistence
> Affects Versions: 3.0
> Reporter: Jarek Gawor
> Assignee: Jarek Gawor
> Fix For: 3.0
>
>
> The persistenceUnitRoot for PUs in jars embedded in WARs is computed incorrectly which for example causes the META-INF/orm.xml files not to be discovered by OpenJPA.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (GERONIMO-5606) Bad persistenceUnitRoot for PUs
in jars embedded in WARs
Posted by "Jarek Gawor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/GERONIMO-5606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909435#action_12909435 ]
Jarek Gawor commented on GERONIMO-5606:
---------------------------------------
In revision 997073 I committed a set of changes that represent an attempt at fixing the persistenceUnitRoot problem. If a persistence.xml is discovered within a jar file, the persistenceUnitRoot of the PU will be a "jar" type of URL. The classloader of the PU is also changed to BundleResourceClassLoader which returns "jar" type of URLs for resources embedded in jar files. Because the persistenceUnitRoot URL is now consistent with the URLs returned by BundleResourceClassLoader, OpenJPA can successfully discover the orm.xml file and other resources.
> Bad persistenceUnitRoot for PUs in jars embedded in WARs
> --------------------------------------------------------
>
> Key: GERONIMO-5606
> URL: https://issues.apache.org/jira/browse/GERONIMO-5606
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: persistence
> Affects Versions: 3.0
> Reporter: Jarek Gawor
> Assignee: Jarek Gawor
> Fix For: 3.0
>
>
> The persistenceUnitRoot for PUs in jars embedded in WARs is computed incorrectly which for example causes the META-INF/orm.xml files not to be discovered by OpenJPA.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (GERONIMO-5606) Bad persistenceUnitRoot for PUs
in jars embedded in WARs
Posted by "Jarek Gawor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/GERONIMO-5606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909067#action_12909067 ]
Jarek Gawor commented on GERONIMO-5606:
---------------------------------------
This actually gets pretty tricky. OpenJPA uses the classloader to discover all META-INF/orm.xml files and tries to compare them against persistenceUnitRoot of the PU to make sure that given orm.xml belongs to the right PU. The URLs returned by classloader.getResources() are "bundle" type of URLs as generated by the framework. Now, in PersistenceUnitGBean we know which embedded jar file contains the PU but there is no easy way to generate a proper "bundle" type of url using the Bundle API. And if we can't generate a proper persistenceUnitRoot URL, OpenJPA will fail to discover the orm.xml and possibly other resources.
> Bad persistenceUnitRoot for PUs in jars embedded in WARs
> --------------------------------------------------------
>
> Key: GERONIMO-5606
> URL: https://issues.apache.org/jira/browse/GERONIMO-5606
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: persistence
> Affects Versions: 3.0
> Reporter: Jarek Gawor
> Assignee: Jarek Gawor
> Fix For: 3.0
>
>
> The persistenceUnitRoot for PUs in jars embedded in WARs is computed incorrectly which for example causes the META-INF/orm.xml files not to be discovered by OpenJPA.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.