I use Sybase ASE12.5 along with Tomcat 5.0.24

I place the JConnect (jconn2d.jar) file in the %tomcathome%/common/lib
directory. Sybase and Tomcat 5.0.24 can work together. I don't have my
web.xml or root.xml (I use virtual hosting) here however I can provide them
tomorrow once I am at work.

Matt Anderson


-----Original Message-----
From: Jeff Sexton [mailto:[EMAIL PROTECTED]
Sent: Friday, June 18, 2004 1:40 AM
To: [EMAIL PROTECTED]
Subject: Sybase and Tomcat 5, Possible Problem


After a lot of effort, I feel there may be some reason that the Sybase
JConnect JDBC driver doesn't work in Tomcat 5.0.24 (I use Tomcat 4 for my
Sybase driven apps quite a bit).

The exception is:

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null', cause: null

META-INF/context.xml is:

   <Context path="/forteCommon" docBase="forteCommon" reloadable="true">
           <ResourceLink name="jdbc/odsdb03" global="jdbc/odsdb03"
                         type="javax.sql.DataSource"/>
   </Context>

 From conf/server.xml contains:

   <GlobalNamingResources>
     <Resource name="jdbc/odsdb03"
       auth="Container"
       type="javax.sql.DataSource"/>
     <ResourceParams name="jdbc/odsdb03">
       <parameter>
         <name>factory</name>
         <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
       </parameter>
       <parameter>
         <name>username</name>
         <value>excalibur</value>
       </parameter>
       <parameter>
         <name>password</name>
         <value>mypassword</value>
       </parameter>
       <parameter>
         <name>driverClassName</name>
         <value>com.sybase.jdbc2.jdbc.SybDriver</value>
       </parameter>
            <parameter>
              <name>driverName</name>
              <value>jdbc:sybase:Tds:pdxax12:4100</value>
            </parameter>
       <parameter>
         <name>url</name>
         <value>jdbc:sybase:Tds:pdxax12:4100</value>
       </parameter>
       <parameter>
         <name>maxActive</name>
         <value>5</value>
       </parameter>
     </ResourceParams >
   </GlobalNamingResources>

web.xml contains:

<web-app>
     <servlet>
         <servlet-name>
             ProvCICS
         </servlet-name>
         <servlet-class>
             com.ods.forte.cics.servlet.ProvCICS
         </servlet-class>
         <load-on-startup>1</load-on-startup>
     </servlet>

     <servlet-mapping>
       <servlet-name>ProvCICS</servlet-name>
       <url-pattern>/ProvCICS</url-pattern>
     </servlet-mapping>

     <resource-ref>
       <description>odsdb03 Connection Pool</description>
       <res-ref-name>jdbc/odsdb03</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>Container</res-auth>
     </resource-ref>
</web-app>


I have also tried working with the <context> placed in server.xml
and with the <Resource> defined in the context, all combinations
yield the same behavior.

*Tomcat does actually log into the database server when it starts*

I can see it from the database side.  Therefore I know the jdbc
jar file is loaded and the connection specification correct and working.
In addition, the stack trace in catalina.out includes a point
in Sybase code:

Cannot create JDBC driver of class '' for connect URL 'null'
java.lang.NullPointerException
         at com.sybase.jdbc2.jdbc.SybDriver.acceptsURL(SybDriver.java:197)
         at java.sql.DriverManager.getDriver(DriverManager.java:249)
         at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav
a:743)
         ...

So can I conclude that the app is actually linked to the resource?  If
so then the problem seems to be that the information required somehow
does not reach down the driver?

Ideas?

Should I rollback to TC 4x for awhile?

--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com

This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to