Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

configure mySQL

 
Stephen Selvaraj
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone
Cud any of you guide me how to configure mySQL database using JBoss
thanx in advance
Stephen
 
Damanjit Kaur
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JBoss directory you can look for examples folder wherein you will find example database configuration files(xml files) for different databases. You need to copy the configuration file for mysql(provided in example directory) in deploy directory.
Modify the url,username, password for your database in that file.
 
Stephen Selvaraj
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Damanjit Kaur

Many thanx for your response.
Well I am learning EJB's using JBoss mySQL.
right now i m quite successfull in getting connection using Datasource, but I m facing issue with entity bean deployment.
I did a quit lot of updation
1) mysql-ds.xml
2) jbosscmp-jdbc.xml
3) standardjaws.xml
4) standardjbosscmp-jdbc.xml
but still i m not successfull :-(
I keep gettin the following exception..

Depends On Me: org.jboss.deployment.DeploymentException: Failed to obtain type-mapping metadata from the metadata library MBean: jboss.jdbc atasource=MySqlDS,service=metadata is not registered.; - nested throwable: (javax.management.InstanceNotFoundException: jboss.jdbc atasource=MySqlDS,service=metadata is not registered.)

regards
stephen
 
Damanjit Kaur
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did a quit lot of updation
1) mysql-ds.xml
2) jbosscmp-jdbc.xml
3) standardjaws.xml
4) standardjbosscmp-jdbc.xml
but still i m not successfull :-(
I keep gettin the following exception..



You don't need to do so many updation, only updation in mysql-ds file. and then on client application need to specify mapping for mysql i.e. the name for this mapping which is given in standardjbosscmp-jdbc.xml file and also in jbosscmp-jdbc.xml file in case you are not using xdoclet otherwise then you just need to specify this mapping and datasource in xdoclet.

and if you want to specify principal,passwords for security domain then you can simply copy the application module tag in conf/login-config.xml file change it for mysql and then specify this name in mysql-ds.xml file. How you have to specify this- yoou can see in hsqldb-ds.xml file in deploy directory and its corresponding reference in application-policy tag in login-config.xml file.

The error that you are getting may be because of some name mistake for mapping name that is specified for mysql in your standardjbosscmp-jdbc.xml and mysql-ds.xml and possibly in jbosscmp-jdbc.xml file too.

check this tag in all these files
in mysql-ds.xml
<metadata>
<type-mapping> </type-mapping>
</metadata>

in standardjboss...xml file
<type-mapping>
<name>mySQL</name>


in jbosscmp...xml file

B] <datasource-mapping> </datasource-mapping> [/B]
 
Stephen Selvaraj
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Damanjit Kaur,

Thanks a lot for your guidance.
Its workin..

regards
Stephen
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic