• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.ClassNotFoundException: oracle:jdbc:driver:OracleDriver

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have imported all related jar (ojdbc14.jar,classes12.jar,classes12.zip,ojdbc14_g.jar) still i am getting Connection Error.


java.lang.ClassNotFoundException: oracle:jdbc:driver:OracleDriver
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.ABC.HelloServlet.doPost(HelloServlet.java:51)
at com.ABC.HelloServlet.doGet(HelloServlet.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

my servlet code is

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection("jdbc:oracle:thin:@10.123.75.78:1521:findb01", "e102971","e102971");
DBstatement = conn.createStatement();

attached is full servlet file

my classpath is
C:>echo %CLASSPATH%
C:\Program Files\Java\jdk1.5.0_06\lib;C:\Program Files\Java\jdk1.5.0_06\lib\tools.jar;C:\eclipse\FinJSPStudio\CodeGen\Installables\jdom.jar;D:\oracle\product\10.2.0\client_1\jdbc\lib\ojdbc14.jar;D:\oracle\product\10.2.0\client_1\jdbc\lib\classes12.zip;C:\Python24;

PLease advice what to do

TIA
mukul
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat?
Is the driver lib on the classpath of the Tomcat server?
 
mukul kulshrestha
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have put all the jar files in TOMCAT installed dir
C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib

but have not set this in classpath of the Tomcat server
btw
how to do that ? please suggest.

i am just beginner in this

TIA
mukul
 
Ed Ward
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Been a while since I've worked with Tomcat. But its probably something like %CATALINA_HOME%/common/lib
Don't quote me though.

Have a look at this thread: https://coderanch.com/t/509405/Tomcat/Loaded-jar-files-tomcat

As I recall, you only need one of the driver libs which you have noted on the server classpath. The key is to identify which one you need.

Sorry can't be of more help.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

mukul kulshrestha wrote:i have put all the jar files in TOMCAT installed dir
C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib

but have not set this in classpath of the Tomcat server
btw
how to do that ? please suggest.

i am just beginner in this

TIA
mukul



i've used the "old" way, adding it to the tomcat lib folder everything works fine. Yet if you haven't find a solution , the "clean" solution is to add the path to external jar into the catalina.properties , shared.loader value
 
reply
    Bookmark Topic Watch Topic
  • New Topic