wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes datasource already registered error in deploying JPA war file to JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "datasource already registered error in deploying JPA war file to JBoss" Watch "datasource already registered error in deploying JPA war file to JBoss" New topic
Author

datasource already registered error in deploying JPA war file to JBoss

Dave Wimberly
Greenhorn

Joined: Aug 01, 2002
Posts: 3
Has anyone encountered this error in JBoss AS 7.1.
I've got a simple application that uses JPA - referencing a data source that is already in standalone server. I added the data source via the admin console.

This is stack trace:
14:14:52,539 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."transhist-process.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."transhist-process.war".INSTALL
Failed to process phase INSTALL of deployment "transhist-process.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_24]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_24]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_24]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS010464: Exception deploying datasource java:jboss/datasources/Core2DS
at org.jboss.as.connector.deployers.processors.DsXmlDeploymentInstallProcessor.deploy(DsXmlDeploymentInstallProcessor.java:125)
...
My persistence.xml contents:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="primary">
<jta-data-source>datasources/Core2DS</jta-data-source>
<class>com.web.thp.data.Transhist</class>
<validation-mode>NONE</validation-mode>
</persistence-unit>
</persistence>
-------------
I've not found much on this sort of error. Everything is running on Windows 7 - 64-bit.

Thanks,
Dave
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9317
    
109

That doesn't look like the entire exception stacktrace. Please post the entire exception stacktrace and your datasource configurations.

While posting, wrap the logs and xml content in a code block by using the Code button in the message editor window. Use the Preview button to make sure the post is correctly formatted.

[My Blog] [JavaRanch Journal]
Dave Wimberly
Greenhorn

Joined: Aug 01, 2002
Posts: 3
Hi, this is the subsection for the datasources in standalone\configuration\standalone.xml... Added the Oracle data source via the console -- except for the "check-valid-connection-sql".

The log entry in JBoss server log:


Dave
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 860



This happened to me while playing with JBoss EAP 6/7.1

Not only are you declaring it in some xml file buried in JBoss, but also within your war.
I don't know exactly where off hand, but look for Core2DS in your instalation.

WP
Dave Wimberly
Greenhorn

Joined: Aug 01, 2002
Posts: 3
Thanks William,
I found the duplicate DataSource XML file!
I'm using these new JBoss Maven project templates in Eclipse and must have done something wrong to make it generate the additional data source to deploy.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: datasource already registered error in deploying JPA war file to JBoss
 
Similar Threads
org.hibernate.HibernateException: Specified JDBC Driver not found
Jboss 7 Datasource configured correctly...But unable to connect
JBoss 7 Hibernate 3.6.9 service
How to deploy open cms on jboss as 7
Caused by: javax.persistence.PersistenceException: JBAS011466: PersistenceProvider 'org.apache.openj