2 Replies Latest reply on Jan 15, 2009 3:09 PM by Coen Damen

    Problem with Oracle driver on Embedded JBoss

    Coen Damen Novice

      Hi,


      I am having great troubles getting my Seam app to run on Tomcat. I can successfully deploy to JBoss 4.2.2. I am using Seam 2.1.0.SP1.


      This is the problem:


      
      WARN  [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] 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: oracle.jdbc.OracleDriver, url: 
                              jdbc:oracle:thin:@localhost:1521:XE
                      )
              at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:214)
              at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)
              at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:590)
              at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:254)
              at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:615)
              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:84)
              at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
              at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
              at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:918)
              at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:656)
              at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
              at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:259)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
              at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
              at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
              at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
              at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
              at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
              at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
              at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
              at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
              at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
              at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:96)
              at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:90)
              at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:151)
              at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:604)
              at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:400)
              at org.jboss.ejb3.deployers.EJBStage2Deployer.deploy(EJBStage2Deployer.java:53)
              at org.jboss.ejb3.deployers.EJBStage2Deployer.deploy(EJBStage2Deployer.java:37)
              at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65)
              at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
              at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:906)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
              at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
              at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
              at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
              at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:127)
              at org.jboss.embedded.tomcat.WebinfScanner.lifecycleEvent(WebinfScanner.java:90)
              at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
              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:578)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
              at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      Caused by: org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.OracleDriver, url: 
                              jdbc:oracle:thin:@NL-L3G2716:1521:XE
                      
              at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:470)
              at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:205)
              ... 80 more
      
      
      



      I have done the following things:
      - added a ojdbc14.jar to the TOMCAT/lib directory
      - set up the datasource in persistence.xml, context.xml and server.xml
      - added the datasource to the apache-tomcat-6.0.18/lib/deploy directory.


      I see in the log that it is picking up the datasource, however, I do not understand the driver problem. Also because all is working fine on JBoss.


      This is my datasource:




      Please help,
      Coen