Tomcat 4.0.4 classpath

Hi
I've installed tomcat 4.0.4 as NT service. Now I cant figure out how to set my classpath that my application needs. Could anyone help me out on this one?

Hi
I've installed tomcat 4.0.4 as NT service. Now I cant
figure out how to set my classpath that my application
needs. Could anyone help me out on this one?I installed Tomcat on Win ME and had a few problems with the classpath and the Java_Home variable. This page is for an older version of Tomcat, but the classpath fix helped me. Good luck!
http://archive.coreservlets.com/Using-Tomcat-3.2.html

Similar Messages

  • Starting tomcat server after setting classpath for java

    Sorry if this is nothing to do with java, it is more to do with starting tomcat server.
    Tomcat server has been working totally fine, but when I wanted to compile a java servlet I wrote for it, I needed to run a BAT file called gojava in MS-DOS that had the classpath for java to work properly. I then attempted to run Tomcat, but just got 'bad command'. As long as I don't start up java by setting the classpath, tomcat will work, but as I need java to write servlets and then to test them without restarting my PC each time, how do I get tomcat to work?
    Thanks
    Hannah

    Sounds like your batch file is changing your path, not your classpath. If you're getting "Bad command or filename" when attempting to run Tomcat, it can't find the executable. Check out the .bat file and see what it's doing (maybe even post it here for further clarity). If it's changing your path at all, make sure it includes a %path% to indicate that it simply wants to append items to the path, not overwrite it completely. Sorry if i'm way off base with my suggestions, but it sounds like that's where the problem's going to be, especially if rebooting resolves the problem.

  • How to edit CLASSPATH in TOMCAT?

    Hello...
    How can I access my classes in my JSP file if I use Tomcat?
    I have put classes12.zip in my classpath (my java console
    application recognized the classes). But my JSP (through
    TOMCAT) cannot recognized the classes.
    Please help.
    Thank you.

    Tomcat generally ignores the CLASSPATH environment variable. Typically shared classes are copied to TOMCATHOME/lib (ZIPs and JARs)
    I've heard from many peer developers not to use zip but to rename them to JAR. Not sure why though; I've had success using both.
    - Chris

  • Setting classpath in Tomcat on AIX

    Hi All
    Can any one know how to set classpath for jsf application in tomcat on AIX.

    Refer to the Tomcat's documentation regarding classpaths and classloading. The underlying operating system doesn't really matter.

  • No class found on 2k box using IIS, tomcat, SDK 2

    I just finished the install and config, and got tomcat running fine. but even the simplest jsp example would not load. i got the class not found error.
    what the hell? i don believe.

    ok, got it working. all i had to do was edit the server.xml file. here are all the procedures, for anyone else's ref.:
    1. installed sdk 2.0
    2. installed tomcat 1.4 (beta) and renamed the folder to tomcat (so dos cd command desn't freak out)
    3. set java_home=c:\jdk1.4\JRE and tomcat_home=c:\tomcat\tomcat
    4. started tomcat using startup.bat
    5. installed iis using add/remove
    6. added java bin dir to path variable (c:\jdk1.4\bin
    7. looked for servlet.jar (c:\tomcat\tomcat\lib)
    8. set classpath to that folder (CLASSPATH=.;c:\tomcat\tomcat\lib\servlet.jar;c:\tomcat\tomcat\lib\jsp.jar)
    ( see http://www.essi.fr/~buffa/cours/internet2000/POLYS/servlets/Servlet-Tutorial-Setup.html )
    9. added c:\jdk1.4\bin\tools.jar to classpath
    10. opened server.xml (config file for tomcat) and added port and hostName and inet to <contextManager> per:
    <ContextManager port="8080" hostName="" inet="" debug="0" workDir="work" showDebugInfo="true" >
    11. ran a jsp example in the browser and had a fkin beer!
    enjoy!
    -thekid

  • Apache 2, Tomcat 4 and Oracle's XSQLServlet not working together

    Hi
    I cannot even get the basic demos in ./demo/java/xsql to work with this combination of technologies.
    I am running this on Red Hat Linux 8. Apache and Tomcat work fine, the CLASSPATH is set and I have created the Alias etc.
    I believe that the .xsql type is not being processed by my XSQLServlet, because calling up http://localhost/xsql/ brings up 3 raw xsql files in the browser.
    All the documentation I have found describes using XSQL with older Apaches and JServ. JServ is now replaced by Tomcat and Tomcat 4 is much different from earlier versions of Tomcat. Despite that I believe I have guessed and made the correct changes to httpd.conf and web.xml to make the XSQLServlet work.
    Has anyone got these to work ? I've been at this for days and am driven half mad by it ! All that has kept me at it is that this seems like a magnificent combination of technologies. Many thanks in advance... for any advice at all.
    - Des

    AndyRTR wrote:Please check the new libreoffice version in testing. It should work with openjdk6 and jre7-openjdk. Not sure if closed
    Oracle jre7 from AUR will also get detected.
    Thanks for the info. Yaourt -Syu will be my friend
    Java7 is recognized, great. Too bad java web plugin could be blacklisted because of security matters.
    Last edited by fredbezies (2011-10-05 14:58:07)

  • JBO error deploying under Tomcat 3.2.2

    I've created the JSP BC4J application and deployed under Tomcat. I've followed Chris Schalk's tips on adding the jar file in the CLASSPATH( for Tomcat.bat). But, I still get folowing errors:
    Error: 500
    Location: /BugEnter_html/ReportView_Insert.jsp
    Internal Servlet Error:
    org.apache.jasper.JasperException: Unable to compile class for JSPC:\jakarta-tomcat-3.2.2\work\localhost_8080%2FBugEnter_html\_0002fReportView_0005fInsert_0002ejspReportView_0005fInsert_jsp_0.java:14: Package oracle.jbo not found in import.
    import oracle.jbo.*;
    ^
    C:\jakarta-tomcat-3.2.2\work\localhost_8080%2FBugEnter_html\_0002fReportView_0005fInsert_0002ejspReportView_0005fInsert_jsp_0.java:16: Package oracle.jdeveloper.html not found in import.
    import oracle.jdeveloper.html.*;
    ^
    C:\jakarta-tomcat-3.2.2\work\localhost_8080%2FBugEnter_html\_0002fReportView_0005fInsert_0002ejspReportView_0005fInsert_jsp_0.java:17: Package oracle.jbo.html.databeans not found in import.
    import oracle.jbo.html.databeans.*;
    ^
    3 errors
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
    at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
    at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
    at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:258)
    Can someone please tell me how can I solve this problem?
    Please help!!!
    AR

    For TomCat 3.2.2 you will need to modify tomcat.bat so that also *.zip is added to the classpath. (look for the line that adds *.jar, duplicate it and change .jar in .zip)
    In TomCat 3.2.3 this is changed. (For 3.2.3 they changed Tomcat.bat so it now adds *.* from tomcat/lib to the classpath)

  • Tomcat 5.0.18 Servlets

    I am new to JSP, installed J2SDK1.4.2_03 and Tomcat 5.0.18. I am able to get the jsp pages to work and also view the sample servlet examples. But I am having a hard time getting my servlets to work. I have
    set the
    ClassPath to C:\Jakarta\Jakarta-tomcat-5.0.18\common\lib\servlet-api.jar
    My directory structure is
    webapps\Myexamples\WEB_INF\CLASSES
    WEB-INF has the web.xml doc, and the Classes and lib folders
    Classes has the class called DontPanic, and the java file DontPanic
    the url I typed is
    http://localhost:8080/Myexamples/servlet/DontPanic
    I get an error message source file not found.
    Please help!!!!!!
    Lakshmi

    ClassPath to
    C:\Jakarta\Jakarta-tomcat-5.0.18\common\lib\servlet-api
    jarThis is worthless at runtime. Tomcat ignores your system CLASSPATH environment variable. It uses its own CLASSPATH at runtime. You must include the servlet-api.jar in your CLASSPATH when you compile. I do it by using the -classpath option. (Actually I use Ant to build Web apps.)
    >
    My directory structure is
    webapps\Myexamples\WEB_INF\CLASSES
    WEB-INF has the web.xml doc, and the Classes and lib
    folders
    Classes has the class called DontPanic, and the java
    file DontPanic
    So your serlvet DontPanic.class file is in webapps/Myexamples/WEB-INF/classes. (Not an underscore in WEB_INF, it's a hyphen WEB-INF.)
    Tomcat won't deal with a class that's not in a package. You should put a package statement at the top of your servlet .java file and make sure that it's compiled into that directory in your WEB-INF/classes.
    I'm assuming that you've got the servlet mapping in the web.xml properly. You should be mapping your servlet class DontPanic to a URL mapping /DontPanic.
    the url I typed is
    http://localhost:8080/Myexamples/servlet/DontPanic
    After you've changed your WEB_INF to WEB-INF, try this URL:
    http://localhost:8080/Myexamples/DontPanicAre there any messages in the Tomcat logs that tell you anything? - MOD

  • Cannot create DataSource, Exception in Tomcat 4.1

    I am running into a major problem with Tomcat4.1 trying to access a Datasource.
    I referenced about 7 articles one of which has the subject "Cannot create JDBC driver of class '' for connect URL 'null', cause..."
    but he is using Tomcat 5. I even tried to simulate his solution to mine but still no use.
    I tried to connect to the database the old fashion way and it worked... I get connected (JDBC connection w/o Datasource).
    I changed the XML many times but with no luck. I must be doing something stupid that I can't see.
    Any help is greatly appreciated.... I ran out of solutions...
    I initially loaded my app through Tomcat manager and created the DataSource through Tomcat admin screen.
    my CLASSPATH =
    C:\J4Log\logging-log4j-1.2.9\dist\lib\log4j-1.2.9.jar;
    C:\JBoss4-0\jboss-4.0.1sp1;C:\CONNX32\CONNXJDBC\JAVA\JAR\connxjdbc.jar;
    C:\JBuilderX\lib\mysql-connector-java-3.0.15-ga-bin.jar;
    C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-dbcp-1.2.1.jar;
    C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-pool-1.1.jar;
    C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-collections-3.1.jar;
    C:\Program Files\Apache Group\Tomcat 4.1\common\lib\mysql-connector-java-3.1.8-bin.jar
    my web.xml =
    <resource-ref>
        <description>DB connection</description>
        <res-ref-name>jdbc/MyDBASE</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>-------------------
    The sample snipet to connect to the database (which works)
    ConnectionHelper contains the following (simplified)...
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         return DriverManager.getConnection("jdbc:mysql://10.0.3.52/MyDBASE?user=Myadmin&password=AdminPWD");
      ConnectionHelper connectionHelper = new ConnectionHelper();
      Statement st = null;
      try {
        Connection conn = connectionHelper.getConnection();
        st = conn.createStatement();
        System.out.println("\n=========== ssuucceessffullllllll=======\n");
      catch (SQLException ex1) {
         System.out.println("error connecting=================");
         ex1.printStackTrace();
    whenever i execute my JSP (which calls my java class .. code follows....
      Context envCtx = (Context) init.lookup("java:comp/env");
           DataSource ds = (DataSource)envCtx.lookup("jdbc/MyDBASE");it breaks on the DataSource giving..
    org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '
    ' for connect URL 'null', cause:
    java.sql.SQLException: No suitable driver
            at java.sql.DriverManager.getDriver(DriverManager.java:243)
            at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
    rce.java:743)
            at org.apache.commons.dbcp.BasicD.........--
    Another error (which is from within the IDE) is
    java.lang.NoClassDefFoundError: tyrex/jdbc/xa/EnabledDataSource     at rg.apache.naming.factory.TyrexDataSourceFactory.getObjectInstance(TyrexDataSourceFactory.java:166)
         at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:164)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
         at simpleservlet.TestJSPBean.init(TestJSPBean.java:41)
         at org.apache.jsp.testJSP$jsp._jspService(testJSP$jsp.java:115)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)--------------------------
    and finally, Server.XML...
    <?xml version='1.0' encoding='utf-8'?>
    <Server className="org.apache.catalina.core.StandardServer" debug="0" port="8005" shutdown="SHUTDOWN">
      <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"/>
      <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" debug="0" jsr77Names="false"/>
      <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" debug="0"/>
      <GlobalNamingResources>
        <Environment name="simpleValue" override="true" type="java.lang.Integer" value="30"/>
        <Resource name="jdbc/MyDBASE" scope="Shareable" type="javax.sql.DataSource"/>
        <ResourceParams name="jdbc/MyDBASE">
          <parameter>
            <name>validationQuery</name>
            <value>select now()</value>
          </parameter>
          <parameter>
            <name>url</name>
            <value>jdbc:mysql://10.0.3.52/MyDBASE?autoReconnect=true</value>
          </parameter>
          <parameter>
            <name>password</name>
            <value>AdminPWD</value>
          </parameter>
          <parameter>
            <name>maxActive</name>
            <value>4</value>
          </parameter>
          <parameter>
            <name>maxWait</name>
            <value>5000</value>
          </parameter>
          <parameter>
            <name>driverClassName</name>
             <value>org.gjt.mm.mysql.Driver</value>
          </parameter>
          <parameter>
            <name>username</name>
            <value>Myadmin</value>
          </parameter>
          <parameter>
            <name>maxIdle</name>
            <value>2</value>
          </parameter>
        </ResourceParams>
      </GlobalNamingResources>
      <Service className="org.apache.catalina.core.StandardService" debug="0" name="Tomcat-Standalone">
        <Engine className="org.apache.catalina.core.StandardEngine"
                   debug="0" defaultHost="localhost"
                   mapperClass="org.apache.catalina.core.StandardEngineMapper"
                   name="Standalone">
          <Host className="org........
            <Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true"
                      charsetMapperClass="org.apache.catalina.util.CharsetMapper"
                      cookies="true" crossContext="false" debug="0"
                      displayName="simpleservlet"
                      docBase="/WebModule1" mapperClass="org.apache.catalina.core.StandardContextMapper"
                      path="/WebModule1" privileged="false" reloadable="false" swallowOutput="false"
                      useNaming="true"
                      workDir="work\Standalone\localhost\WebModule1"
                      wrapperClass="org.apache.catalina.core.StandardWrapper">
                 <Resource auth="Container"
                            description="DB connection"
                            name="jdbc/MyDBASE" scope="Shareable"
                            type="javax.sql.DataSource"/>
           </Context>
        </Engine>
      </Service>
    </Server>Thanks in advance for ANY help.

    I am running into a major problem with Tomcat4.1 trying to access a Datasource.
    I referenced about 7 articles one of which has the subject "Cannot create JDBC driver of class '' for connect URL 'null', cause..."
    but he is using Tomcat 5. I even tried to simulate his solution to mine but still no use.
    I tried to connect to the database the old fashion way and it worked... I get connected (JDBC connection w/o Datasource).
    I changed the XML many times but with no luck. I must be doing something stupid that I can't see.
    Any help is greatly appreciated.... I ran out of solutions...
    I initially loaded my app through Tomcat manager and created the DataSource through Tomcat admin screen.
    my CLASSPATH =
    C:\J4Log\logging-log4j-1.2.9\dist\lib\log4j-1.2.9.jar;
    C:\JBoss4-0\jboss-4.0.1sp1;C:\CONNX32\CONNXJDBC\JAVA\JAR\connxjdbc.jar;
    C:\JBuilderX\lib\mysql-connector-java-3.0.15-ga-bin.jar;
    C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-dbcp-1.2.1.jar;
    C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-pool-1.1.jar;
    C:\Program Files\Apache Group\Tomcat 4.1\common\lib\commons-collections-3.1.jar;
    C:\Program Files\Apache Group\Tomcat 4.1\common\lib\mysql-connector-java-3.1.8-bin.jar
    my web.xml =
    <resource-ref>
        <description>DB connection</description>
        <res-ref-name>jdbc/MyDBASE</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>-------------------
    The sample snipet to connect to the database (which works)
    ConnectionHelper contains the following (simplified)...
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         return DriverManager.getConnection("jdbc:mysql://10.0.3.52/MyDBASE?user=Myadmin&password=AdminPWD");
      ConnectionHelper connectionHelper = new ConnectionHelper();
      Statement st = null;
      try {
        Connection conn = connectionHelper.getConnection();
        st = conn.createStatement();
        System.out.println("\n=========== ssuucceessffullllllll=======\n");
      catch (SQLException ex1) {
         System.out.println("error connecting=================");
         ex1.printStackTrace();
    whenever i execute my JSP (which calls my java class .. code follows....
      Context envCtx = (Context) init.lookup("java:comp/env");
           DataSource ds = (DataSource)envCtx.lookup("jdbc/MyDBASE");it breaks on the DataSource giving..
    org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '
    ' for connect URL 'null', cause:
    java.sql.SQLException: No suitable driver
            at java.sql.DriverManager.getDriver(DriverManager.java:243)
            at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
    rce.java:743)
            at org.apache.commons.dbcp.BasicD.........--
    Another error (which is from within the IDE) is
    java.lang.NoClassDefFoundError: tyrex/jdbc/xa/EnabledDataSource     at rg.apache.naming.factory.TyrexDataSourceFactory.getObjectInstance(TyrexDataSourceFactory.java:166)
         at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:164)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
         at simpleservlet.TestJSPBean.init(TestJSPBean.java:41)
         at org.apache.jsp.testJSP$jsp._jspService(testJSP$jsp.java:115)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)--------------------------
    and finally, Server.XML...
    <?xml version='1.0' encoding='utf-8'?>
    <Server className="org.apache.catalina.core.StandardServer" debug="0" port="8005" shutdown="SHUTDOWN">
      <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"/>
      <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" debug="0" jsr77Names="false"/>
      <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" debug="0"/>
      <GlobalNamingResources>
        <Environment name="simpleValue" override="true" type="java.lang.Integer" value="30"/>
        <Resource name="jdbc/MyDBASE" scope="Shareable" type="javax.sql.DataSource"/>
        <ResourceParams name="jdbc/MyDBASE">
          <parameter>
            <name>validationQuery</name>
            <value>select now()</value>
          </parameter>
          <parameter>
            <name>url</name>
            <value>jdbc:mysql://10.0.3.52/MyDBASE?autoReconnect=true</value>
          </parameter>
          <parameter>
            <name>password</name>
            <value>AdminPWD</value>
          </parameter>
          <parameter>
            <name>maxActive</name>
            <value>4</value>
          </parameter>
          <parameter>
            <name>maxWait</name>
            <value>5000</value>
          </parameter>
          <parameter>
            <name>driverClassName</name>
             <value>org.gjt.mm.mysql.Driver</value>
          </parameter>
          <parameter>
            <name>username</name>
            <value>Myadmin</value>
          </parameter>
          <parameter>
            <name>maxIdle</name>
            <value>2</value>
          </parameter>
        </ResourceParams>
      </GlobalNamingResources>
      <Service className="org.apache.catalina.core.StandardService" debug="0" name="Tomcat-Standalone">
        <Engine className="org.apache.catalina.core.StandardEngine"
                   debug="0" defaultHost="localhost"
                   mapperClass="org.apache.catalina.core.StandardEngineMapper"
                   name="Standalone">
          <Host className="org........
            <Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true"
                      charsetMapperClass="org.apache.catalina.util.CharsetMapper"
                      cookies="true" crossContext="false" debug="0"
                      displayName="simpleservlet"
                      docBase="/WebModule1" mapperClass="org.apache.catalina.core.StandardContextMapper"
                      path="/WebModule1" privileged="false" reloadable="false" swallowOutput="false"
                      useNaming="true"
                      workDir="work\Standalone\localhost\WebModule1"
                      wrapperClass="org.apache.catalina.core.StandardWrapper">
                 <Resource auth="Container"
                            description="DB connection"
                            name="jdbc/MyDBASE" scope="Shareable"
                            type="javax.sql.DataSource"/>
           </Context>
        </Engine>
      </Service>
    </Server>Thanks in advance for ANY help.

  • Problem using Tomcat 4.1

    I'm trying to establish connection with the database from JSP.When I'm running it's giving the following error
    "oracle.jdbc.driver.Oracle.Driver class not found"
    I'm using Tomcat 4.1 and database is Oracle 8i.I've already set the classpath."C:\oracle\ora92\jdbc\lib"(Oracle is intalled in C drive).
    Kindly help me resolve this issue.
    Bye.

    Tomcat does not use the system classpath.
    As far as Tomcat is concerned the classpath for a web app is
    1 - web-inf/classes
    2 - jar files in web-inf/lib
    3 - jar files in [TOMCAT]/shared/lib
    4 - jar files in [TOMCAT]/common/lib
    If you are going to be using Tomcat's connection pooling, you need the JDBC driver jar file in [TOMCAT]/common/lib
    I would recommend you put the file ojdbc14.jar (or equivalent) in the [TOMCAT]/common/lib directory
    Restart tomcat, and try again.
    Cheers,
    evnafets

  • Tomcat 7 and Oracle 11g

    Hello Everyone,
    I am facing a strange issue with tomcat 7 connectivity with Oracle 11g. I am using the below versions
    JDK1.7.0_03
    Tomcat 7
    Oracle 11g
    I used to connect to oracle9 with the thin driver, everything was fine, but when I try to connect to 11g, tomcat throws the error CONNECTION REFUSED. I created a seperate standalone java application to test the connection with the same peice of code, and I can see Oracle sends the connection, but with Tomcat 7 it throws the error. I have placed all the correct jar files in the tomcat lib directory and classpath. I am little lost as it works well as an individual application but not from Tomcat. No exception or other error is thrown by Tomcat
    Can anyone help me on this
    Thanks in advance

    926901,
    I am havnig what I think is a very similar issue. I am brand new to java and to configuring any kind of server at all. I am using the versions below:
    JDK 1.7.0_04 - on my local machine
    JRE 7 - on my local machine
    Tomcat 7 - installed on my local machine
    Oracle 11g - on a different server on my company's network
    I created a login page using scriptlets in a jps file and could connect using the following, but it is not on a tomcat server (on my company's development box):
    String dbURL = "jdbc:oracle:thin:@10.5.20.101:1521:myDB";
    String dbUser = "*****";
    String dbPass = "*****";
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = DriverManager.getConnection(dbURL,dbUser,dbPass);
    I am now trying to do the same login, connecting to the same DB (same url/UN/PW) using servlets from the tomcat server on my machine. I am writing the code in Eclipse also, and have pointed eclipse to the JDK and JRE folders. You mentioned that you have placed all the correct jar files in tomcat lib directory. Would you please tell me what jar files you used? I am finding a lot of people saying I need to put the oracle driver into the WEB-INF/lib folder directly in the specific web app, and some say it is fine in the tomcat lib folder, and I am seriously frustrated with it. I am not sure if I should be using the class12.jar file or the ojbdc14.jar file either. Please, any advice you can give me would be appreciated. I have been going in circles for days and nothing seems to let me connect to the DB from a servlet running in Eclipse on tomcat. The code I am trying to use on tomcat in the servlet is:
    import java.sql.*;
    import java.util.*;
    import oracle.jdbc.*;
    public class ConnectionManager
         static Connection con;
         static String dbURL;
         public static Connection getConnection()
              try
                   String dbURL = "jdbc:oracle:thin:@//10.5.20.101:1521:myDB";
                   String dbUser = "*****";
                   String dbPass = "*****";
                   // assuming "DataSource" is your DataSource name
                   Class.forName("oracle.jdbc.OracleDriver");
                   DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
                   //try
                        con = DriverManager.getConnection(dbURL,dbUser,dbPass);
                   //catch (SQLException ex)
                   //     ex.printStackTrace();
              catch(ClassNotFoundException e)
                   System.out.println(e);
              return con;
    }

  • How to Install and Configure Java and Tomcat

    Hi Everybody,
    I am using the following versions of java and tomcat:
    JAVA: j2sdk-1_4_2_13
    Tomcat: jakarta-tomcat-5.0.5
    I tried to configure several times both but everytime the result is the same. I am setting the following variables:
    PATH: .;D:\j2sdk1.4.2_13\bin;D:\Tomcat 5.0\bin
    CLASSPATH: .;D:\j2sdk1.4.2_13\lib;D:\Tomcat 5.0\common\lib\servlet-api.jar
    JAVA_HOME: D:\j2sdk1.4.2_13
    Please correct what mistake i am doing again and again. I appreciate your effort.
    Thanks in advance.
    Himanshu

    Fine sir, I will tell evrything in detail what steps i am following during installation and configuring java and Tomcat.
    1) I am using the following versions(exe) of java and tomcat:
    JAVA: j2sdk-1_4_2_13-windows-i586-p
    Tomcat: jakarta-tomcat-5.0.5
    2) Then, i follow exactly the same variable names and values to configure java as mentioned below to make java work under User variables header:
    PATH: .;D:\j2sdk1.4.2_13\bin
    CLASSPATH: .;D:\j2sdk1.4.2_13\lib
    JAVA_HOME: D:\j2sdk1.4.2_13
    Above steps i follow only for installing java. And it also not working properly. If i run my .java file from the destination of the file then it will be execulted but if i try to execute from any other location then it doesn't, it shows the following message in the DOS prompt:
    error: cannot read: Hello.java
    1 error
    Now, please correct what mistake i am doing.
    Thanks
    Himanshu

  • Help! My tomcat can't startup?

    hi, guys:
    when I execute the tomcat.bat. The prompt shows
    Including all jars in C:\jdk13\tomcat\lib in your CLASSPATH.
    Out of environment space
    Using CLASSPATH: C:\jdk13\tomcat\classes;.;C:\jdk13\lib\*.jar;c:\jdk13\lib\class
    es111.zip;c:\jdk13\lib\tools.jar
    Bad command or file name
    Out of environment space
    Out of environment space
    Including all jars in C:\jdk13\tomcat\lib in your CLASSPATH.
    Out of environment space
    Out of environment space
    Using CLASSPATH: C:\jdk13\tomcat\classes;C:\jdk13\tomcat\classes;.;C:\jdk13\lib\
    *.jar;c:\jdk13\lib\classes111.zip;c:\jdk13\lib\tools.jar
    Out of environment space
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/jasper/Jsp
    C
    How can I correct this problem? My working environment is Windows ME. Thanks a lot. bye
    Regards

    To correct the environment space error you must do the following:
    1.Locate the tomcat.bat and startup.bat files
    2.Right click on tomcat.bat
    3.Select properties
    4.Choose the memory tab
    5.In the conventional memory section use the initial environment dropdown and set it to 2816 (or higher)
    6. Apply changes
    7.Repeat for startup.bat
    Also make sure that the tomcat_home and java_home variables are set correctly
    Hope this helps
    Chelman

  • Oracle ojdbc5.jar or tomcat classes12.jar?

    Hello.
    Running 11g, Java 5, and Tomcat 6 on XP.
    CLASSPATH=c:\oracle11g\jdbc\lib\ojdbc5.jar
    But I get a Tomcat error: NoClassDefFoundError...
    unless I have classes12.jar in c:/tomcat60/lib folder.
    Is this correct? Do I still need classes12.jar? How can I get tomcat to follow the classpath setting?
    Any suggestions are greatly appreciated.
    Logan

    Hi,
    If you are using LDAP then you have to use the class12.jar files

  • Can't start Tomcat!  help me!

    Hello all,
    I have used JDK1.3.1; now I download Tomcat, I write a batch file includes:
    set JAVA_HOME=C:\JDK1.3.1
    set ANT_HOME=C:\jakarta-tomcat
    set TOMCAT_HOME=C:\jakarta-tomcat
    set CLASSPATH=%CLASSPATH%;C:\jdk1.3.1\lib\tools.jar;
    and run it;
    now I go to C:\jakarta-tomcat\bin and type 'startup':
    C:\jakarta-tomcat\bin>startup
    Including all jars in C:\jakarta-tomcat\lib in your CLASSPATH.
    Using CLASSPATH: C:\jakarta-tomcat\classes;C:\jakarta-tomcat\lib\ant.jar;C:\jaka
    rta-tomcat\lib\jasper.jar;C:\jakarta-tomcat\lib\jaxp.jar;C:\jakarta-tomcat\lib\p
    arser.jar;C:\jakarta-tomcat\lib\servlet.jar;C:\jakarta-tomcat\lib\webserver.jar;
    ;C:\jdk1.3.1\lib\tools.jar;;C:\JDK1.3.1\lib\tools.jar
    Starting Tomcat in new window
    but the new window disappear after several seconds,Tomcat doesn't start.Then, I type 'tomcat run':
    C:\jakarta-tomcat\bin>tomcat run
    Including all jars in C:\jakarta-tomcat\lib in your CLASSPATH.
    Using CLASSPATH: C:\jakarta-tomcat\classes;C:\jakarta-tomcat\lib\ant.jar;C:\jaka
    rta-tomcat\lib\jasper.jar;C:\jakarta-tomcat\lib\jaxp.jar;C:\jakarta-tomcat\lib\p
    arser.jar;C:\jakarta-tomcat\lib\servlet.jar;C:\jakarta-tomcat\lib\webserver.jar;
    ;C:\jdk1.3.1\lib\tools.jar;;C:\JDK1.3.1\lib\tools.jar
    ERROR reading C:\jakarta-tomcat\conf\server.xml
    At Line 121 /Server/ContextManager/ContextInterceptor/ className=org.apache.tomc
    at.context.LoaderInterceptor
    FATAL: configuration error
    java.lang.ClassNotFoundException: org.apache.tomcat.context.LoaderInterceptor
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:120)
    at org.apache.tomcat.util.xml.ObjectCreate.start(XmlMapper.java:453)
    at org.apache.tomcat.util.xml.XmlMapper.matchStart(XmlMapper.java:314)
    at org.apache.tomcat.util.xml.XmlMapper.startElement(XmlMapper.java:68)
    at com.sun.xml.parser.Parser.maybeElement(Parser.java:1390)
    at com.sun.xml.parser.Parser.content(Parser.java:1498)
    at com.sun.xml.parser.Parser.maybeElement(Parser.java:1399)
    at com.sun.xml.parser.Parser.content(Parser.java:1498)
    at com.sun.xml.parser.Parser.maybeElement(Parser.java:1399)
    at com.sun.xml.parser.Parser.parseInternal(Parser.java:491)
    at com.sun.xml.parser.Parser.parse(Parser.java:283)
    at org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java:198)
    at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:143)
    at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)
    C:\jakarta-tomcat\bin>
    What's this problem? How can I do?please help me,
    thanks

    Modify the classpath as follows.
    set JAVA_HOME=C:\JDK1.3.1
    set ANT_HOME=C:\jakarta-tomcat
    set TOMCAT_HOME=C:\jakarta-tomcat
    set CLASSPATH=%CLASSPATH%;C:\jdk1.3.1\lib\tools.jar;JAVA_HOME\lib;
    Modify the Path as follows
    set PATH = %PATH%;%JAVA_HOME%\bin;%TOMCAT_HOME%\bin

Maybe you are looking for

  • Is It Possible to Stop a Lumia 822 From Entering S...

    The phone has locked up a few times while in sleep mode.  I assume this is a software bug that will be fixed at some point. In the meantime is there a way to prevent the phone from going to sleep?

  • Sensing a loss of connection without explicitly sending a message

    First I need to know if I am even on the right forum since I don't have a clue whether the Sun Java System Message Queue and the Sun ONE Message Queue, v3.0.1 are the same animal. Since there was no forum for the Sun ONE Message Queue I'm assuming th

  • How to Design A Map Class

    Hi Folks I am trying to design a utility class for my Application. I am having many tables for Id and description Eg CustomerId CustomerDescription AccountId AccountDesc Presntly I am Writing a Class in which there is a method which Returns MAP ID vs

  • Stream aliases and dynamic streaming

    My recent tweets (@flashfreaker) have centered around getting dynamic streaming via RTMP working with my Wowza EC2 implementation on the cloud. While I'm a big fan of FMS/FMIS (I wrote some of the first Flash Communication Server coverage after all.

  • How to use HTML_Converter?

    I want use HTML_Converter to tranfer my Web Page ,but when I execute the HTMLConverter.bat in path c:\jdk1.3.1\bin,It said not specify path.