Reputation: 118
im trying to deploy a JPA rest application and getting the following error trying to deploy on Wildfly 10.
Error:
"{
\"WFLYCTL0412: Required services that are not installed:\" => [
\"jboss.naming.context.java.app.\\\"internal-1.0\\\".newDevConnection\",
\"jboss.naming.context.java.jboss.datasources.ExampleDS\"
],
\"WFLYCTL0180: Services with missing/unavailable dependencies\" => [
\"jboss.naming.context.java.module.\\\"internal-1.0\\\".\\\"internal-1.0\\\".DefaultDataSource is missing [jboss.naming.context.java.jboss.datasources.ExampleDS]\",
\"jboss.persistenceunit.\\\"internal-1.0.war#com.e24_MavenProjectTest_war_1.0-SNAPSHOTPU\\\" is missing [jboss.naming.context.java.app.\\\"internal-1.0\\\".newDevConnection]\",
\"jboss.persistenceunit.\\\"internal-1.0.war#com.e24_MavenProjectTest_war_1.0-SNAPSHOTPU\\\".__FIRST_PHASE__ is missing [jboss.naming.context.java.app.\\\"internal-1.0\\\".newDevConnection]\"
]
}"
persistance.xml
<persistence-unit name="app-pu" transaction-type="JTA">
<jta-data-source>java:/newDevConnection</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties/>
</persistence-unit>
datasource in standalone.xml
<datasources>
<datasource jndi-name="java:/newDevConnection" pool-name="secret" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://secret...</connection-url>
<driver>mysql</driver>
<security>
<user-name>secret</user-name>
<password>secret</password>
</security>
</datasource>
<drivers>
<driver name="com.mysql" module="mysql.mysql-connector-java">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="org.mysql">
<driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>
</drivers>
</datasources>
Edit: mysql jdbc driver
is located in project/WEB-INF/lib
folder
And what is the difference in an "xa-datasource" and "non-xa-datasource"?
Am i on the right track here? thanks in advance / Marcus
Upvotes: 3
Views: 29641
Reputation: 96
I know it's a year old but in case somebody else hits this question I'll post what I have done for this problem. This took me forever to figure out as new JBOSS Admin.
Short story is the ExampleDS holds a default section in the profile which is where your error is coming from. I normally work with Domain profiles so I'll show the example I have, but Standalone is the same just drop the profile name in front. Default-Bindings is the section in ee subsystem.
<default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
The default datasource="java:jboss/datasources/ExampleDS
is the source of the problem.
You can remove and set the default DataSource to undefined.
/profile=Profile_NameHere/subsystem=datasources/data-
source=ExampleDS:remove()
/profile=Profile_NameHere/subsystem=ee/service=default-bindings:write-
attribute(name=datasource,value=undefined)
OR
You can set your own DataSource as the default.
/profile=Profile_NameHere/subsystem=ee/service=default-bindings:write-
attribute(name=datasource,value=java\:\/jboss\/datasources/name)
Upvotes: 6
Reputation: 21
From the error message it looks like you deleted the exampleDS wich is needed by other services. So put that section back to datasources.
And XA-Datasource are supporting transactions.
Upvotes: 2