OK I tried this
http://www.jboss.org/file-access/default/members/jbossas/freezone/docs/Installation_And_Getting_Started_Guide/5/html/Using_other_Databases.html#creating_a_jdbc_client
and it worked...
So it means that either my DS file is wrong or that it is a Seam problem.
Thanks anyway
Oscar
Hi
I am quite new to JBoss and I am struggling to get a MySQL Datasource working.
I am writing a Seam application but the problem seems to be a JBoss problem and I have tried for several hours to get it woking... I really don't understand what is wrong and I don't know if JMX allows to test the database connection either...
I have copied mysql-connector-java-5.1.7-bin.jar to server/default/lib and my datasource is defined as followed:
(the driver works when I connect to the database from Eclipse...)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE datasources
PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
"http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
<datasources>
<local-tx-datasource>
<jndi-name>MyDatabaseDatasource</jndi-name>
<connection-url>jbdc:mysql://localhost:3306/mydatabase</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>xxx</user-name>
<password>xxx</password>
<exception-sorter-class-name>
org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
</exception-sorter-class-name>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
Here is the exception I get...
16:59:10,223 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Wrong driver class for this connection URL)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:225)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:611)
....
16:59:10,231 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
16:59:10,231 ERROR [JDBCExceptionReporter] Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Wrong driver class for this connection URL); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Wrong driver class for this connection URL))
Many thanks for your help
Oscar