[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3587) Spring example on AS 5 throwns a non-jta-data-source error while deploying

Dan Allen (JIRA) jira-events at lists.jboss.org
Mon Dec 1 20:07:36 EST 2008


    [ https://jira.jboss.org/jira/browse/JBSEAM-3587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12440656#action_12440656 ] 

Dan Allen commented on JBSEAM-3587:
-----------------------------------

I renamed the persistence.xml file to persistence-spring.xml and made the appropriate build changes. That got us further along, but unfortunately, the fix is not that simple. We now have a new problem.

It appears that JBoss AS 5 is scanning *all* classes that use the @PersistenceContext annotation, which is then triggering an attempt to load the persistence unit. Again, this is going to fail because we don't want JBoss AS 5 to do anything with the persistence unit. I cannot think of any reason why the @PersistenceContext should be scanned on non-Java EE components by the application server. You can see that this is the problem by placing a comment in front of @PersistenceContext in UserService.java and everything will work...until you have to find a user.

I am calling this a bug in JBoss AS 5 until I am presented with more insight.

> Spring example on AS 5 throwns a non-jta-data-source error while deploying
> --------------------------------------------------------------------------
>
>                 Key: JBSEAM-3587
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3587
>             Project: Seam
>          Issue Type: Bug
>          Components: Examples
>    Affects Versions: 2.1.0.CR1
>         Environment: JDK 6
> AS 5 CR2
>            Reporter: Jay Balunas
>            Assignee: Michael Youngstrom
>             Fix For: 2.1.1.CR2
>
>
> during deployment the spring example throws the exception below.  The persistence.xml looks like this:
> <persistence-unit name="bookingDatabase" transaction-type="RESOURCE_LOCAL">
>         <provider>org.hibernate.ejb.HibernatePersistence</provider>
>         <properties>
>             <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
>             <property name="hibernate.show_sql" value="true"/>
> note that this example does work on JBoss 4.2.3.
> 15:56:37,345 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=#bookingDatabase
> 15:56:37,351 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#bookingDatabase state=Create
> java.lang.RuntimeException: Specification violation [EJB3 JPA 6.2.1.2] - You have not defined a non-jta-data-source for a RESOURCE_LOCAL enabled persistence context named: bookingDatabase
>         at org.jboss.jpa.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:124)
>         at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:262)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
>         at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
>         at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
>         at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
>         at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
>         at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
>         at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
>         at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
>         at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
>         at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
>         at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
>         at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
>         at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
>         at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
>         at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
>         at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
>         at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
>         at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
>         at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
>         at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
>         at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:124)
>         at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
>         at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
>         at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
>         at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
>         at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
>         at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list