[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - where to put my database driver

davidhu do-not-reply at jboss.com
Thu May 10 14:44:08 EDT 2007


I have a j2ee application that is packaged into a WAR file. It used to work very well in Linux with jboss 4.0.2. However, recently, for some unknown reason, when my web app. tries to connect to the database, I got the following exception

[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.driver.OracleDriver, url: jdbc:oracle:thin:@xxxx:1521:xx)

at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.c                                              reateManagedConnection(LocalManagedConnectionFactory.java:179)
        at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.cr                                              eateConnectionEventListener(InternalManagedConnectionPool.java:565)
        at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.ge                                              tConnection(InternalManagedConnectionPool.java:250)
        at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BaseP                                              ool.getConnection(JBossManagedConnectionPool.java:491)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManage                                              dConnection(BaseConnectionManager2.java:341)
        at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedCo                                              nnection(TxConnectionManager.java:301)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateC                                              onnection(BaseConnectionManager2.java:396)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2$Connectio                                              nManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
        at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrapp                                              erDataSource.java:88)
        at .......
..............................


I later found out the reason I got this exception is that I put ojdbc14.jar inside the dir $my_app_context/WEB-INF/lib, if I put it under $jboss_home/server/default/lib, I do not have this problem. But I tried on Windows, even if I put this jar file under $jboss_home/server/default/lib, I do not have this problem. Why I got this strange behavior? I do want to package this ojdbc14.jar into my WAR file, so that the user will not need to copy it explicitly to the $jboss_home/server/default/lib dir.

I have another file called oracle-ds.xml which was put in $jboss_home/server/default/deploy to config oracle data source.

Can anyone help me on my problem?

Thanks,

David


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044781#4044781

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044781



More information about the jboss-user mailing list