act1ve
asked on
jbuilder to tomcat error
Hi,
I created a simple jsp page with Jbuilder to pull info from a oracle db. It worked perfect within Jbuilder when i ran it. However im struggling to get this over to the folder where i have tomcat installed to run it outside of jbuilder.
I copied the folder which was created by Jbuilder, namely, "JSPTest" into my webapps folder. However i'm getting erros when i try and run JSPTest.jsp saying:
exception
org.apache.jasper.JasperEx ception: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
An error occurred between lines: 35 and 73 in the jsp file: /momentum/JSPTest/defaultr oot/JSPTes t.jsp
Generated servlet error:
G:\Apache Tomcat 4.0\work\Standalone\localh ost\_\mome ntum\JSPTe st\default root\JSPTe st$jsp.jav a:80: Class oracle.jdbc.driver.OracleD river not found.
DriverManager.registerDriv er(new oracle.jdbc.driver.OracleD river());
^
An error occurred between lines: 81 and 175 in the jsp file: /momentum/JSPTest/defaultr oot/JSPTes t.jsp
Generated servlet error:
G:\Apache Tomcat 4.0\work\Standalone\localh ost\_\mome ntum\JSPTe st\default root\JSPTe st$jsp.jav a:151: Class org.apache.jsp.IOException not found.
catch (IOException ioe) {
This works perfectly in Jbuilder though.
I have oracle drivers in web-inf/lib.
In jbuilder i added the drivers by doing the following:
Select Project->Default Project Properties.
Click the "Required Libraries" tab in the center of the dialog window, and click "Add".
Click "New" to add a new library. You should see the New Library Wizard. Give the new library a name like "Oracle JDBC Driver".
Click the "Add" button and click in the directory chooser until you've selected classes111.zip in the directory where you installed it or found it. Be sure to select the file itself, not the directory it's in. Click "OK" to select the file.
I can't understand why it will run in jbuilder but then not on its own in tomcat?
I created a simple jsp page with Jbuilder to pull info from a oracle db. It worked perfect within Jbuilder when i ran it. However im struggling to get this over to the folder where i have tomcat installed to run it outside of jbuilder.
I copied the folder which was created by Jbuilder, namely, "JSPTest" into my webapps folder. However i'm getting erros when i try and run JSPTest.jsp saying:
exception
org.apache.jasper.JasperEx
An error occurred between lines: 35 and 73 in the jsp file: /momentum/JSPTest/defaultr
Generated servlet error:
G:\Apache Tomcat 4.0\work\Standalone\localh
DriverManager.registerDriv
^
An error occurred between lines: 81 and 175 in the jsp file: /momentum/JSPTest/defaultr
Generated servlet error:
G:\Apache Tomcat 4.0\work\Standalone\localh
catch (IOException ioe) {
This works perfectly in Jbuilder though.
I have oracle drivers in web-inf/lib.
In jbuilder i added the drivers by doing the following:
Select Project->Default Project Properties.
Click the "Required Libraries" tab in the center of the dialog window, and click "Add".
Click "New" to add a new library. You should see the New Library Wizard. Give the new library a name like "Oracle JDBC Driver".
Click the "Add" button and click in the directory chooser until you've selected classes111.zip in the directory where you installed it or found it. Be sure to select the file itself, not the directory it's in. Click "OK" to select the file.
I can't understand why it will run in jbuilder but then not on its own in tomcat?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
same error unfortunaetly :(
my path to classes111.zip is now Apache Tomcat 4.0\common\lib
i'm not too sure what could be wrong here, thanks for your help
my path to classes111.zip is now Apache Tomcat 4.0\common\lib
i'm not too sure what could be wrong here, thanks for your help
ASKER
hey mate, what i did was rename the zip to .jar, i think per as your suggestion in a previous question i made
the full path i have to it now is:
Apache Tomcat 4.0\webapps\ROOT\WEB-INF\l ib
then classes.jar,
its connecting ok now!
thanks for your help
the full path i have to it now is:
Apache Tomcat 4.0\webapps\ROOT\WEB-INF\l
then classes.jar,
its connecting ok now!
thanks for your help
Sweet! glad it worked...:-)
ASKER
Could not find the database driver Giving up...connection is null
Looks like it cant find db driver for some reason:
this is my code i tried
<%@ page import="java.sql.*" %>
<%
Connection connection = null;
try {
// Load the JDBC driver
String driverName = "oracle.jdbc.OracleDriver"
Class.forName(driverName);
// Create a connection to the database
String serverName = "server";
String portNumber = "1521";
String sid = "orawit";
String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
String username = "username";
String password = "password";
connection = DriverManager.getConnectio
} catch (ClassNotFoundException e) {
out.println( "Could not find the database driver");
} catch (SQLException e) {
e.printStackTrace();
out.println( "Could not connect to the database");
}
if( connection == null )
{
out.println( "Giving up...connection is null" ) ;
}
else
{
try {
// Create a result set containing all data from my_table
Statement stmt = connection.createStatement
ResultSet rs = stmt.executeQuery("SELECT * FROM Supervisor");
while( rs.next() )
{
out.println( rs.getString( 1 ) + "<BR>" );
}
} catch (SQLException e) {
}
}
%>
i definatly have classes111.zip in WEB-INF\lib though