[jboss-jira] [JBoss JIRA] Commented: (JBAS-9298) Error parsing persistence.xml

Scott Marlow (JIRA) jira-events at lists.jboss.org
Tue Apr 12 11:46:33 EDT 2011


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

Scott Marlow commented on JBAS-9298:
------------------------------------

Thanks, I copied efp.ear to standalone/deployment and didn't see a null pointer exception (I'm using latest as7 sources, so my null check might of helped).  

I didn't see much on the AS7 console when first deploying but when restarting AS7, I see:

11:27:37,945 ERROR [org.jboss.as] (MSC service thread 1-4) JBoss AS 7.0.0.Beta3-SNAPSHOT "TBD" started (with errors) in 3037ms - Started 138 of 167 services (1 services failed or missing dependencies, 28 services are passive or on-demand)
    Services missing dependencies:
        service jboss.persistenceunit."efp.ear/ejb.jar#efp"

I'll see if I can make improvements to make this situation more clear but the JPA 2 the following to say:
"
A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. In Java EE environments, the root of a persistence unit must be one of the following:
• an EJB-JAR file
• the WEB-INF/classes directory of a WAR file[80]
• a jar file in the WEB-INF/lib directory of a WAR file
• a jar file in the EAR library directory
• an application client jar file
It is not required that an EJB-JAR or WAR file containing a persistence unit be packaged in an EAR unless the persistence unit contains persistence classes in addition to those contained within the EJB-JAR or WAR. See Section 8.2.1.6.

NOTE: Java Persistence 1.0 supported use of a jar file in the root of the EAR as the root of a persistence unit. This use is no longer supported. Portable applications should use the EAR library directory for this case instead. See [9].
"

I think the call for action here for me, is to see if I can give more information about why the ejb jar in the root of the ear is ignored (and moving it to the ear lib will help it become active).



> Error parsing persistence.xml
> -----------------------------
>
>                 Key: JBAS-9298
>                 URL: https://issues.jboss.org/browse/JBAS-9298
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JPA / Hibernate
>    Affects Versions: 7.0.0.Beta2
>         Environment: JDK 1.6_22, Jboss 7.0.0 Beta2. windows xp sp3
>            Reporter: Prasad Deshpande
>            Assignee: Scott Marlow
>         Attachments: efp.ear, Hello.java, HelloBean.java
>
>
> There are 2 problems if I try to deploy EE5 confirming ear to 7.0.0 Beta2, standalone configuration.
> 1. If I put persistence.xml if ejb.jar, it throws following exception:
> 15:04:36,000 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."efp.ear"."ejb.jar".PARSE: org.jboss.msc.service.StartException in service jbo
> ss.deployment.unit."efp.ear"."ejb.jar".PARSE: Failed to process phase PARSE of subdeployment "ejb.jar" of deployment "efp.ear"
>         at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:108)
>         at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1344)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]
>         at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
> Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to parse "/D:/jboss-7.0.0.Beta2/bin/content/efp.ear/ejb.jar/META-INF/persistence.xml"
>         at org.jboss.as.jpa.processor.PersistenceUnitParseProcessor.parse(PersistenceUnitParseProcessor.java:190)
>         at org.jboss.as.jpa.processor.PersistenceUnitParseProcessor.handleJarDeployment(PersistenceUnitParseProcessor.java:99)
>         at org.jboss.as.jpa.processor.PersistenceUnitParseProcessor.deploy(PersistenceUnitParseProcessor.java:79)
>         at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:102)
>         ... 4 more
> Caused by: java.lang.NullPointerException
>         at org.jboss.as.jpa.puparser.PersistenceUnitXmlParser.parsePU(PersistenceUnitXmlParser.java:151)
>         at org.jboss.as.jpa.puparser.PersistenceUnitXmlParser.parse(PersistenceUnitXmlParser.java:116)
>         at org.jboss.as.jpa.processor.PersistenceUnitParseProcessor.parse(PersistenceUnitParseProcessor.java:186)
>         ... 7 more
> 2. If I put persistence.xml in any of jar in lib directory of application, that persistence.xml can not be found.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the jboss-jira mailing list