Problems Connecting to mysql
brysona Aug 12, 2002 2:38 PMProblem Connecting to Mysql
I am using the jboss-3.0.0_tomcat-4.0.3 configuration with mysql on
a Windows 2000 machine. I am having problems connecting to mysql with an error of
no resource manager found for MySqlDS.
I have removed the hsqldb-service.xml from the deploy directory replacing it with a
mysql-service.xml.
see attached file
I have also edited the login-config.xml file adding
<!-- Security domains for testing new jca framework -->
<application-policy name = "MySqlDbRealm">
<login-module code=
"org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">developer</module-option>
<module-option name = "userName">alan</module-option>
<module-option name = "password"></module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>
</login-module>
</application-policy>
And the standardjaws.xml changing the DefaultDS to
java:/MySqlDS
<type-mapping>MySql SQL</type-mapping>
false
And also the standardjbosscmp.xml again changing ther DefaultDS to
java:/MySqlDS
<datasource-mapping>Mysql SQL</datasource-mapping>
My ejb code is
System.out.println("Start5");
Context ic2 = new InitialContext();
System.out.println("Start6");
//DataSource ds = (DataSource) ic2.lookup("java:comp/env/MySqlDS");
DataSource ds = (DataSource) ic2.lookup("java:MySqlDS");
System.out.println("Start7");
conn = ds.getConnection();
This errors on the DataSource ds = (DataSource) ic2.lookup("java:MySqlDS") line
javax.naming.NameNotFoundException: DefaultDS not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
2002-08-12 17:51:44,077 INFO [STDOUT] Start5
2002-08-12 17:51:44,077 INFO [STDOUT] Start6
2002-08-12 17:51:44,077 ERROR [STDERR] FATAL!
2002-08-12 17:51:44,087 ERROR [STDERR] Exception:MySqlDS not bound
2002-08-12 17:51:44,087 ERROR [STDERR] javax.naming.NameNotFoundException: MySqlDS not bound
My ejb-jar.xml inlcudes
<resource-ref>
<res-ref-name>MySqlDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
See attached for summary of error log
Thanks
Alan