4 Replies Latest reply on Dec 10, 2013 10:01 AM by chaluwa

    Errai Demo Fails With persistence.xml file

    chaluwa

      Hello guys, I am having trouble switching my demo app from the H2 database to MySQL using a new persistence.xml file. The new persistence.xml file was copied and edited from another errai project that works and runs well with JBoss AS. After replacing the bundled persistence file with mine, GWT dev mode fails with errors I have pasted here : http://ur1.ca/g5w3e

       

      I wonder what I am missing ??

        • 1. Re: Errai Demo Fails With persistence.xml file
          mbarkley

          Charles,

           

          The relevant part of the error message you've posted is at line 301:

           

          [INFO] Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011047: Component class org.jboss.errai.demo.server.UserComplaintService for component UserComplaintService has errors:

          [INFO] JBAS011440: Can't find a persistence unit named forge-default in deployment "portal.war"

           

          If you look in the UserComplaintService class, the EntityManager has an annotation that references the "forge-default" datasource. You'll need to change that to the name of your new datasource.

           

          Cheers.

          1 of 1 people found this helpful
          • 2. Re: Errai Demo Fails With persistence.xml file
            chaluwa

            Ok, thanks. I figured this had something to do with it in the first place, so I commented it out (also in other "service" classes I've added to the demo project) and used @Inject EntityManager em; instead.

             

            This time, the error becomes :

            [INFO] 09:58:22,283 INFO  [org.jboss.as.server] (management-handler-thread - 4) JBAS015870: Deploy of deployment "portal.war" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.webapp#PortalmeshDSjboss.naming.context.java.jboss.datasources.PortalmeshDSMissing[jboss.persistenceunit.webapp#PortalmeshDSjboss.naming.context.java.jboss.datasources.PortalmeshDS]"]}

            [INFO] 09:58:22,372 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment portal.war in 89ms

            [INFO] 09:58:22,374 INFO  [org.jboss.as.controller] (management-handler-thread - 4) JBAS014774: Service status report

            [INFO] JBAS014775:    New missing/unsatisfied dependencies:

            [INFO]       service jboss.naming.context.java.jboss.datasources.PortalmeshDS (missing) dependents: [service jboss.persistenceunit.webapp#PortalmeshDS]

             

            See details here : http://ur1.ca/g63by

             

            Why the "missing dependency" error. Has it to do with my persistence.xml file, and what is wrong with it by the way ?

            • 3. Re: Errai Demo Fails With persistence.xml file
              mbarkley

              Charles,

               

              The new Dev Mode launches your Jboss instance with the standalone-full.xml by default. You can change this by adding an extra parameter to your gwt-maven extraJvmArgs (-Derrai.jboss.config.file=standalone.xml), but I'd recommend instead adding your datasource to the standalone-full.xml (using standalone.xml does not seem to work with remote debugging).

               

              Cheers.

              • 4. Re: Errai Demo Fails With persistence.xml file
                chaluwa

                Ok, I'll rty it out and let you know. Big thanks.