You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Heping Ling <He...@mail.lehman.edu> on 2007/10/02 20:00:48 UTC

Configuring and using DataSource in Tomcat

Hi, everybody:

 

I am new in doing web applications and new in using tomcat.  I am having
trouble configuring and using DataSource in Tomcat.  Hope someone could see
where the problem is.

 

About the database:

    hostname is sb.lehman.cuny.edu

    schema name (sqlplus account name) is devtrack

    listener port is 1521

    Oracle SID is idm0

 

1. J2SE SDK version on my PC: 1.5.0_11

 

2. File name and location of the JDBC driver:

File name: ojdbc14dms.jar. I put it in c:\tomcat\common\lib.  The driver
file is copied from the JDeveloper that runs on the same PC as I run Tomcat.
The JDeveloper runs servlets OK on the PC and accesses the same database OK
with the 1.5.0_11 J2SE SDK.

 

3. The web.xml file

At the very beginning of the application's deployment descriptor
(c:\tomcat\webapps\myApp\WEB-INF\web.xml), I declared the JNDI reference for
the database.  Here is the beginning portion of the web.xml file:

 

<?xml version="1.0" encoding="ISO-8859-1"?> 

<!DOCTYPE web-app 

  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 

  "http://java.sun.com/dtd/web-app_2_3.dtd"> 

 

<web-app> 

<resource-ref>

   <description>

      Resource reference to a factory for java.sql.Connection instances 

   </description>

   <res-ref-name>

      jdbc/DBDevTrackConnDS

   </res-ref-name>

   <res-type>

      javax.sql.DataSource

   </res-type>

   <res-auth>

      Container

   </res-auth>

</resource-ref>

 

4. The c:\tomcat\conf\context.xml file

I added the <Resource> element in the context.xml.  The entire file of
c:\tomcat\conf\context.xml is as follows:

 

<!-- The contents of this file will be loaded for each web application -->

<Context>

    <!-- Default set of monitored resources -->

    <WatchedResource>WEB-INF/web.xml</WatchedResource>

     

    <!-- Uncomment this to disable session persistence across Tomcat
restarts -->

    <!--

    <Manager pathname="" />

    -->

    <Resource name="jdbc/DBDevTrackConnDS"

              auth="Container"

              type="javax.sql.DataSource"

              username="devtrack"

              password="test123"

              driverClassName="oracle.jdbc.driver.OracleDriver"

              url="jdbc:oracle:thin:@sb.lehman.cuny.edu:1521:idm0"

              maxActive="8"

              maxIdle="4" />

</Context>

 

5. The servlet file.

The init() method in the serverlet file (for obtaining a DataSource object):

 

public class LoginServletNew extends HttpServlet {

  PrintWriter out = null;

  DataSource ds = null;

 

  public void init() {

    try {

    Context initCtx = new InitialContext();

    Context envCtx = (Context) initCtx.lookup("java:comp/env");

    ds = (DataSource) envCtx.lookup("jdbc/DBDevTrackConnDS");

    } catch (NamingException e) {

       e.printStackTrace();

    } 

  }

 

The login() method that uses the DataSource:

 

  boolean login(String userName, String password) {

    try {

      Connection con = ds.getConnection();

 

      Statement s = con.createStatement();

      String sql = "SELECT LDAP_UID FROM Users" +

         " WHERE LDAP_UID='" + userName + "'" + " AND USER_TYPE='" +
password + "'";

      ResultSet rs = s.executeQuery(sql);

      if (rs.next()) {

        out.println("uid from query: " + rs.getString(1));

        rs.close();

        s.close();

        con.close();

        return true;

      }

      rs.close();

      s.close();

      con.close();

    }

 

6. The trouble:

The servlet compiles OK.  It runs OK when the user is presented with the
login form.  But when the submit button is clicked that submits the username
and password (i.e., the login() method is called), the browser receives an
err page with the root cause as NoClassDefFoundError:

root cause

java.lang.NoClassDefFoundError:
oracle/dms/instrument/ExecutionContextForJDBC

 

In the localhost.2007-10-02.log file, the root cause stack is as follows:

SEVERE: Servlet.service() for servlet NewLogin threw exception

java.lang.NoClassDefFoundError:
oracle/dms/instrument/ExecutionContextForJDBC

     at
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:322)

     at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:151)

     at
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:
32)

     at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:608)

     at
org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverC
onnectionFactory.java:37)

     at
org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableCon
nectionFactory.java:290)

     at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicD
ataSource.java:877)

     at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:851)

     at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)

     at LoginServletNew.login(LoginServletNew.java:95)

     at LoginServletNew.doPost(LoginServletNew.java:77)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:269)

     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:188)

     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:210)

     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:174)

     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
)

     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
)

     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:108)

     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)

     at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:
834)

     at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(H
ttp11AprProtocol.java:640)

     at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)

     at java.lang.Thread.run(Unknown Source)

 

 

It seems to me that even though the JDBC driver was found and compilation
was OK at compile time, it cannot be found at runtime.  But it is not clear
to me what is wrong and how to correct it.  It would be very much
appreciated if someone with experienced eye could spot the cause of the
error and help me out.

 

 

Jason


Re: Configuring and using DataSource in Tomcat

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason,

Heping Ling wrote:
> Libraries (*.jar files) specific to an application should be in the
> application's WEB-INF/lib directory, and those shared by all applications
> should be in $CATALINA_HOME/common/lib.  I put the database driver file in
> both directories just in case, but it did not work.

This will certainly not work. Pick one location and put the driver
there. You should put your JDBC driver only in common/lib.

> I follow the Tomcat documentation, and have found one error on my part,
> i.e., the context.xml file to configure is not the
> $CATALINE_HOME/config/context.xml file, but the META-INF/context.xml file
> under the application, which is what the Tomcat documentation says.

Yes. All you need is:

1. Driver in common/lib
2. DataSource configuration in webapp.war[/META-INF/context.xml]

It's very simple.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHBQk79CaO5/Lv0PARAjtHAJ9326LxMK1zqRmB+NsVqBv/9/BrJQCgm6kl
6NDDLjROnAFEon7z2r2HdP0=
=XGgE
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Configuring and using DataSource in Tomcat

Posted by Heping Ling <He...@mail.lehman.edu>.
Hi, Gabriele:

Thanks for the reminder.

Libraries (*.jar files) specific to an application should be in the
application's WEB-INF/lib directory, and those shared by all applications
should be in $CATALINA_HOME/common/lib.  I put the database driver file in
both directories just in case, but it did not work.

I follow the Tomcat documentation, and have found one error on my part,
i.e., the context.xml file to configure is not the
$CATALINE_HOME/config/context.xml file, but the META-INF/context.xml file
under the application, which is what the Tomcat documentation says.

I think I am moving closer towards a solution.  Thank you for contributing
your idea.


Jason



-----Original Message-----
From: Iannetti, Gabriele [mailto:Gabriele.Iannetti@PROSTEP.com] 
Sent: Thursday, October 04, 2007 3:04 AM
To: Tomcat Users List
Subject: AW: Configuring and using DataSource in Tomcat

Hi Jason,

do you know that you have to copy your used libraries to the lib directory
in your used web-app?


Regards,
Gabriele

_______________________________________________________

Gabriele Iannetti

Werkstudent

PROSTEP AG

Dolivostraße 11,

D-64293 Darmstadt

Tel.: +49 6151 9287 301 

Fax : +49 6151 9287 326

Mobil: +49 160 95 2626 51

Email: Gabriele.Iannetti@prostep.com

http://www.prostep.com


-----Ursprüngliche Nachricht-----
Von: Heping Ling [mailto:Heping.Ling@mail.lehman.edu] 
Gesendet: Dienstag, 2. Oktober 2007 20:01
An: users@tomcat.apache.org
Betreff: Configuring and using DataSource in Tomcat

Hi, everybody:

 

I am new in doing web applications and new in using tomcat.  I am having
trouble configuring and using DataSource in Tomcat.  Hope someone could see
where the problem is.

 

About the database:

    hostname is sb.lehman.cuny.edu

    schema name (sqlplus account name) is devtrack

    listener port is 1521

    Oracle SID is idm0

 

1. J2SE SDK version on my PC: 1.5.0_11

 

2. File name and location of the JDBC driver:

File name: ojdbc14dms.jar. I put it in c:\tomcat\common\lib.  The driver
file is copied from the JDeveloper that runs on the same PC as I run Tomcat.
The JDeveloper runs servlets OK on the PC and accesses the same database OK
with the 1.5.0_11 J2SE SDK.

 

3. The web.xml file

At the very beginning of the application's deployment descriptor
(c:\tomcat\webapps\myApp\WEB-INF\web.xml), I declared the JNDI reference for
the database.  Here is the beginning portion of the web.xml file:

 

<?xml version="1.0" encoding="ISO-8859-1"?> 

<!DOCTYPE web-app 

  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 

  "http://java.sun.com/dtd/web-app_2_3.dtd"> 

 

<web-app> 

<resource-ref>

   <description>

      Resource reference to a factory for java.sql.Connection instances 

   </description>

   <res-ref-name>

      jdbc/DBDevTrackConnDS

   </res-ref-name>

   <res-type>

      javax.sql.DataSource

   </res-type>

   <res-auth>

      Container

   </res-auth>

</resource-ref>

 

4. The c:\tomcat\conf\context.xml file

I added the <Resource> element in the context.xml.  The entire file of
c:\tomcat\conf\context.xml is as follows:

 

<!-- The contents of this file will be loaded for each web application -->

<Context>

    <!-- Default set of monitored resources -->

    <WatchedResource>WEB-INF/web.xml</WatchedResource>

     

    <!-- Uncomment this to disable session persistence across Tomcat
restarts -->

    <!--

    <Manager pathname="" />

    -->

    <Resource name="jdbc/DBDevTrackConnDS"

              auth="Container"

              type="javax.sql.DataSource"

              username="devtrack"

              password="test123"

              driverClassName="oracle.jdbc.driver.OracleDriver"

              url="jdbc:oracle:thin:@sb.lehman.cuny.edu:1521:idm0"

              maxActive="8"

              maxIdle="4" />

</Context>

 

5. The servlet file.

The init() method in the serverlet file (for obtaining a DataSource object):

 

public class LoginServletNew extends HttpServlet {

  PrintWriter out = null;

  DataSource ds = null;

 

  public void init() {

    try {

    Context initCtx = new InitialContext();

    Context envCtx = (Context) initCtx.lookup("java:comp/env");

    ds = (DataSource) envCtx.lookup("jdbc/DBDevTrackConnDS");

    } catch (NamingException e) {

       e.printStackTrace();

    } 

  }

 

The login() method that uses the DataSource:

 

  boolean login(String userName, String password) {

    try {

      Connection con = ds.getConnection();

 

      Statement s = con.createStatement();

      String sql = "SELECT LDAP_UID FROM Users" +

         " WHERE LDAP_UID='" + userName + "'" + " AND USER_TYPE='" +
password + "'";

      ResultSet rs = s.executeQuery(sql);

      if (rs.next()) {

        out.println("uid from query: " + rs.getString(1));

        rs.close();

        s.close();

        con.close();

        return true;

      }

      rs.close();

      s.close();

      con.close();

    }

 

6. The trouble:

The servlet compiles OK.  It runs OK when the user is presented with the
login form.  But when the submit button is clicked that submits the username
and password (i.e., the login() method is called), the browser receives an
err page with the root cause as NoClassDefFoundError:

root cause

java.lang.NoClassDefFoundError:
oracle/dms/instrument/ExecutionContextForJDBC

 

In the localhost.2007-10-02.log file, the root cause stack is as follows:

SEVERE: Servlet.service() for servlet NewLogin threw exception

java.lang.NoClassDefFoundError:
oracle/dms/instrument/ExecutionContextForJDBC

     at
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:322)

     at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:151)

     at
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:
32)

     at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:608)

     at
org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverC
onnectionFactory.java:37)

     at
org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableCon
nectionFactory.java:290)

     at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicD
ataSource.java:877)

     at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:851)

     at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)

     at LoginServletNew.login(LoginServletNew.java:95)

     at LoginServletNew.doPost(LoginServletNew.java:77)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:269)

     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:188)

     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:210)

     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:174)

     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
)

     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
)

     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:108)

     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)

     at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:
834)

     at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(H
ttp11AprProtocol.java:640)

     at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)

     at java.lang.Thread.run(Unknown Source)

 

 

It seems to me that even though the JDBC driver was found and compilation
was OK at compile time, it cannot be found at runtime.  But it is not clear
to me what is wrong and how to correct it.  It would be very much
appreciated if someone with experienced eye could spot the cause of the
error and help me out.

 

 

Jason

________________________________________________________________________
PROSTEP AG, Dolivostraße 11, D-64293 Darmstadt
HR: Amtsgericht Darmstadt, HRB 8383
Vorstand: Dr. Bernd Pätzold (Vorsitz), Reinhard Betz
Aufsichtsrat: Dr. Heinz-Gerd Lehnhoff (Vorsitz)
________________________________________________________________________

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


AW: Configuring and using DataSource in Tomcat

Posted by "Iannetti, Gabriele" <Ga...@PROSTEP.com>.
Hi Jason,

do you know that you have to copy your used libraries to the lib directory in your used web-app?


Regards,
Gabriele

_______________________________________________________

Gabriele Iannetti

Werkstudent

PROSTEP AG

Dolivostraße 11,

D-64293 Darmstadt

Tel.: +49 6151 9287 301 

Fax : +49 6151 9287 326

Mobil: +49 160 95 2626 51

Email: Gabriele.Iannetti@prostep.com

http://www.prostep.com


-----Ursprüngliche Nachricht-----
Von: Heping Ling [mailto:Heping.Ling@mail.lehman.edu] 
Gesendet: Dienstag, 2. Oktober 2007 20:01
An: users@tomcat.apache.org
Betreff: Configuring and using DataSource in Tomcat

Hi, everybody:

 

I am new in doing web applications and new in using tomcat.  I am having trouble configuring and using DataSource in Tomcat.  Hope someone could see where the problem is.

 

About the database:

    hostname is sb.lehman.cuny.edu

    schema name (sqlplus account name) is devtrack

    listener port is 1521

    Oracle SID is idm0

 

1. J2SE SDK version on my PC: 1.5.0_11

 

2. File name and location of the JDBC driver:

File name: ojdbc14dms.jar. I put it in c:\tomcat\common\lib.  The driver file is copied from the JDeveloper that runs on the same PC as I run Tomcat.
The JDeveloper runs servlets OK on the PC and accesses the same database OK with the 1.5.0_11 J2SE SDK.

 

3. The web.xml file

At the very beginning of the application's deployment descriptor (c:\tomcat\webapps\myApp\WEB-INF\web.xml), I declared the JNDI reference for the database.  Here is the beginning portion of the web.xml file:

 

<?xml version="1.0" encoding="ISO-8859-1"?> 

<!DOCTYPE web-app 

  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 

  "http://java.sun.com/dtd/web-app_2_3.dtd"> 

 

<web-app> 

<resource-ref>

   <description>

      Resource reference to a factory for java.sql.Connection instances 

   </description>

   <res-ref-name>

      jdbc/DBDevTrackConnDS

   </res-ref-name>

   <res-type>

      javax.sql.DataSource

   </res-type>

   <res-auth>

      Container

   </res-auth>

</resource-ref>

 

4. The c:\tomcat\conf\context.xml file

I added the <Resource> element in the context.xml.  The entire file of c:\tomcat\conf\context.xml is as follows:

 

<!-- The contents of this file will be loaded for each web application -->

<Context>

    <!-- Default set of monitored resources -->

    <WatchedResource>WEB-INF/web.xml</WatchedResource>

     

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->

    <!--

    <Manager pathname="" />

    -->

    <Resource name="jdbc/DBDevTrackConnDS"

              auth="Container"

              type="javax.sql.DataSource"

              username="devtrack"

              password="test123"

              driverClassName="oracle.jdbc.driver.OracleDriver"

              url="jdbc:oracle:thin:@sb.lehman.cuny.edu:1521:idm0"

              maxActive="8"

              maxIdle="4" />

</Context>

 

5. The servlet file.

The init() method in the serverlet file (for obtaining a DataSource object):

 

public class LoginServletNew extends HttpServlet {

  PrintWriter out = null;

  DataSource ds = null;

 

  public void init() {

    try {

    Context initCtx = new InitialContext();

    Context envCtx = (Context) initCtx.lookup("java:comp/env");

    ds = (DataSource) envCtx.lookup("jdbc/DBDevTrackConnDS");

    } catch (NamingException e) {

       e.printStackTrace();

    } 

  }

 

The login() method that uses the DataSource:

 

  boolean login(String userName, String password) {

    try {

      Connection con = ds.getConnection();

 

      Statement s = con.createStatement();

      String sql = "SELECT LDAP_UID FROM Users" +

         " WHERE LDAP_UID='" + userName + "'" + " AND USER_TYPE='" + password + "'";

      ResultSet rs = s.executeQuery(sql);

      if (rs.next()) {

        out.println("uid from query: " + rs.getString(1));

        rs.close();

        s.close();

        con.close();

        return true;

      }

      rs.close();

      s.close();

      con.close();

    }

 

6. The trouble:

The servlet compiles OK.  It runs OK when the user is presented with the login form.  But when the submit button is clicked that submits the username and password (i.e., the login() method is called), the browser receives an err page with the root cause as NoClassDefFoundError:

root cause

java.lang.NoClassDefFoundError:
oracle/dms/instrument/ExecutionContextForJDBC

 

In the localhost.2007-10-02.log file, the root cause stack is as follows:

SEVERE: Servlet.service() for servlet NewLogin threw exception

java.lang.NoClassDefFoundError:
oracle/dms/instrument/ExecutionContextForJDBC

     at
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:322)

     at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:151)

     at
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:
32)

     at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:608)

     at
org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverC
onnectionFactory.java:37)

     at
org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableCon
nectionFactory.java:290)

     at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicD
ataSource.java:877)

     at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:851)

     at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)

     at LoginServletNew.login(LoginServletNew.java:95)

     at LoginServletNew.doPost(LoginServletNew.java:77)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)

     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:269)

     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:188)

     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:210)

     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:174)

     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
)

     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
)

     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:108)

     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)

     at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:
834)

     at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(H
ttp11AprProtocol.java:640)

     at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)

     at java.lang.Thread.run(Unknown Source)

 

 

It seems to me that even though the JDBC driver was found and compilation was OK at compile time, it cannot be found at runtime.  But it is not clear to me what is wrong and how to correct it.  It would be very much appreciated if someone with experienced eye could spot the cause of the error and help me out.

 

 

Jason

________________________________________________________________________
PROSTEP AG, Dolivostraße 11, D-64293 Darmstadt
HR: Amtsgericht Darmstadt, HRB 8383
Vorstand: Dr. Bernd Pätzold (Vorsitz), Reinhard Betz
Aufsichtsrat: Dr. Heinz-Gerd Lehnhoff (Vorsitz)
________________________________________________________________________

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Configuring and using DataSource in Tomcat

Posted by Heping Ling <He...@mail.lehman.edu>.
Oops!  The Tomcat I use is version 5.5.23.

While trying to solve the problem, I put the driver file in both places:
c:\tomcat\common\lib and the application's WEB-INF\lib.  But that did not
work out.

Thank you for the clues!


Jason


-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Tuesday, October 02, 2007 2:19 PM
To: Tomcat Users List
Subject: RE: Configuring and using DataSource in Tomcat

> From: Heping Ling [mailto:Heping.Ling@mail.lehman.edu] 
> Subject: Configuring and using DataSource in Tomcat
> 
> I am new in doing web applications and new in using tomcat.  

Don't suppose you'd want to give anyone a hint about what Tomcat version
you're using?

> 2. File name and location of the JDBC driver:
> File name: ojdbc14dms.jar. I put it in c:\tomcat\common\lib.

Make sure the jar is not anywhere else in the classloader tree, such as
your webapp's WEB-INF/lib directory.

> java.lang.NoClassDefFoundError:
> oracle/dms/instrument/ExecutionContextForJDBC

Have you examined the jar to see if the class is really there?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Configuring and using DataSource in Tomcat

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Heping Ling [mailto:Heping.Ling@mail.lehman.edu] 
> Subject: Configuring and using DataSource in Tomcat
> 
> I am new in doing web applications and new in using tomcat.  

Don't suppose you'd want to give anyone a hint about what Tomcat version
you're using?

> 2. File name and location of the JDBC driver:
> File name: ojdbc14dms.jar. I put it in c:\tomcat\common\lib.

Make sure the jar is not anywhere else in the classloader tree, such as
your webapp's WEB-INF/lib directory.

> java.lang.NoClassDefFoundError:
> oracle/dms/instrument/ExecutionContextForJDBC

Have you examined the jar to see if the class is really there?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org