3 Replies Latest reply on Aug 13, 2007 2:53 PM by Pete Muir

    Tomcat db connection problem

    Stateless Bean Novice

      Hi,
      I moved my app to Seam 2.0 Beta1 and tomcat 6 and here I get problem.
      For some reasons my connection get faild, before migration everythink worked fine.

      Here is my stacktrace:

      2007-08-13 17:00:06 org.apache.catalina.core.AprLifecycleListener init
      INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.5.0_09\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\Grzesiek - Laptop\Programy\Ant-1.7.0\bin;
      2007-08-13 17:00:07 org.apache.coyote.http11.Http11Protocol init
      INFO: Initializing Coyote HTTP/1.1 on http-8080
      2007-08-13 17:00:07 org.apache.catalina.startup.Catalina load
      INFO: Initialization processed in 1516 ms
      WARN 13-08 17:00:10,921 (UnifiedLoaderRepository3.java:addClassLoader:675) -Tried to add non-URLClassLoader. Ignored
      WARN 13-08 17:00:15,203 (TxControl.java:<clinit>:266) -[com.arjuna.ats.arjuna.coordinator.TxControl_1] - Name of XA node not defined. Using -3f57ffff:66d:46c071ff:0
      WARN 13-08 17:00:24,359 (JDBCPersistenceManager.java:start:143) -
      
      JBoss Messaging Warning: DataSource connection transaction isolation should be READ_COMMITTED, but it is currently NONE.
       Using an isolation level less strict than READ_COMMITTED may lead to data consistency problems.
       Using an isolation level more strict than READ_COMMITTED may lead to deadlock.
      
      2007-08-13 17:00:27 org.apache.catalina.core.StandardService start
      INFO: Starting service Catalina
      2007-08-13 17:00:27 org.apache.catalina.core.StandardEngine start
      INFO: Starting Servlet Engine: Apache Tomcat/6.0.13
      2007-08-13 17:00:27 org.apache.catalina.startup.HostConfig deployWAR
      INFO: Deploying web application archive Universum.war
      2007-08-13 17:00:30 org.apache.catalina.loader.WebappLoader start
      INFO: Dual registration of jndi stream handler: factory already defined
      WARN 13-08 17:01:14,656 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
      WARN 13-08 17:01:15,171 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
      WARN 13-08 17:01:20,921 (InternalManagedConnectionPool.java:getConnection:278) -Throwable while attempting to get a new connection: null
      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: org.postgresql.Driver, url: jdbc:postgresql://localhost:5432/Universum)
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:201)
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:182)
       at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:586)
       at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:254)
       at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:580)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
       at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:351)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:394)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:838)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
       at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
       at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
       at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2006)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1289)
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:691)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
       at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
      


      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE datasources
       PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
       "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
      
      <datasources>
       <local-tx-datasource>
       <jndi-name>UniversumDatasource</jndi-name>
       <connection-url>jdbc:postgresql://localhost:5432/Universum</connection-url>
       <driver-class>org.postgresql.Driver</driver-class>
       <user-name>***</user-name>
       <password>***</password>
       <blocking-timeout-millis>50000</blocking-timeout-millis>
      
       <metadata>
       <type-mapping>PostgreSQL 8.2</type-mapping>
       </metadata>
       </local-tx-datasource>
      </datasources>
      


      my connection driver is in *.war -> lib/ directory
      postgresql-8.2-505.jdbc3.jar

      I use postgres 8.2, can anyone explain me why after migration my connection doesn't work?

        • 1. Re: Tomcat db connection problem
          Stateless Bean Novice

          but when i move my jar driver to common/lib i get this


          2007-08-13 17:19:55 org.apache.tomcat.util.modeler.Registry registerComponent
          SEVERE: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/Universum,J2EEApplication=none,J2EEServer=none
          2007-08-13 17:19:55 org.apache.catalina.startup.HostConfig deployWAR
          SEVERE: Error deploying web application archive Universum.war
          java.lang.RuntimeException: org.jboss.deployers.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

          *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}

          jboss.jdbc:datasource=UniversumDatasource,service=metadata
          -> jboss.jdbc:service=metadata{Create:** NOT FOUND **}
          -> jboss.jdbc:service=metadata{Start:** NOT FOUND **}


          *** CONTEXTS IN ERROR: Name -> Error

          jboss.jdbc:service=metadata -> ** NOT FOUND **


          at org.jboss.embedded.tomcat.WebinfScanner.lifecycleEvent(WebinfScanner.java:92)
          at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
          at org.apache.catalina.core.StandardContext.start(StandardContext.java:4236)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
          at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
          at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
          at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
          at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
          at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
          at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
          at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
          at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
          at org.apache.catalina.core.StandardService.start(StandardService.java:516)
          at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
          at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
          Caused by: org.jboss.deployers.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):


          • 2. Re: Tomcat db connection problem
            Stateless Bean Novice

            Do I need specify somethink special except my Universum-ds.xml file for connection?

            I found info on tomcat official page aobut configuring resource in CONF/context.xml and web.xml, but I not configured this.

            • 3. Re: Tomcat db connection problem
              Pete Muir Master

              Try asking this on the JBoss Embedded forum.