2 Replies Latest reply on Oct 11, 2012 11:58 AM by Jonathan Fuerth

    How to deploy Errai + JPA (errai-jpa-demo-basic) to the JBoss AS 7

    Stefan Miklosovic Novice

      The title says it ...

       

      I am trying to build Errai with JPA (errai-jpa-demo-basic and errai-jpa-demo-grocery-list) but after I build it and war is present, I try to deploy it to the AS by copying it to the deployments dir but this error occurs:

       

       

      17:09:54,187 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "errai-jpa-demo-basic.war"
      17:09:56,115 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) JBAS011401: Read persistence.xml for ErraiJpaDemo
      17:09:56,244 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-3) JBAS018567: Deployment "deployment.errai-jpa-demo-basic.war" is using a private module ("org.jboss.as.naming:main") which may be changed or removed in future versions without notice.
      17:09:56,245 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-3) JBAS018567: Deployment "deployment.errai-jpa-demo-basic.war" is using a private module ("org.jboss.as.naming:main") which may be changed or removed in future versions without notice.
      17:09:56,246 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-3) JBAS018567: Deployment "deployment.errai-jpa-demo-basic.war" is using a private module ("org.jboss.as.server:main") which may be changed or removed in future versions without notice.
      17:09:56,247 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-3) JBAS018567: Deployment "deployment.errai-jpa-demo-basic.war" is using a private module ("org.jboss.as.server:main") which may be changed or removed in future versions without notice.
      17:09:56,425 WARN  [org.jboss.as.ee] (MSC service thread 1-1) JBAS011006: Not installing optional component org.jboss.errai.bus.server.servlet.StandardAsyncServlet$1 due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.jboss.errai.bus.server.servlet.StandardAsyncServlet$1
                at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)
                at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
                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_35]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_35]
                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_35]
      
      
      17:09:56,756 INFO  [org.jboss.as.jpa] (MSC service thread 1-7) JBAS011402: Starting Persistence Unit Service 'errai-jpa-demo-basic.war#ErraiJpaDemo'
      17:09:57,019 INFO  [org.hibernate.annotations.common.Version] (MSC service thread 1-7) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
      17:09:57,024 INFO  [org.hibernate.Version] (MSC service thread 1-7) HHH000412: Hibernate Core {4.0.1.Final}
      17:09:57,026 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-7) HHH000206: hibernate.properties not found
      17:09:57,028 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-7) HHH000021: Bytecode provider name : javassist
      17:09:57,070 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-7) HHH000204: Processing PersistenceUnitInfo [
                name: ErraiJpaDemo
                ...]
      17:09:57,388 WARN  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-7) HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections
      17:09:57,413 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.persistenceunit."errai-jpa-demo-basic.war#ErraiJpaDemo": org.jboss.msc.service.StartException in service jboss.persistenceunit."errai-jpa-demo-basic.war#ErraiJpaDemo": Failed to start service
                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [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_35]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_35]
                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_35]
      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: ErraiJpaDemo] Unable to build EntityManagerFactory
                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
                at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
                at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
                at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
                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]
                ... 3 more
      Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set
                at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:97)
                at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:67)
                at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:176)
                at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
                at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
                at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
                at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:71)
                at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2270)
                at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2266)
                at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1735)
                at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)
                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
                ... 9 more
      
      
      17:09:57,630 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "errai-jpa-demo-basic.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.persistenceunit.\"errai-jpa-demo-basic.war#ErraiJpaDemo\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"errai-jpa-demo-basic.war#ErraiJpaDemo\": Failed to start service"}}
      17:09:57,719 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment errai-jpa-demo-basic.war in 89ms
      17:09:57,721 INFO  [org.jboss.as.controller] (management-handler-thread - 2) JBAS014774: Service status report
      JBAS014777:   Services which failed to start:      service jboss.persistenceunit."errai-jpa-demo-basic.war#ErraiJpaDemo": org.jboss.msc.service.StartException in service jboss.persistenceunit."errai-jpa-demo-basic.war#ErraiJpaDemo": Failed to start service
      
      

       

      The problem is that AS can not find some properties in persistence.xml like datasources and so on (i really guess)

       

      After all, I do not understand at all how to deploy that application to the AS if not by copying it to the deployment dir.

       

      From the pom.xml of the parent project I can see that the profile which is active is "jetty", so I set activateByDefault to false and set activateByDefault of the profile jboss7 as true.

       

      Then I added gwt maven plugin + jboss as maven plugin in the child pom in order to deploy the application after executing something like "mvn jboss-as:deploy" but it causes jboss as 7 to load a war and the exact same error as posted appears to me so ... this approach obviously does not work as well ...

       

      I am able to run it from eclipse but since I have to automatically deploy it + tests it (that's the another story here at WFK) I am somehow stuck ...