4 Replies Latest reply on Apr 24, 2012 5:11 PM by crowcommand

    AeroGear+Postgresql+Tomcat

    crowcommand

      hi

      I need to make an application with AeroGear with Postgresql and deploy on a Tomcat server. I must do and configure for this

      thanks

        • 1. Re: AeroGear+Postgresql+Tomcat
          qmx

          Your question is way too broad and vague, would you mind to be a little more specific?

          • 2. Re: AeroGear+Postgresql+Tomcat
            crowcommand

            Sorry I wanted to say is I'm trying to integrate the project AeroGear+  Postgres and desplegar en tomcat server but I have the following error:

             

            00:53:23,078 Información [org.jboss.modules] JBoss Modules version 1.1.1.GA
            00:53:25,372 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
            00:53:25,732 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.0.Final "Thunder" starting
            00:53:34,953 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
            00:53:34,955 INFO  [org.xnio] XNIO Version 3.0.3.GA
            00:53:35,087 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
            00:53:35,183 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.2.GA
            00:53:35,737 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
            00:53:35,951 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
            00:53:35,883 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
            00:53:35,974 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
            00:53:35,893 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
            00:53:35,865 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
            00:53:35,877 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
            00:53:37,734 INFO  [org.jboss.as.security] (MSC service thread 1-2) JBAS013100: Current PicketBox version=4.0.6.final
            00:53:38,845 INFO  [org.jboss.as.connector] (MSC service thread 1-4) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.7.Final)
            00:53:39,323 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
            00:53:41,416 INFO  [org.jboss.as.naming] (MSC service thread 1-2) JBAS011802: Starting Naming Service
            00:53:41,897 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
            00:53:42,951 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Arrancando Coyote HTTP/1.1 en puerto http-localhost-127.0.0.1-8080
            00:53:43,644 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-4) JBoss Web Services - Stack CXF Server 4.0.1.GA
            00:53:46,806 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory C:\Users\cuervo\jboss-as-7.1.0.Final\standalone\deployments
            00:53:46,883 INFO  [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on localhost/127.0.0.1:4447
            00:53:46,883 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /127.0.0.1:9999
            00:53:47,071 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found poh55.war in deployment directory. To trigger deployment create a file called poh55.war.dodeploy
            00:53:47,598 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
            00:53:48,125 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "poh55.war"
            00:53:52,996 INFO  [org.jboss.as.jpa] (MSC service thread 1-2) JBAS011401: Read persistence.xml for primary
            00:53:54,511 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment poh55.war
            00:53:54,661 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named MemberService in deployment unit deployment "poh55.war" are as follows:

            java:global/poh55/MemberService!com.cuervo.pro.rest.MemberService
            java:app/poh55/MemberService!com.cuervo.pro.rest.MemberService
            java:module/MemberService!com.cuervo.pro.rest.MemberService
            java:global/poh55/MemberService
            java:app/poh55/MemberService
            java:module/MemberService

            00:53:56,847 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016005: Starting Services for CDI deployment: poh55.war
            00:53:57,105 INFO  [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900 1.1.5 (AS71)
            00:53:57,348 INFO  [org.jboss.as.jpa] (MSC service thread 1-2) JBAS011402: Starting Persistence Unit Service 'poh55.war#primary'
            00:53:59,130 INFO  [org.hibernate.annotations.common.Version] (MSC service thread 1-2) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
            00:53:59,321 INFO  [org.hibernate.Version] (MSC service thread 1-2) HHH000412: Hibernate Core {4.0.1.Final}
            00:53:59,439 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-2) HHH000206: hibernate.properties not found
            00:53:59,456 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-2) HHH000021: Bytecode provider name : javassist
            00:53:59,974 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-2) HHH000204: Processing PersistenceUnitInfo [
            name: primary
            ...]
            00:54:03,079 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (MSC service thread 1-2) HHH000402: Using Hibernate built-in connection pool (not for production use!)
            00:54:03,086 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.persistenceunit."poh55.war#primary": org.jboss.msc.service.StartException in service jboss.persistenceunit."poh55.war#primary": 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.runWorker(Unknown Source) [rt.jar:1.7.0_03]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_03]
            at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_03]
            Caused by: javax.persistence.PersistenceException: [PersistenceUnit: primary] 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: Specified JDBC Driver org.postgresql.Driver class not found
            at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:104)
            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.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:234)
            at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:91)
            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
            Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver from [Module "org.hibernate:main" from local module loader @ab9eed (roots: C:\Users\cuervo\jboss-as-7.1.0.Final\modules)]
            at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
            at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
            at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
            at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
            at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
            at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_03]
            at java.lang.Class.forName(Unknown Source) [rt.jar:1.7.0_03]
            at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:192)
            at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:101)
            ... 23 more

            00:54:03,318 ERROR [org.jboss.as] (MSC service thread 1-3) JBAS015875: JBoss AS 7.1.0.Final "Thunder" started (with errors) in 43426ms - Started 177 of 275 services (25 services failed or missing dependencies, 72 services are passive or on-demand)
            00:54:03,530 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "poh55.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.persistenceunit.\"poh55.war#primary\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"poh55.war#primary\": Failed to start service"}}
            00:54:03,687 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment poh55.war in 150ms
            00:54:03,694 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
            JBAS014777:   Services which failed to start:      service jboss.persistenceunit."poh55.war#primary": org.jboss.msc.service.StartException in service jboss.persistenceunit."poh55.war#primary": Failed to start service

            00:54:03,710 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.persistenceunit.\"poh55.war#primary\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"poh55.war#primary\": Failed to start service"}}}}
            00:54:12,296 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (Finalizer) HHH000030: Cleaning up connection pool [null]

             

            Moreover, the persistence file I have so:

             

            <?xml version="1.0" encoding="UTF-8"?>

            <persistence version="2.0"

               xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

               xsi:schemaLocation="

                    http://java.sun.com/xml/ns/persistence

                    http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

               <persistence-unit name="primary" transaction-type="RESOURCE_LOCAL">

             

                <class>com.cuervo.pro.model.Member</class>

                  <properties>

                     <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>

                     <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>

                     <property name="hibernate.connection.username" value="postgres"/>

                     <property name="hibernate.connection.password" value="cuervo"/>

                     <property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/enem"/>

                     <property name="hibernate.max_fetch_depth" value="3"/>

                  </properties>

               </persistence-unit>

            </persistence>

             

             

            Thanks

            • 3. Re: AeroGear+Postgresql+Tomcat
              jbalunas

              Are you sure this is tomcat?  These logs all look like JBoss AS 7 to me.  The AeroGear quickstart is based on Java EE6 (at least the backend REST services) so tomcat would not work as is.

               

              Also, based on the error below you need to add the postgresql driver class to the project's pom.xml dependencies.  Take a look at JBoss AS 7 - Datasource configuration for postgresql for more information on that.

              Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver from [Module "org.hibernate:main" from local module loader @ab9eed (roots: C:\Users\cuervo\jboss-as-7.1.0.Final\modules)]

               

              Hope that helps!

              • 4. Re: AeroGear+Postgresql+Tomcat
                crowcommand

                Thanks for responding, but what I try is to deployed the  War file  in tomcat. I guess I need to copy the driver and  configure persistence.xml

                 

                how I do this?

                where to copy the driver?

                 

                thanks ...