JBOSS中新的缺失/不满足的依赖项ERROR

时间:2013-11-25 22:18:59

标签: java xml java-ee jpa jboss

我有一个使用JSF(Primefaces),JPA(Hibernate)和EJB的Web应用程序,并且无法在JBoss上配置数据源。我收到以下错误:

00:04:58,873 INFO [org.jboss.as.controller](控制器启动线程)JBAS014774:服务状态报告

JBAS014775:新的缺失/不满足的依赖项:

service jboss.jdbc-driver.com_mysql(missing)dependents:[service jboss.data-source.java:jboss/datasources/PhoneBookDB]

下面你可以看到我的persistence.xml,stanadlone.xml和module.xml。我错过了module.xml中的一些依赖项吗?

的persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- JBoss, Home of Professional Open Source Copyright 2012, Red Hat, Inc. 
and/or its affiliates, and individual contributors by the @authors tag. See 
the copyright.txt in the distribution for a full listing of individual contributors. 
Licensed under the Apache License, Version 2.0 (the "License"); you may not 
use this file except in compliance with the License. You may obtain a copy 
of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
by applicable law or agreed to in writing, software distributed under the 
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
OF ANY KIND, either express or implied. See the License for the specific 
language governing permissions and limitations under the License. -->
<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">
    <!-- If you are running in a production environment, add a managed 
        data source, this example data source is just for development and testing! -->
    <!-- The datasource is deployed as WEB-INF/greeter-quickstart-ds.xml, 
        you can find it in the source at src/main/webapp/WEB-INF/greeter-quickstart- ds.xml -->
    <jta-data-source>java:jboss/datasources/PhoneBookDB</jta-data-source>
    <properties>
        <!-- Properties for Hibernate -->
        <property name="hibernate.hbm2ddl.auto" value="create-drop" />
        <property name="hibernate.show_sql" value="false" />
    </properties>
 </persistence-unit>
</persistence>

module.xml:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.mysql">
 <resources>
 <resource-root path="mysql-connector-java-5.1.17-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>

standalone.xml:

<subsystem xmlns="urn:jboss:domain:datasources:1.0">
        <datasources>
            <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
                <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
                <driver>h2</driver>
                <security>
                    <user-name>sa</user-name>
                    <password>sa</password>
                </security>
            </datasource>
            <datasource jndi-name="java:jboss/datasources/PhoneBookDB" pool-name="PhoneBookDB" enabled="true" jta="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://127.0.0.1:3306/PhoneBookDB</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>com.mysql</driver>
<security>
    <user-name>root</user-name>
    <password>123</password>
</security>
<statement>
    <prepared-statement-cache-size>
        100
    </prepared-statement-cache-size>
    <share-prepared-statements>
        true
    </share-prepared-statements>
 </statement>
</datasource>
            <drivers>
                <driver name="com.mysql" module="com.mysql">
                <xa-datasource-class>com.mysql.jdbc.Driver</xa-datasource-class>
                </driver>
                <driver name="h2" module="com.h2database.h2">
                    <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                </driver>
            </drivers>
        </datasources>
    </subsystem>

有人能告诉我我做错了什么吗?

0 个答案:

没有答案