Services with missing/unavailable dependencies EAP6.4
jaspersunshine Aug 2, 2017 9:59 AMHey guys, I will try to provide as many details as possible to to you hoping that the issue can be resolved sometimes soon.
Setup:
- JBoss EAP 6.4 running on one virtual machine
- Microsoft SQL server developer edition 2014 running on a different virtual machine.
- TCP/IP is enabled thru Sql Server Configuration Manager
- I have added an database called example owned by User prototype with password goforit and authentication mode is set to SQL Server Authentication
- We originally use built-in H2 database for testing and now would like to test it with ms SQL server which is closer to our final setup.
persistence.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<persistence 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"
version="2.0">
<persistence-unit name="obps" transaction-type="JTA">
<description>Forge Persistence Unit</description>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/ExampleDSExternal</jta-data-source>
<class>com.obps.cpm.impl.beams.BeamConfig</class>
<class>com.obps.cpm.impl.beams.BeamInfo</class>
<class>com.obps.cpm.impl.beams.BeamInfoKey</class>
<class>com.obps.cpm.impl.beams.BeamVertex</class>
<class>com.obps.cpm.impl.beams.BeamVertexKey</class>
<class>com.obps.cpm.impl.beams.ElementWeight</class>
<class>com.obps.cpm.impl.beams.ElementWeightKey</class>
<class>com.obps.cpm.impl.beams.InterbeamGain</class>
<class>com.obps.cpm.impl.beams.InterbeamGainKey</class>
<class>com.obps.cpm.impl.ephem.EphemRecord</class>
<class>com.obps.cpm.impl.ephem.EphemReport</class>
<!-- <exclude-unlisted-classes>false</exclude-unlisted-classes>-->
<properties>
<!-- Use option "update" so that data from previous runs remains in database /-->
<property name="hibernate.hbm2ddl.auto" value="update"/>
<!--property name="hibernate.hbm2ddl.auto" value="create"/-->
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServer2012Dialect"/>
<property name="hibernate.show_sql" value="true"/>
<!-- property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>-->
</properties>
</persistence-unit>
</persistence>
data source file not working (MS SQL)
mssql-ds.xml:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<datasource
jndi-name="java:jboss/datasources/ExampleDSExternal"
enabled="true"
use-java-context="true" pool-name="ExampleDSExternal">
<connection-url>jdbc:sqlserver://10.10.10.25:1443;DatabaseName=Example</connection-url>
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<security>
<user-name>prototype</user-name>
<password>goforit</password>
</security>
</datasource>
</datasources>
The below data source file is for H2 database configuration and everything works.
<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.ironjacamar.org/schema/datasources_1_0.xsd">
<datasource
jndi-name="java:jboss/datasources/ExampleDSExternal"
enabled="true"
use-java-context="true" pool-name="ExampleDSExternal">
<connection-url>jdbc:h2:tcp://10.10.10.22/~/test</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<drivers>
<driver name='h2' module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
The error output when trying to deploy the application on the server
"{\"JBAS014771: Services with missing/unavailable dependencies\" => [\"jboss.persistenceunit.\\\"OBPS_CPM.war#obps\\\" is missing [jboss.naming.context.java.jboss.datasources.ExampleDSExternal]\"]}"
I am suspecting that either the data source xml file configuration is not correct, or the access to the developer edition of SQL server is not set up properly because I do not know the ins and outs of it. So my question is, is there any issue with my data source file or the persistence.xml file? or do you think I have not set up the SQL server properly to be connected externally? For example, should I choose windows authentication or the SQL server authentication and how does it affect my data source configuration?
I also learnt recently that you can configure the connection to the database thru standalone.xml file. What are the pros/cons of doing it as opposed to the approach I am using right now??
Sorry to bombard you with questions and hopefully I can resolve the issue soon. Thank you!