DataSource Error
sreekanth.munarai Apr 28, 2015 10:25 AMHi All,
I tried to create datasource connection in JBoss EAP 6.3.
I have followed all the basic steps as follows:
1. Downloaded mysql-connector-java-5.1.34-bin.jar and placed it under com/mysql/main
2. Created module.xml as below
module xmlns="urn:jboss:module:1.1" name="com.mysql">
<properties>
<property name="jboss.api" value="unsupported"/>
</properties>
<resources>
<resource-root path="mysql-connector-java-5.1.34-bin.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>
3. Added the below changes in Standalone.xml:
<datasource jndi-name="java:jboss/datasources/sqlDS" pool-name="sqlDS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql:sqlserver://IP:Port/UAT;loginTimeout=80</connection-url>
<driver>mysql</driver>
<security>
<user-name>TEST</user-name>
<password>TEST123</password>
</security>
</datasource>
<drivers>
<driver name="mysql" module="com.mysql">
</driver>
</drivers>
When trying to start the server getting below error:
ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 25) JBAS014612: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "mysql")
]): org.jboss.msc.service.DuplicateServiceException: Service jboss.jdbc-driver.mysql is already registered
at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:158) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:236) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:742) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
When i try to access thru console, driver was already enabled. Tried to test connection found below exception:
Unexpected HTTP response: 500
Request
{ "address" => [
("subsystem" => "datasources"),
("data-source" => "sqlDS")
],
"operation" => "test-connection-in-pool"
}
Response
Internal Server Error
{ "outcome" => "failed",
"failure-description" => "JBAS010440: failed to invoke operation: JBAS010442: failed to match pool. Check JndiName: java:jboss/datasources/sqlDS",
"rolled-back" => true}
Please advise your suggestions.Thanks
Sreekant