Services with missing/unavailable dependencies
Asked Answered
D

3

6

Any idea why I'm getting this error:

JBAS014775:    New missing/unsatisfied dependencies:
  service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.data-source.jboss/datasources/UserDS] 

ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) `{"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.data-source.jboss/datasources/UserDSjboss.jdbc-driver.com_mysql_jdbcMissing[jboss.data-source.jboss/datasources/UserDSjboss.jdbc-driver.com_mysql_jdbc]"]}}}`

persistence.xml

<?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>java:jboss/datasources/UserDS</jta-data-source>
          <properties>
             <!-- Properties for Hibernate -->
             <property name="hibernate.hbm2ddl.auto" value="create-drop" />
             <property name="hibernate.show_sql" value="true" />
          </properties>
       </persistence-unit>
    </persistence>

mydatasource-ds.xml

    <?xml version="1.0" encoding="UTF-8"?>
            <datasources xmlns="http://www.jboss.org/ironjacamar/schema"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema http://docs.jboss.org/ironjacamar/schema/datasources_1_0.xsd">
                <datasource jndi-name="java:jboss/datasources/UserDS" pool-name="kitchensink-quickstart" 
                    enabled="true" use-java-context="true">
                    <!-- jdbc:h2:mem:kitchensink-quickstart;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1 -->
                    <connection-url>
                        jdbc:mysql://localhost:3306/test
                    </connection-url>
                    <driver>mysql</driver>
                    <security>
                        <user-name>root</user-name>
                        <password>root</password>
                    </security>
                </datasource>
            </datasources>

module.xml

<module xmlns="urn:jboss:module:1.0" name="com.mysql">
      <resources>
        <resource-root path="mysql-connector-java-5.1.22.jar"/>
      </resources>
      <dependencies>
        <module name="javax.api"/>
      </dependencies>
    </module>
Duwe answered 10/1, 2013 at 22:6 Comment(0)
D
4

the reason for the error is you are missing the dependence java:jboss/datasources/UserDS. With Jboss 7.x+ these datasource can be added directly to the app servers configuration as you discovered.

the difference between Standalone and Domain configuration is the standalone configuration is designed for only one app server w/ said configuration. If you look closely at the domain.xml you will see several app server configurations (aka profiles). These will be much like standalone, standalone-full, standalone-ha, standalone-full-ha config files found under the standalone/conf* directory. Operating in domain mode allows you to control many different server instances running on that domain from a central location (ie the domain controller). ( this includes nodes of a cluster if you have ha configured)

This is closely related to your original question in that the domain controller has the ability to gracefully share this datasource configuration to all of its nodes.

Dimension answered 23/10, 2013 at 21:26 Comment(0)
E
6

If you are specifying the data source as a resource reference in web.xml, then match the name exactly with that in standalone.xml (or domain.xml):

web.xml:

 <resource-ref>
  <res-ref-name>java:jboss/datasources/OracleDS</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
 </resource-ref>

standalone.xml:

<datasource jndi-name="java:jboss/datasources/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="false">
Evars answered 16/5, 2014 at 5:47 Comment(1)
Nice! I had my <res-ref-name> set without the 'java:' at the start. That worked OK in JBoss EAP 7.0, but did not work on JBoss EAP 6.4. Making the name match exactly fixed it in 6.4.Vaulting
D
4

the reason for the error is you are missing the dependence java:jboss/datasources/UserDS. With Jboss 7.x+ these datasource can be added directly to the app servers configuration as you discovered.

the difference between Standalone and Domain configuration is the standalone configuration is designed for only one app server w/ said configuration. If you look closely at the domain.xml you will see several app server configurations (aka profiles). These will be much like standalone, standalone-full, standalone-ha, standalone-full-ha config files found under the standalone/conf* directory. Operating in domain mode allows you to control many different server instances running on that domain from a central location (ie the domain controller). ( this includes nodes of a cluster if you have ha configured)

This is closely related to your original question in that the domain controller has the ability to gracefully share this datasource configuration to all of its nodes.

Dimension answered 23/10, 2013 at 21:26 Comment(0)
W
0

Wildfly Version 10.0.1 I am running a non clustered Wildlfy set up. I had 2 Wildlfy instances already running and was trying to deploy the 3rd one when I encountered the error. I had to stop the other two instances and then try again and the wildfly deployment went through successfully.

Wilberwilberforce answered 14/11, 2019 at 9:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.