aspose file tools*
The moose likes JBoss/WildFly and the fly likes configure mySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "configure mySQL" Watch "configure mySQL" New topic
Author

configure mySQL

Stephen Selvaraj
Greenhorn

Joined: Jan 21, 2005
Posts: 21
Hi everyone
Cud any of you guide me how to configure mySQL database using JBoss
thanx in advance
Stephen
Damanjit Kaur
Ranch Hand

Joined: Oct 18, 2004
Posts: 346
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

Joined: Jan 21, 2005
Posts: 21
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

Joined: Oct 18, 2004
Posts: 346
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

Joined: Jan 21, 2005
Posts: 21
Hi Damanjit Kaur,

Thanks a lot for your guidance.
Its workin..

regards
Stephen
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: configure mySQL