The JDBC library list property does not seem to work when using Tomcat's DataSource feature. It always defaults to the AS400's job default library list.
The same JDBC connection URL used in a standalone application (no Tomcat involved) seems to handle the library list property correctly. I still can't determine if this is really a Tomcat issue or a JDBC driver issue.
JTOpen version 4.6
AS400 version v5r2
JDK version 1.5
Tomcat 5.5.4
My Tomcat Context:
<Context debug="0" privileged="true">
<Resource name="jdbc/as400" auth="Container"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
maxActive="20"
maxIdle="10"
maxWait="-1"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
driverClassName="com.ibm.as400.access.AS400JDBCDriver"
url="jdbc:as400://hostname;naming=system;libraries=,pgmdbt,caelib;errors=full"
username="userid"
password="password"/>
</Context>
JTOpen doesn't use have a url property for its. Have you tried specifying the "libraries" property when setting up your context?
The "libraries" property IS being set in the url of the Context. Please see the <Context> example include in bug submisstion.
This property is begin ignored when using contexts in Tomcat. This is the reason for this bug report.
My suggestion is to add a libraries property by itself to the context, not as part of the url. Are the other properties working such as naming=system?
For example:
<Context debug="0" privileged="true">
<Resource name="jdbc/as400" auth="Container"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
maxActive="20"
maxIdle="10"
maxWait="-1"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
driverClassName="com.ibm.as400.access.AS400JDBCDriver"
url="jdbc:as400://hostname;naming=system;libraries=,pgmdbt,caelib;errors=full"
username="userid"
password="password"
libraries=",pgmdbt,caelib"/>
</Context>
Putting the libraries property by itself in the context doesn't work either.
The naming=system property works.
The default-schema does not work either.
Logged In: YES
user_id=1215462
Using the following context.xml, JTOpen 4.7, AS400 V5R2,
JDK 1.5 and Tomcat 5.5.4 I am not having any problems with
the libraries property. Note that I amusing a different
resource factory than you. As Tomcat 5.5.4 couldn't find the
one you were using. Did you include a jar file somewhere for
it?
context.xml file
<!-- The contents of this file will be loaded for each web
application -->
<Context debug="0" privileged="true">
<!-- Default set of monitored resources -->
<WatchedResource>WEB-
INF/web.xml</WatchedResource>
<WatchedResource>META-
INF/context.xml</WatchedResource>
<!-- Uncomment this to disable session
persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
<Resource name="jdbc/as400" auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFact
ory"
maxActive="20"
maxIdle="10"
maxWait="-1"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
driverClassName="com.ibm.as400.access.AS400JDBCDriver"
url="jdbc:as400://xxxxxx;naming=system;libraries=,button;err
ors=full;trace=true"
username="xxxxxxx"
password="xxxxxxxxx"/>
</Context>
Logged In: YES
user_id=1215462
Closing this JTOpen bug since we have not received any
follow-up information and cannot reproduce. Our policy is
to wait 30 days for follow-up information.