dkim18
asked on
ClassNotFoundException: oracle.jdbc.driver.OracleDriver - jboss seam deploy issue
Hi Experts,
I am in the middle of developing a small jboss seam project. I deployed ear file on test server(linux), but have this error.
Caused by: org.hibernate.exception.Ge nericJDBCE xception: Cannot open connection
at org.hibernate.exception.SQ LStateConv erter.hand ledNonSpec ificExcept ion(SQLSta teConverte r.java:103 )
at org.hibernate.exception.SQ LStateConv erter.conv ert(SQLSta teConverte r.java:91)
at org.hibernate.exception.JD BCExceptio nHelper.co nvert(JDBC ExceptionH elper.java :43)
at org.hibernate.exception.JD BCExceptio nHelper.co nvert(JDBC ExceptionH elper.java :29)
at org.hibernate.jdbc.Connect ionManager .openConne ction(Conn ectionMana ger.java:4 26)
at org.hibernate.jdbc.Connect ionManager .getConnec tion(Conne ctionManag er.java:14 4)
at org.hibernate.jdbc.Abstrac tBatcher.p repareQuer yStatement (AbstractB atcher.jav a:139)
at org.hibernate.loader.Loade r.prepareQ ueryStatem ent(Loader .java:1547 )
at org.hibernate.loader.Loade r.doQuery( Loader.jav a:673)
at org.hibernate.loader.Loade r.doQueryA ndInitiali zeNonLazyC ollections (Loader.ja va:236)
at org.hibernate.loader.Loade r.doList(L oader.java :2220)
at org.hibernate.loader.Loade r.listIgno reQueryCac he(Loader. java:2104)
at org.hibernate.loader.Loade r.list(Loa der.java:2 099)
at org.hibernate.loader.hql.Q ueryLoader .list(Quer yLoader.ja va:378)
at org.hibernate.hql.ast.Quer yTranslato rImpl.list (QueryTran slatorImpl .java:338)
at org.hibernate.engine.query .HQLQueryP lan.perfor mList(HQLQ ueryPlan.j ava:172)
at org.hibernate.impl.Session Impl.list( SessionImp l.java:112 1)
at org.hibernate.impl.QueryIm pl.list(Qu eryImpl.ja va:79)
at org.hibernate.ejb.QueryImp l.getResul tList(Quer yImpl.java :64)
... 89 more
Caused by: org.jboss.util.NestedSQLEx ception: Could not create connection; - nested throwable: (org.jboss.resource.JBossR esourceExc eption: Failed to register driver for: oracle.jdbc.driver.OracleD river; - nested throwable: (java.lang.ClassNotFoundEx ception: oracle.jdbc.driver.OracleD river)); - nested throwable: (org.jboss.resource.JBossR esourceExc eption: Could not create connection; - nested throwable: (org.jboss.resource.JBossR esourceExc eption: Failed to register driver for: oracle.jdbc.driver.OracleD river; - nested throwable: (java.lang.ClassNotFoundEx ception: oracle.jdbc.driver.OracleD river)))
at org.jboss.resource.adapter .jdbc.Wrap perDataSou rce.getCon nection(Wr apperDataS ource.java :95)
at org.hibernate.ejb.connecti on.Injecte dDataSourc eConnectio nProvider. getConnect ion(Inject edDataSour ceConnecti onProvider .java:47)
at org.hibernate.jdbc.Connect ionManager .openConne ction(Conn ectionMana ger.java:4 23)
... 103 more
Caused by: org.jboss.resource.JBossRe sourceExce ption: Could not create connection; - nested throwable: (org.jboss.resource.JBossR esourceExc eption: Failed to register driver for: oracle.jdbc.driver.OracleD river; - nested throwable: (java.lang.ClassNotFoundEx ception: oracle.jdbc.driver.OracleD river))
at org.jboss.resource.adapter .jdbc.loca l.LocalMan agedConnec tionFactor y.createMa nagedConne ction(Loca lManagedCo nnectionFa ctory.java :190)
at org.jboss.resource.connect ionmanager .InternalM anagedConn ectionPool .createCon nectionEve ntListener (InternalM anagedConn ectionPool .java:619)
at org.jboss.resource.connect ionmanager .InternalM anagedConn ectionPool .getConnec tion(Inter nalManaged Connection Pool.java: 264)
at org.jboss.resource.connect ionmanager .JBossMana gedConnect ionPool$Ba sePool.get Connection (JBossMana gedConnect ionPool.ja va:613)
at org.jboss.resource.connect ionmanager .BaseConne ctionManag er2.getMan agedConnec tion(BaseC onnectionM anager2.ja va:347)
at org.jboss.resource.connect ionmanager .TxConnect ionManager .getManage dConnectio n(TxConnec tionManage r.java:330 )
at org.jboss.resource.connect ionmanager .BaseConne ctionManag er2.alloca teConnecti on(BaseCon nectionMan ager2.java :402)
at org.jboss.resource.connect ionmanager .BaseConne ctionManag er2$Connec tionManage rProxy.all ocateConne ction(Base Connection Manager2.j ava:849)
at org.jboss.resource.adapter .jdbc.Wrap perDataSou rce.getCon nection(Wr apperDataS ource.java :89)
... 105 more
Caused by: org.jboss.resource.JBossRe sourceExce ption: Failed to register driver for: oracle.jdbc.driver.OracleD river; - nested throwable: (java.lang.ClassNotFoundEx ception: oracle.jdbc.driver.OracleD river)
at org.jboss.resource.adapter .jdbc.loca l.LocalMan agedConnec tionFactor y.getDrive r(LocalMan agedConnec tionFactor y.java:298 )
at org.jboss.resource.adapter .jdbc.loca l.LocalMan agedConnec tionFactor y.createMa nagedConne ction(Loca lManagedCo nnectionFa ctory.java :171)
... 113 more
Caused by: java.lang.ClassNotFoundExc eption: oracle.jdbc.driver.OracleD river
at org.apache.catalina.loader .WebappCla ssLoader.l oadClass(W ebappClass Loader.jav a:1358)
at org.apache.catalina.loader .WebappCla ssLoader.l oadClass(W ebappClass Loader.jav a:1204)
at java.lang.ClassLoader.load ClassInter nal(ClassL oader.java :319)
at java.lang.Class.forName0(N ative Method)
at java.lang.Class.forName(Cl ass.java:2 42)
at org.jboss.resource.adapter .jdbc.loca l.LocalMan agedConnec tionFactor y.getDrive r(LocalMan agedConnec tionFactor y.java:283 )
... 114 more
++++++++++++
It worked fine on my local machine. I added I added ojdbc14.jar under /usr/local/jboss-as/jboss- 4.2.3.GA/s erver/defa ult/lib , but didn't help.
I transferred xxxx-ds.xml file under /usr/local/jboss-as/jboss- 4.2.3.GA/s erver/defa ult/deploy as well.
The web app works when displaying login page, but when it needs to talk to oracle db, it fails.
Any ideas?
thanks,
I am in the middle of developing a small jboss seam project. I deployed ear file on test server(linux), but have this error.
Caused by: org.hibernate.exception.Ge
at org.hibernate.exception.SQ
at org.hibernate.exception.SQ
at org.hibernate.exception.JD
at org.hibernate.exception.JD
at org.hibernate.jdbc.Connect
at org.hibernate.jdbc.Connect
at org.hibernate.jdbc.Abstrac
at org.hibernate.loader.Loade
at org.hibernate.loader.Loade
at org.hibernate.loader.Loade
at org.hibernate.loader.Loade
at org.hibernate.loader.Loade
at org.hibernate.loader.Loade
at org.hibernate.loader.hql.Q
at org.hibernate.hql.ast.Quer
at org.hibernate.engine.query
at org.hibernate.impl.Session
at org.hibernate.impl.QueryIm
at org.hibernate.ejb.QueryImp
... 89 more
Caused by: org.jboss.util.NestedSQLEx
at org.jboss.resource.adapter
at org.hibernate.ejb.connecti
at org.hibernate.jdbc.Connect
... 103 more
Caused by: org.jboss.resource.JBossRe
at org.jboss.resource.adapter
at org.jboss.resource.connect
at org.jboss.resource.connect
at org.jboss.resource.connect
at org.jboss.resource.connect
at org.jboss.resource.connect
at org.jboss.resource.connect
at org.jboss.resource.connect
at org.jboss.resource.adapter
... 105 more
Caused by: org.jboss.resource.JBossRe
at org.jboss.resource.adapter
at org.jboss.resource.adapter
... 113 more
Caused by: java.lang.ClassNotFoundExc
at org.apache.catalina.loader
at org.apache.catalina.loader
at java.lang.ClassLoader.load
at java.lang.Class.forName0(N
at java.lang.Class.forName(Cl
at org.jboss.resource.adapter
... 114 more
++++++++++++
It worked fine on my local machine. I added I added ojdbc14.jar under /usr/local/jboss-as/jboss-
I transferred xxxx-ds.xml file under /usr/local/jboss-as/jboss-
The web app works when displaying login page, but when it needs to talk to oracle db, it fails.
Any ideas?
thanks,
ASKER
Are the rights set up correctly on the file? Doe the user running the JBoss app have access to that file? It should need only read access.
>>yes. the EAR file contains everything.
Are there any firewall concerns between your new environment and the Oracle DB?
>>no
Is Oracle configured to allow connections from this machine?
>>The dev of the external website is on this box and talk to oracle with no problems. So, it should work.
Is the user name password correct?
>>yes, it works from my local machine.
Do you have the correct connection URL? Make sure you are not using localhost.
>>yes, the login page works fine.
>>yes. the EAR file contains everything.
Are there any firewall concerns between your new environment and the Oracle DB?
>>no
Is Oracle configured to allow connections from this machine?
>>The dev of the external website is on this box and talk to oracle with no problems. So, it should work.
Is the user name password correct?
>>yes, it works from my local machine.
Do you have the correct connection URL? Make sure you are not using localhost.
>>yes, the login page works fine.
Are you sure that you are using the defauly config of jboss and not the all config? What is the ide that you are using?
ASKER
what are the differences between the default config and all config? I am using eclipse ganymede.
All is used for clustering and advanced jboss configs. Can you press Ctrl+Shift+T in the ide and see if you can locate the class OracleDriver, if yes then see what is location?
ASKER
Ok, I typed "oracle" and I see many ojdbc14.jar locations. For this project, I see the location as "project_name/lib/ojdbc14. jar" as "OracleTye", "OrackeTypeADT", etc...
ASKER
Another word:
OracleType=project_name/li b/ojdbc14. jar
...
OracleTypeADT=project_name /lib/ojdbc 14.jar
...
...
OracleType=project_name/li
...
OracleTypeADT=project_name
...
...
project_name - is that the name of the project or some variable?
ASKER
yes, it is the project name.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi ,
I too faced the same error . Add classes12.jar / classes12.zip files present in the java/lib folder in the classpath . then it will start working.
I too faced the same error . Add classes12.jar / classes12.zip files present in the java/lib folder in the classpath . then it will start working.
Are there any firewall concerns between your new environment and the Oracle DB?
Is Oracle configured to allow connections from this machine?
Is the user name password correct?
Do you have the correct connection URL? Make sure you are not using localhost.