3 Replies Latest reply on Nov 2, 2011 8:30 AM by Keith Babo

    JPA Issue

    Daniel Bevenius Master

      Hi,

       

      I've been using a modified quickstart (camel-jms-binding) which uses JPA to store data to a database. I've been testing this against AS7.0.2.Final and it was been working fine.

      Yesterday I updated and tried this on the packaged switchyard-as7-0.3 version and used the 'standalone-preview.xml' configuration I'm now getting the following exception:

       

      06:41:47,661 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."switchyard-quickstarts-camel-jms-binding-0.3.0-SNAPSHOT.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."switchyard-quickstarts-camel-jms-binding-0.3.0-SNAPSHOT.jar".SwitchYardService: java.lang.RuntimeException: Can't find a deployment unit named  at deployment "switchyard-quickstarts-camel-jms-binding-0.3.0-SNAPSHOT.jar"
              at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:94)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
              at java.lang.Thread.run(Thread.java:680) [:1.6.0_26]
      Caused by: java.lang.RuntimeException: Can't find a deployment unit named  at deployment "switchyard-quickstarts-camel-jms-binding-0.3.0-SNAPSHOT.jar"
              at org.jboss.as.weld.services.bootstrap.WeldJpaInjectionServices.getScopedPUName(WeldJpaInjectionServices.java:94)
              at org.jboss.as.weld.services.bootstrap.WeldJpaInjectionServices.resolvePersistenceContext(WeldJpaInjectionServices.java:59)
              at org.jboss.weld.util.Beans.injectEEFields(Beans.java:784)
              at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:181)
              at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:54)
              at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:176)
              at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:142)
              at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:170)
              at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:339)
              at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:67)
              at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:693)
              at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:731)
              at org.switchyard.component.bean.deploy.CDIBeanServiceDescriptor.getHandler(CDIBeanServiceDescriptor.java:87)
              at org.switchyard.component.bean.deploy.BeanComponentActivator.init(BeanComponentActivator.java:71)
              at org.switchyard.deploy.internal.Deployment.deployServices(Deployment.java:322)
              at org.switchyard.deploy.internal.Deployment.doStart(Deployment.java:130)
              at org.switchyard.deploy.internal.AbstractDeployment.start(AbstractDeployment.java:191)
              at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:105)
              at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:87)
              ... 5 more
      
      

       

      I noticed that the SwitchYard extension in a freshly unzipped installation now looks like this:

       

      <extension module="org.switchyard" xmlns:jpa="urn:jboss:domain:jpa:1.0"/>
      ...
      <subsystem xmlns:jpa="urn:jboss:domain:jpa:1.0" xmlns="urn:jboss:domain:switchyard:1.0">
      

       

      If I re-add the 'org.jboss.as.jpa' subsystem, which seems to have been removed, the quickstart works but I get the following error upon startup:

       

      07:09:45,418 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/gwt-console-server]] (MSC service thread 1-1) Exception sending context initialized event to listener instance of class org.switchyard.component.bpm.task.jbpm.TaskServerServletContextListener: javax.persistence.PersistenceException: No Persistence provider for EntityManager named org.jbpm.task
              at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]
              at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]
              at org.switchyard.component.bpm.task.jbpm.TaskServerServletContextListener.startTaskServer(TaskServerServletContextListener.java:114) [switchyard-component-bpm-0.3.0-SNAPSHOT.jar:]
              at org.switchyard.component.bpm.task.jbpm.TaskServerServletContextListener.contextInitialized(TaskServerServletContextListener.java:71) [switchyard-component-bpm-0.3.0-SNAPSHOT.jar:]
              at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
              at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
              at java.lang.Thread.run(Thread.java:680) [:1.6.0_26]
      
      
      07:09:45,431 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Error listenerStart
      07:09:45,432 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Context [/gwt-console-server] startup failed due to previous errors
      07:09:45,499 ERROR [stderr] (MSC service thread 1-1) java.lang.NullPointerException
      07:09:45,499 ERROR [stderr] (MSC service thread 1-1)    at org.h2.server.web.DbStarter.contextDestroyed(DbStarter.java:73)
      07:09:45,500 ERROR [stderr] (MSC service thread 1-1)    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3465)
      07:09:45,500 ERROR [stderr] (MSC service thread 1-1)    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3970)
      07:09:45,500 ERROR [stderr] (MSC service thread 1-1)    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3888)
      07:09:45,500 ERROR [stderr] (MSC service thread 1-1)    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70)
      07:09:45,500 ERROR [stderr] (MSC service thread 1-1)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
      07:09:45,500 ERROR [stderr] (MSC service thread 1-1)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
      07:09:45,501 ERROR [stderr] (MSC service thread 1-1)    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      07:09:45,501 ERROR [stderr] (MSC service thread 1-1)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      07:09:45,501 ERROR [stderr] (MSC service thread 1-1)    at java.lang.Thread.run(Thread.java:680)
      07:09:45,501 ERROR [stderr] (MSC service thread 1-1) java.lang.NullPointerException
      07:09:45,501 ERROR [stderr] (MSC service thread 1-1)    at org.h2.server.web.DbStarter.contextDestroyed(DbStarter.java:80)
      07:09:45,501 ERROR [stderr] (MSC service thread 1-1)    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3465)
      07:09:45,501 ERROR [stderr] (MSC service thread 1-1)    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3970)
      07:09:45,501 ERROR [stderr] (MSC service thread 1-1)    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3888)
      07:09:45,502 ERROR [stderr] (MSC service thread 1-1)    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70)
      07:09:45,502 ERROR [stderr] (MSC service thread 1-1)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
      07:09:45,502 ERROR [stderr] (MSC service thread 1-1)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
      07:09:45,502 ERROR [stderr] (MSC service thread 1-1)    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      07:09:45,502 ERROR [stderr] (MSC service thread 1-1)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      07:09:45,503 ERROR [stderr] (MSC service thread 1-1)    at java.lang.Thread.run(Thread.java:680)
      07:09:45,505 INFO  [org.jboss.web] (MSC service thread 1-1) registering web context: /gwt-console-server
      
      

       

      Has anyone seen this before or have some insight into what is going on?

       

      Thanks,

       

      /Daniel

        • 1. Re: JPA Issue
          Jeff Yu Master

          Hi Daniel,

           

          Hopefully this link would be helpful. http://community.jboss.org/thread/172077?start=0&tstart=0

           

          As far as I know, jBPM component was using the Hibernate 3.x version, and the AS7 is coming with the Hibernate 4. So by adding the 'org.jboss.as.jpa', we are adding the Hibernate 4 dependencies. (I haven't checked the updates in jBPM component, so I could be wrong.

           

          Regards

          Jeff

          • 2. Re: JPA Issue
            Keith Babo Master

            We need to be able to exclude the hibernate 4 stuff from the jbpm console deployment.  I checked the WEB-INF/jboss-deployment-structure.xml for the console webapp and it does exclude org.hibernate, so this is obviously not enough.  Reading some of the AS7 JPA docs, it looks like you may be able to specifically use hibernate 3 via a provider property in persistence.xml.  Trying that now ...

            • 3. Re: JPA Issue
              Keith Babo Master

              Oh btw, that jpa namespace thing is because the jpa ns prefix is no included in the list of excludes for the stylesheet.  Once we add that, it will be gone.  Interestingly enough, the AS7 config layer actually cleans out the extra jpa namespace declarations when you startup your server for the first time.