servlet to MySQL DataSource problems
smaring Mar 13, 2002 2:46 PMI have an ear containing a war with a servlet that needs access to a DataSource defined in jboss.jcml. I've tried two different methods to config the DS and niether seem to work:
1) XADataSourceLoader method:
org.gjt.mm.mysql.Driver
GnuAC_DS
org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
jdbc:mysql://localhost/gnuac
1200000
GnuACUser
10
password
false
false
false
true
120000
1800000
false
false
1.0
0
this hangs on startup at:
...
[INFO,JdbcProvider] Starting
[INFO,JdbcProvider] Started
[INFO,GnuAC_DS] Starting
[INFO,GnuAC_DS] XA Connection pool GnuAC_DS bound to java:/GnuAC_DS
2) ConnectionFactoryLoader method:
JBOSS-SYSTEM:service=Naming
JBOSS-SYSTEM:service=TransactionManager
JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory
JCA:service=RARDeployer
#
XADataSourceClass=org.gjt.mm.mysql.jdbc2.optional.MysqlXADataSource
XADataSourceProperties=serverName=localhost;databaseName=gnuac;port=3306
ConnectionURL=jdbc:mysql://localhost:3306/gnuac
UserName=GnuACUser
Password=password
GnuAC_DS
java:/TransactionManager
Minerva JDBC LocalTransaction ResourceAdapter
JCA:service=RARDeployer
MinervaSharedLocalCMFactory
#
InvalidateOnError=false
BlockingTimeoutMillis=500000
IdleTimeoutMillis=1800000
MaxSize=10
TimestampUsed=false
IdleTimeoutEnabled=false
CleanupIntervalMillis=120000
MinSize=0
GCMinIdleMillis=1200000
GCEnabled=false
MaxIdleTimeoutPercent=1.0
org.jboss.resource.security.ManyToOnePrincipalMapping
Complaints during startup include:
[INFO,RARDeployer] Attempting to deploy RAR at 'file:/usr/local/JBoss-2.4.4_Tomcat-4.0.1/jboss/deploy/lib/jbosspool-jdbc.rar'
[INFO,RARMetaData] Loading Minerva Resource Adapter for JDBC 1/2 drivers
[INFO,RARMetaData] Required license terms present. See deployment descriptor.
[WARN,MinervaDS] Not setting config property 'Driver'
[WARN,MinervaDS] Not setting config property 'Password'
[WARN,MinervaDS] Not setting config property 'UserName'
[INFO,MinervaDS] Bound connection factory for resource adapter 'Minerva JDBC LocalTransaction ResourceAdapter' to JNDI name 'java:/MinervaDS'
[WARN,null] Not setting config property 'Driver'
[WARN,null] Not setting config property 'ConnectionURL'
[WARN,null] Not setting config property 'Password'
[WARN,null] Not setting config property 'UserName'
[INFO,null] Bound connection factory for resource adapter 'Minerva JDBC LocalTransaction ResourceAdapter' to JNDI name 'java:/null'
and the servlet lookup throws a [ERROR,Default] javax.naming.NameNotFoundException: GnuAC_DS not bound
from servlet:
dataSource = (DataSource) context.lookup( "java:comp/env/jdbc/GnuAC_DS" );
<web-app>
<display-name>Gnu A/C Web App</display-name>
<servlet-name>AccountManager</servlet-name>
<servlet-class>org.gnuac.account.AccountManager</servlet-class>
<resource-ref>
Gnu A/C DataSource
<res-ref-name>jdbc/GnuAC_DS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
<jboss-web>
<resource-ref>
<res-ref-name>jdbc/GnuAC_DS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:/GnuAC_DS</jndi-name>
</resource-ref>
</jboss-web>
Any help getting either one of these senarios to work would be greatly appriciated.
Thanks.
-Steve Maring