File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes where to copy classes111.zip in tomcat ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "where to copy classes111.zip in tomcat ?" Watch "where to copy classes111.zip in tomcat ?" New topic
Author

where to copy classes111.zip in tomcat ?

Nash Jetts
Greenhorn

Joined: Apr 22, 2005
Posts: 4
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)


Nash Jetts,<br />SCJP 1.4, SCWCD (on-my-way!)
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Try changing the extension from ".zip" to ".jar"


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Nash Jetts
Greenhorn

Joined: Apr 22, 2005
Posts: 4
yes it worked !!! I renamed from zip to jar and placed in <TOMCAT_HOME>/common/lib

Thanks Ben!
peter wooster
Ranch Hand

Joined: Jun 13, 2004
Posts: 1033
You should probably be using classes12.jar, which is intended for Java 2 applications. See the Oracle documentation.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: where to copy classes111.zip in tomcat ?
 
Similar Threads
Getting exception on deployment to Tomcat using JSF
Error - Name jdbc is not bound in this Context
Help with NullPointerException
jsp page not show oracle data
java.sql.SQLException: Non supported SQL92 token at position: 377: