Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JDBC ClassNotFoundException: com.sybase.jdbc3.jdbc.SybDriver when using Apache Tomcat BasicDataSource

1,925 views
Skip to first unread message

Steve Whatmore

unread,
Sep 24, 2007, 2:27:18 PM9/24/07
to
Good afternoon,
 
I am having problems in connecting using the BasicDataSource from Tomcat / Apahce when configuring it through the web.xml file and the context.xml file.
 
Here are the excerpts from web.xml
 
    <!-- Connection Pooling Resource Definition -->
    <resource-ref>
        <description>Data Source Connection Pool</description>
        <res-ref-name>jdbc/sybase</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Application</res-auth>
    </resource-ref>
 
and context.xml
 
    <Resource
        name="jdbc/sybase"
        auth="Application"
        factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
        type="javax.sql.DataSource"
        driverClassName="com.sybase.jdbc3.jdbc.SybDriver"
        url="jdbc:sybase:Tds:JAVASOURCE:5000/nbcn"
        username="dkim"
        password="password"
        minIdle="5"
        maxActive="50"
        maxWait="5000"
        defaultAutoCommit="true"
        defaultReadOnly="false"
        validationQuery=""
        testWhileIdle="false"
        testOnBorrow="false"
        testOnReturn="false"       
        timeBetweenEvictionRunsMillis="300000"
        minEvictableIdleTimeMillis="240000"
        removeAbandoned="true"
        removeAbandonedTimeout="300"
        logAbandoned="true"
    />
 
I am receiving the following error:
   
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.sybase.jdbc3.jdbc.SybDriver'
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:766)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
    at com.lynxdev.db.DataSource.getConnection(DataSource.java:97)
    at com.lynxdev.db.DataStoreDAO.getConnection(DataStoreDAO.java:36)
    at com.lynxdev.db.DataStoreDAO.getUsers(DataStoreDAO.java:75)
    at com.lynxdev.action.UserAction.getUserTable(UserAction.java:25)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
...
Caused by: java.lang.ClassNotFoundException: com.sybase.jdbc3.jdbc.SybDriver
    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:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:760)
 
However, when I explicity load the class using something like:
 
    // Sybase jdbc driver : com.sybase.jdbc3.jdbc.SybDriver
    Class.forName("com.sybase.jdbc3.jdbc.SybDriver");
    conn = DriverManager.getConnection("jdbc:sybase:Tds:JAVASOURCE:5000/nbcn", "user", "assword");
 
everything seems to work fine.
 
Any ideas
 
Thanks in advance.
 
Whatty

CasusBilly

unread,
Sep 25, 2007, 3:51:38 AM9/25/07
to
> driverClassName="com.sybase.jdbc3.jdbc.SybDriver"
> url="jdbc:sybase:Tds:JAVASOURCE:5000/nbcn"

What is the release of the JDBC driver that you are using? The "class
name" has changed over time, because JDBC has changed over time...

For instance, with JConnect 5.5 the library *jconn2.jar* defines
*com.sybase.jdbc2.jdbc.SybDriver* (2, not 3)

Remigiusz Cieslak (EMATIQUE)

unread,
Sep 25, 2007, 4:39:34 AM9/25/07
to
Hi,
 
where have you placed the JCONN3.jar ?
 
best regards
recies
 
Użytkownik "Steve Whatmore" <steven....@lynxdev.com> napisał w wiadomości news:46f80186@forums-1-dub...

Steve Whatmore

unread,
Sep 25, 2007, 9:30:33 AM9/25/07
to
I am using JCONN3.JAR and it is placed in the WEB-INF/lib directory (as expected) with the other jar files used by my application.
"Remigiusz Cieslak (EMATIQUE)" <emat...@ematique.com> wrote in message news:46f8c946$1@forums-1-dub...

Simon Ogden

unread,
Sep 25, 2007, 9:54:25 AM9/25/07
to
Hi,
 
It's telling you that it can't find that class (which happens to be your jdbc driver), you may want to try the Apache\Tomcat forums as the driver itself doesn't control whether it is found or not.
Sorry I can't give you any more. Not sure if this is relevant -  http://forum.java.sun.com/thread.jspa?threadID=585782&messageID=3016496
 
Good luck,
 
Simon
 
"Steve Whatmore" <steven....@lynxdev.com> wrote in message news:46f90d79$1@forums-1-dub...

J

unread,
Sep 25, 2007, 11:12:24 AM9/25/07
to
On 24 Sep 2007 11:27:18 -0700, "Steve Whatmore"
<steven....@lynxdev.com> wrote:

Here is an old post I had prepared long ago. I am not certain if it
still is workable:

"I have posted this earlier in the jconnect50 group. I will post
again here.

"I had the same kinds of problems as the poster with setting up the
DataSource. I took your advice and setup the dbcp connection pool for

Sybase. Here is my settings on 4.1.18.

<!-- Sybase Examples Context -->

<Context path="/SybTest" docBase="sybtest" debug="5"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_SybTest.log." suffix=".txt"
timestamp="true"/>

<Resource name="jdbc/pubs2"
auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/pubs2">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>

<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>

<parameter>
<name>maxIdle</name>
<value>5</value>
</parameter>

<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>

<parameter>
<name>driverClassName</name>
<value>com.sybase.jdbc2.jdbc.SybDriver</value>
*** delete this, you can use jdbc3 if you are using the
jconn3.jar vs the jconn2.jar *******
</parameter>

<parameter>
<name>url</name>
<value>jdbc:sybase:Tds:powerjay:3439</value>
</parameter>

<parameter>
<name>username</name>
<value>scott</value>
</parameter>

<parameter>
<name>password</name>
<value>scottpw</value>
</parameter>

</ResourceParams>
</Context>
"

>This is a multi-part message in MIME format.
>
>------=_NextPart_000_0021_01C7FEB7.12FA6AE0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
>Good afternoon,
>
>I am having problems in connecting using the BasicDataSource from Tomcat =
>/ Apahce when configuring it through the web.xml file and the =


>context.xml file.
>
>Here are the excerpts from web.xml
>
> <!-- Connection Pooling Resource Definition -->
> <resource-ref>
> <description>Data Source Connection Pool</description>
> <res-ref-name>jdbc/sybase</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Application</res-auth>
> </resource-ref>
>
>and context.xml
>
> <Resource

> name=3D"jdbc/sybase"
> auth=3D"Application"
> factory=3D"org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
> type=3D"javax.sql.DataSource"
> driverClassName=3D"com.sybase.jdbc3.jdbc.SybDriver"
> url=3D"jdbc:sybase:Tds:JAVASOURCE:5000/nbcn"
> username=3D"dkim"
> password=3D"password"
> minIdle=3D"5"
> maxActive=3D"50"
> maxWait=3D"5000"
> defaultAutoCommit=3D"true"
> defaultReadOnly=3D"false"
> validationQuery=3D""
> testWhileIdle=3D"false"
> testOnBorrow=3D"false"
> testOnReturn=3D"false" =20
> timeBetweenEvictionRunsMillis=3D"300000"
> minEvictableIdleTimeMillis=3D"240000"
> removeAbandoned=3D"true"
> removeAbandonedTimeout=3D"300"
> logAbandoned=3D"true"


> />
>
>I am receiving the following error:

> =20
>org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver =
>class 'com.sybase.jdbc3.jdbc.SybDriver'
> at =
>org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSou=
>rce.java:766)
> at =
>org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource=


>.java:540)
> at com.lynxdev.db.DataSource.getConnection(DataSource.java:97)
> at com.lynxdev.db.DataStoreDAO.getConnection(DataStoreDAO.java:36)
> at com.lynxdev.db.DataStoreDAO.getUsers(DataStoreDAO.java:75)
> at com.lynxdev.action.UserAction.getUserTable(UserAction.java:25)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

> at =
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java=
>:39)
> at =
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI=
>mpl.java:25)
>...
>Caused by: java.lang.ClassNotFoundException: =


>com.sybase.jdbc3.jdbc.SybDriver
> 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:306)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:169)

> at =
>org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSou=


>rce.java:760)
>
>However, when I explicity load the class using something like:
>
> // Sybase jdbc driver : com.sybase.jdbc3.jdbc.SybDriver
> Class.forName("com.sybase.jdbc3.jdbc.SybDriver");

> conn =3D =
>DriverManager.getConnection("jdbc:sybase:Tds:JAVASOURCE:5000/nbcn", =


>"user", "assword");
>
>everything seems to work fine.
>

>Any ideas=20
>
>Thanks in advance.
>
>Whatty
>------=_NextPart_000_0021_01C7FEB7.12FA6AE0
>Content-Type: text/html;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
><HTML><HEAD>
><META http-equiv=3DContent-Type content=3D"text/html; =
>charset=3Diso-8859-1">
><META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
><STYLE></STYLE>
></HEAD>
><BODY>
><DIV>
><DIV><FONT face=3DArial size=3D2>Good afternoon,</FONT></DIV>
><DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV><FONT face=3DArial size=3D2>I am having problems in connecting =
>using the=20
>BasicDataSource from Tomcat / Apahce when configuring it through the =
>web.xml=20
>file and the context.xml file.</FONT></DIV>
><DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV><FONT face=3DArial size=3D2>Here are the excerpts from =
>web.xml</FONT></DIV>
><DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &lt;!-- Connection =
>Pooling=20
>Resource Definition --&gt;</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
>&lt;resource-ref&gt;</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
>&nbsp;&nbsp;&nbsp;=20
>&lt;description&gt;Data Source Connection =
>Pool&lt;/description&gt;</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
>&nbsp;&nbsp;&nbsp;=20
>&lt;res-ref-name&gt;jdbc/sybase&lt;/res-ref-name&gt;</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
>&nbsp;&nbsp;&nbsp;=20
>&lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
>&nbsp;&nbsp;&nbsp;=20
>&lt;res-auth&gt;Application&lt;/res-auth&gt;</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
>&lt;/resource-ref&gt;</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>and =
>context.xml</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
>&lt;Resource</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
>&nbsp;&nbsp;&nbsp;=20
>name=3D"jdbc/sybase"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>auth=3D"Application"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>factory=3D"org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"</FONT></DI=
>V>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>type=3D"javax.sql.DataSource"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>driverClassName=3D"com.sybase.jdbc3.jdbc.SybDriver"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>url=3D"jdbc:sybase:Tds:JAVASOURCE:5000/nbcn"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
>username=3D"dkim"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>password=3D"password"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
>minIdle=3D"5"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
>maxActive=3D"50"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
>maxWait=3D"5000"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>defaultAutoCommit=3D"true"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>defaultReadOnly=3D"false"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>validationQuery=3D""</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>testWhileIdle=3D"false"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>testOnBorrow=3D"false"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>testOnReturn=3D"false"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
></FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>timeBetweenEvictionRunsMillis=3D"300000"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>minEvictableIdleTimeMillis=3D"240000"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>removeAbandoned=3D"true"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>removeAbandonedTimeout=3D"300"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
>logAbandoned=3D"true"</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
>/&gt;</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>I am receiving the =
>following=20
>error:</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
></FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial=20
>size=3D2>org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load =
>JDBC driver=20
>class 'com.sybase.jdbc3.jdbc.SybDriver'</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSou=
>rce.java:766)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource=
>.java:540)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>com.lynxdev.db.DataSource.getConnection(DataSource.java:97)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>com.lynxdev.db.DataStoreDAO.getConnection(DataStoreDAO.java:36)</FONT></D=
>IV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>com.lynxdev.db.DataStoreDAO.getUsers(DataStoreDAO.java:75)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>com.lynxdev.action.UserAction.getUserTable(UserAction.java:25)</FONT></DI=
>V>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java=
>:39)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI=
>mpl.java:25)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>...</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>Caused by:=20
>java.lang.ClassNotFoundException: =
>com.sybase.jdbc3.jdbc.SybDriver</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>java.net.URLClassLoader$1.run(URLClassLoader.java:200)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>java.security.AccessController.doPrivileged(Native Method)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>java.net.URLClassLoader.findClass(URLClassLoader.java:188)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>java.lang.ClassLoader.loadClass(ClassLoader.java:306)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>java.lang.ClassLoader.loadClass(ClassLoader.java:251)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)</FONT></DIV=
>>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>java.lang.Class.forName0(Native Method)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>java.lang.Class.forName(Class.java:169)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; at=20
>org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSou=
>rce.java:760)</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>However,&nbsp;when I =
>explicity load the=20
>class using something like:</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; // =
>Sybase jdbc driver=20
>: com.sybase.jdbc3.jdbc.SybDriver</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
>Class.forName("com.sybase.jdbc3.jdbc.SybDriver");</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; conn =
>=3D=20
>DriverManager.getConnection("jdbc:sybase:Tds:JAVASOURCE:5000/nbcn", =
>"user",=20
>"assword");</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>everything seems to work=20
>fine.</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>Any ideas </FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2>Thanks in =
>advance.</FONT></DIV>
><DIV align=3Dleft><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
><DIV align=3Dleft><FONT face=3DArial =
>size=3D2>Whatty</FONT></DIV></DIV></BODY></HTML>
>
>------=_NextPart_000_0021_01C7FEB7.12FA6AE0--
>

Steve Whatmore

unread,
Sep 25, 2007, 11:37:14 AM9/25/07
to
Thank you, thank you, thank you.
 
The link to the Java forum provided the answer.
 
Since I was using the Apache Tomcat supplied connection pooling, I guess the loading of the web app and the parsing of the web.xml and context.xml was prior to the actual loading of the webapp the jconn3.jar file had to be located in the Tomcat common/lib directory for the class to be found properly.
 
I am not sure that I like this, but it did solve the problem.
 
This of course will cause me deployment problems in that I have to remember that the jconn3.jar file must be placed in the common/lib directory and not the war file but such is life.
 
Thanks to all again.
 
Whatty
 
"Simon Ogden" <sog...@sybase.com> wrote in message news:46f91311@forums-1-dub...
0 new messages