If i add jbosscmp-jdbc.xml(because i want to use mysql and not hypessonic) the jboss give me the error. So i think it is a problem of the cmp descriptor but i cannot understand where...
Have you defined following in jbosscmp-jdbc.xml file -
<jbosscmp-jdbc>
<defaults>
<datasource>MysqlDS</datasource>
<datasource-mapping>PLEASE_MODIFY_THIS</datasource-mapping>
<preferred-relation-mapping>PLEASE_MODIFY_THIS</preferred-relation-mapping>
</defaults>
and also on jboss server directory in login-config.xml file ( This is optional. )
<application-policy name = "MysqlDbRealm">
<authentication>
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">sa</module-option>
<module-option name = "userName">sa</module-option>
<module-option name = "password"></module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MysqlDS</module-option>
</login-module>
</authentication>
</application-policy>
Then in mysql-ds.xml or other xml file for mysql in deploy directory -
<!-- Use the security domain defined in conf/login-config.xml -->
<security-domain>MysqlDbRealm</security-domain>
for datasource in same file above -
<datasources>
<local-tx-datasource>
<jndi-name>MysqlDS</jndi-name>
<connection-url>ConnectionStringtoMysqlDatabase</connection-url>
<driver-class>sqlDriverClassName</driver-class>
<user-name>someuser</user-name>
<password>userpassword</password>
<!-- sql to call when connection is created
<new-connection-sql>select * from something</new-connection-sql>
and also have you copied mysql driver file in lib directory of jboss server that you are using in your applicaiton.