Failed to register driver for Oracle on JBoss
Issue
Oracle driver not found exception.
When configuring a oracle Data Source and test the connection from console, notice the below error:
WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (ResourceContainer.invoker.nonDaemon-1) Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: oracle.jdbc.driver.OracleDriver; - nested throwable: (java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver from BaseClassLoader@15b2e18{vfsfile:/jboss-eap-5.1/jboss-as/server/default/deploy/oracle-ds.xml}))
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:225)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:639)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:273)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:690)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool.internalTestConnection(JBossManagedConnectionPool.java:347)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool.testConnection(JBossManagedConnectionPool.java:402)
... more
Caused by: org.jboss.resource.JBossResourceException: Failed to register driver for: oracle.jdbc.driver.OracleDriver; - nested throwable: (java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver from BaseClassLoader@15b2e18{vfsfile:/jboss-eap-5.1/jboss-as/server/default/deploy/oracle-ds.xml})
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:489)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:206)
... more
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver from BaseClassLoader@15b2e18{vfsfile:/jboss-eap-5.1/jboss-as/server/default/deploy/oracle-ds.xml}
at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:477)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:474)
Environment
Red Hat JBoss Enterprise Application Platform (EAP)
- 4.x
- 5.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
