缺少/不可用依赖项的服务 [英] Services with missing/unavailable dependencies

查看:269
本文介绍了缺少/不可用依赖项的服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道为什么会收到此错误:

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.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>


推荐答案

错误的原因是你缺少依赖性Java的:JBoss的/数据源/ UserDS。
使用Jboss 7.x +,您可以将这些数据源直接添加到应用服务器配置中。

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.

独立配置和域配置之间的区别是独立配置仅适用于具有所述配置的一个应用服务器。如果仔细查看domain.xml,您将看到几个应用服务器配置(也就是配置文件)。这些将非常类似于独立/ conf *目录下的独立,独立,独立ha,独立全ha配置文件。在域模式下操作允许您从中央位置(即域控制器)控制在该域上运行的许多不同服务器实例。 (如果已配置ha,则包括群集的节点)

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.

这篇关于缺少/不可用依赖项的服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆