[jboss-jira] [JBoss JIRA] (AS7-3081) Misplaced @PersistenceContext Causes Untraceable Deployment Failure

joysn joe (JIRA) jira-events at lists.jboss.org
Sat Sep 15 07:53:35 EDT 2012


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

joysn joe commented on AS7-3081:
--------------------------------

and the initial problem is still there with 7.2 SNAPSHOT alpha1:

{noformat}
13:44:55,355 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found erp.ear.ear in deployment directory. To trigger deployment create a file called erp.ear.ear.dodeploy
13:45:10,379 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "erp.ear.ear"
13:45:10,747 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015960: Class Path entry activation.jar in /data/Projects/JavaLibs/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/deployments/erp.ear.ear/lib/mail-1.4.1.jar  does not point to a valid jar for a Class-Path reference.
13:45:10,749 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "erp.ejb.core-0.0.1-SNAPSHOT.jar"
13:45:10,749 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "erp.ejb.bpm-0.0.1-SNAPSHOT.jar"
13:45:10,749 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "erp.web-0.0.1-SNAPSHOT.war"
13:45:11,504 INFO  [org.jboss.as.jpa] (MSC service thread 1-2) JBAS011401: Read persistence.xml for erp.web
13:45:11,590 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."erp.ear.ear"."erp.web-0.0.1-SNAPSHOT.war".DEPENDENCIES: org.jboss.msc.service.StartException in service jboss.deployment.subunit."erp.ear.ear"."erp.web-0.0.1-SNAPSHOT.war".DEPENDENCIES: JBAS018733: Failed to process phase DEPENDENCIES of subdeployment "erp.web-0.0.1-SNAPSHOT.war" of deployment "erp.ear.ear"
	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
	at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
Caused by: java.lang.IllegalArgumentException: JBAS011439: Class level javax.persistence.PersistenceContext annotations must provide a name
	at org.jboss.as.jpa.processor.JPAAnnotationProcessor.processClass(JPAAnnotationProcessor.java:208)
	at org.jboss.as.jpa.processor.JPAAnnotationProcessor.processPersistenceAnnotations(JPAAnnotationProcessor.java:128)
	at org.jboss.as.jpa.processor.JPAAnnotationProcessor.deploy(JPAAnnotationProcessor.java:91)
	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
	... 5 more

13:45:11,793 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "erp.ear.ear" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"erp.ear.ear\".\"erp.web-0.0.1-SNAPSHOT.war\".DEPENDENCIES" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"erp.ear.ear\".\"erp.web-0.0.1-SNAPSHOT.war\".DEPENDENCIES: JBAS018733: Failed to process phase DEPENDENCIES of subdeployment \"erp.web-0.0.1-SNAPSHOT.war\" of deployment \"erp.ear.ear\"
    Caused by: java.lang.IllegalArgumentException: JBAS011439: Class level javax.persistence.PersistenceContext annotations must provide a name"},"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.subunit.\"erp.ear.ear\".\"erp.ejb.bpm-0.0.1-SNAPSHOT.jar\".CONFIGURE_MODULE Missing[JBAS014861: <one or more transitive dependencies>]","jboss.deployment.unit.\"erp.ear.ear\".CONFIGURE_MODULE Missing[JBAS014861: <one or more transitive dependencies>]","jboss.deployment.subunit.\"erp.ear.ear\".\"erp.ejb.core-0.0.1-SNAPSHOT.jar\".CONFIGURE_MODULE Missing[JBAS014861: <one or more transitive dependencies>]"]}
{noformat}

So will switch back to 7.1.1 and hope that the above deployment issue does not happen once 7.2 is released. Interestingly it never happened with 7.1.1, but it happens sometimes with the snapshot. 

I solved the initial deployment issue with the PersistenceContext on class-level by removing the annotation on class level and instead added an EntityManager annotated with it:

{noformat}
@Named
@ConversationScoped
@Stateful
public class OrderControllerBean implements Serializable {
	private static final long serialVersionUID = -4868506512979135651L;

	@PersistenceContext(type=PersistenceContextType.EXTENDED)
	private EntityManager em;
{noformat}

I do not use the EntityManager in the SFSB but it activates the EXTENDED persistence context which makes the dependant SLSBs happy.


                
> Misplaced @PersistenceContext Causes Untraceable Deployment Failure
> -------------------------------------------------------------------
>
>                 Key: AS7-3081
>                 URL: https://issues.jboss.org/browse/AS7-3081
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: JPA / Hibernate
>    Affects Versions: 7.0.2.Final
>         Environment: Macintosh 10.7.2
>            Reporter: Jim Brownfield
>            Assignee: Scott Marlow
>
> When deploying an ear file that contains an Entity bean with an inappropriate @PersistenceContext annotation, the following stacktrace is generated, and the deployment fails:
> 15:36:16,322 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-9) MSC00001: Failed to start service jboss.deployment.subunit."xxx.xxxxxx.xxxxx.deploy.ear"."xxx.xxxxxx.xxxxx.ejb-0.0.1-SNAPSHOT.jar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."xxx.xxxxxx.xxxxx.deploy.ear"."xxx.xxxxxx.xxxxx.ejb-0.0.1-SNAPSHOT.jar".PARSE: Failed to process phase PARSE of subdeployment "xxx.xxxxxx.xxxxx.ejb-0.0.1-SNAPSHOT.jar" of deployment "xxx.xxxxxx.xxxxx.deploy.ear"
> 	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
> 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
> 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]
> 	at java.lang.Thread.run(Thread.java:680) [:1.6.0_29]
> Caused by: java.lang.IllegalArgumentException: Class level annotations must provide a name.
> 	at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.processClass(JPAAnnotationParseProcessor.java:233)
> 	at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.processPersistenceAnnotations(JPAAnnotationParseProcessor.java:127)
> 	at org.jboss.as.jpa.processor.JPAAnnotationParseProcessor.deploy(JPAAnnotationParseProcessor.java:90)
> 	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
> 	... 5 more
> The IllegalArgumentException gives no data for the annotation, the class, or any relevant data to the cause.  I built JBoss debug from source to discover that the culprit in my case was a misplaced PersistenceContext annotation in an entity bean.  The offending annotation had actually existed in a version of our code running in JBoss 4 without error.

--
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