• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where to copy classes111.zip in tomcat ?

 
Nash Jetts
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I copied it to <TOMCAT_HOME>/common/lib, but it gives a runtime error during execution of the servlet.

Pasted below is the error - here is the code I am using,
"
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
Connection conn =
DriverManager.getConnection("jdbc racle ci8:@database","scott","tiger");
String strQuery = "select * from scott.EMP" ;
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(strQuery);
while(rs.next())
{
String strName = rs.getString("ENAME");
out.println(strName + "<BR>");
}
"

ERROR -

exception

javax.servlet.ServletException: Servlet execution threw an exception


root cause

java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
DBTestServlet.doGet(DBTestServlet.java:38)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try changing the extension from ".zip" to ".jar"
 
Nash Jetts
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes it worked !!! I renamed from zip to jar and placed in <TOMCAT_HOME>/common/lib

Thanks Ben!
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should probably be using classes12.jar, which is intended for Java 2 applications. See the Oracle documentation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic