jbuilder to tomcat error

Posted on 2005-04-15
Last Modified: 2010-04-01

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:


org.apache.jasper.JasperException: Unable to compile class for JSPNote: has been deprecated.

An error occurred between lines: 35 and 73 in the jsp file: /momentum/JSPTest/defaultroot/JSPTest.jsp

Generated servlet error:
G:\Apache Tomcat 4.0\work\Standalone\localhost\_\momentum\JSPTest\defaultroot\JSPTest$ Class oracle.jdbc.driver.OracleDriver not found.
                      DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

An error occurred between lines: 81 and 175 in the jsp file: /momentum/JSPTest/defaultroot/JSPTest.jsp

Generated servlet error:
G:\Apache Tomcat 4.0\work\Standalone\localhost\_\momentum\JSPTest\defaultroot\JSPTest$ 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 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?

Question by:act1ve

    Author Comment

    i just tried another piece of code, not created with jbuilder and i get the following error:

    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";
            // 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.getConnection(url, username, password);
        } catch (ClassNotFoundException e) {
            out.println( "Could not find the database driver");
        } catch (SQLException e) {
            out.println( "Could not connect to the database");

     if( connection == null )
        out.println( "Giving up...connection is null" ) ;
        try {
            // Create a result set containing all data from my_table
            Statement stmt = connection.createStatement();
            ResultSet rs = stmt.executeQuery("SELECT * FROM Supervisor");
          while( )
                out.println( rs.getString( 1 ) + "<BR>" );
           } catch (SQLException e) {

    i definatly have in WEB-INF\lib though

    LVL 29

    Accepted Solution

    Try  putting in <tomcat>_HOME/common/lib

    and see here:

    Author Comment

    same error unfortunaetly :(

    my path to is now Apache Tomcat 4.0\common\lib

    i'm not too sure what could be wrong here, thanks for your help


    Author Comment

    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\lib

    then classes.jar,

    its connecting ok now!

    thanks for your help
    LVL 29

    Expert Comment

    Sweet! glad it worked...:-)

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
    Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now