This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes  java.lang.IllegalStateException: jboss.jca:name=MySQLDS,service=ManagedConnectionFactory is already Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark " java.lang.IllegalStateException: jboss.jca:name=MySQLDS,service=ManagedConnectionFactory is already" Watch " java.lang.IllegalStateException: jboss.jca:name=MySQLDS,service=ManagedConnectionFactory is already" New topic
Author

java.lang.IllegalStateException: jboss.jca:name=MySQLDS,service=ManagedConnectionFactory is already

abir jelassi
Greenhorn

Joined: Apr 30, 2012
Posts: 4
Hi everyone,
I have a big big problem. When i deploy my ear project composed by a dynamin web project and an ejb project in jboss i have this error:
i'm sure that i have only one mysql-ds.xml under meta inf and i deleted the mysql-ds.xml of jboss_home/server/default/deploy:
i need your help, pleaaaaaaaase

abir jelassi
Greenhorn

Joined: Apr 30, 2012
Posts: 4
Voilà mon mysql-ds.xml



Does anyone have a solution??
abir jelassi
Greenhorn

Joined: Apr 30, 2012
Posts: 4
I don't have errors anymore following this forum
but, can't see the execution of my application
Thanks anyway
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9912
    
158

Where is that -ds.xml located? And do you have more than one such file somewhere within your application?

[My Blog] [JavaRanch Journal]
abir jelassi
Greenhorn

Joined: Apr 30, 2012
Posts: 4
mysql-ds.xml is under meta inf of the ejb project with persistence.xml,orm.xml, ejb-jar.xml and beans.xml
thanks for your reply
Raghav Viswanathan
Greenhorn

Joined: Apr 26, 2012
Posts: 26

Hello Abir,

The issue is due to a conflict with already existing JNDI MySQLDS. You can try one of the following

1. Remove your application .ear file and start JBOSS as such. Now check in the admin console under datasources link if you already have one with the given JNDI name.
Two things could be possible
a. If you have a datasource with the JNDI name as MySQLDS, then there is a -ds.xml in your deploy folder with the same JNDI name. All you could do is a search for the word "MySQLDS" in your folder search/file search of the folder.
b. If there are no data sources listed then it must be inside of your .ear file.

2. Change the JNDI name ( Probably not the right way to do but would work).

Please note that there are few other ds.xml files even inside the folders of the deploy folder. For instance there is a folder called jbossesb.esb under the deploy folder which has a message-store-ds.xml which also creates a JNDI binding of the data source.

Just a word of advice, do not manually edit the ds.xml file for your server configuration even while changing the DB from HSQLDB. Run the ant script available in /jboss-as/tools/schema. Its is scripted beautifully and is very user-friendly.


Thanks and regards
Raghav.V





Better late than never.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java.lang.IllegalStateException: jboss.jca:name=MySQLDS,service=ManagedConnectionFactory is already
 
Similar Threads
Jboss 5.0.1GA - Error Installing to PortClassLoader
RuntimeException while trying to call the local interface of session bean from servlet
jboss deployment exception
RuntimeException when trying to deploy application using jboss
java.lang.IllegalStateException while deploying EAR(Webclient + EJB) project to Jboss ..