[jboss-jira] [JBoss JIRA] (AS7-1369) persistence.xml in EAR/META-INF folder with <jar-file>
wiktorowski maximilien (JIRA)
jira-events at lists.jboss.org
Tue Feb 21 10:52:36 EST 2012
[ https://issues.jboss.org/browse/AS7-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669602#comment-12669602 ]
wiktorowski maximilien edited comment on AS7-1369 at 2/21/12 10:50 AM:
-----------------------------------------------------------------------
In our case the same myjpa.jar is used in several packaging so persistence.xml can't be embedded on it.
What we've done is create another persistence.jar in the ear/lib directory and it works well.
{code}
myear.ear
lib/
myjpa.jar
persistence.jar
META-INF/
persistence.xml
{code}
At first i thought ear/META-INF was a valid location but looking at your link about JPA 2.0 specification it appears it's not. So you can reject the bug
Best regards,
PS : JPA deployer should ignore ear/META-INF/persistence.xml and warn user it has a bad configuration
was (Author: maximilien):
In our case the same myjpa.jar is used in several packaging so persistence.xml can't be embedded on it.
What we've done is create another persistence.jar in the ear/lib directory and it works well.
{code}
myear.ear
lib/
myjpa.jar
persistence.jar
META-INF/
persistence.xml
{code}
At first i thought ear/META-INF was a valid location but looking at your link about JPA 2.0 specification it appears it's not. So you can reject the bug
Best regards,
> persistence.xml in EAR/META-INF folder with <jar-file>
> ------------------------------------------------------
>
> Key: AS7-1369
> URL: https://issues.jboss.org/browse/AS7-1369
> Project: Application Server 7
> Issue Type: Bug
> Components: JPA / Hibernate
> Reporter: wiktorowski maximilien
> Fix For: Open To Community
>
>
> adding persistence.xml in META-INF dir of an ear like this
> ?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
> version="2.0">
> <persistence-unit name="mypersistencunit">
> ...
> <jar-file>lib/myjpa.jar</jar-file>
> result in exception:
> Caused by: java.lang.RuntimeException: error trying to scan <jar-file>: vfs:/c:/JBoss/jboss-as-7.0.0.Final/bin/content/lib/myjpa.jar
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list