缺少依赖关系Maven Project

时间:2017-07-16 17:55:57

标签: java maven jboss

我正在Eclipse上做一个maven项目,在Rpi上的jboss服务器上运行并连接到mysql数据库。但这给了我一个错误,我错过了对domain_model_ee_ds

的依赖

错误: enter image description here

我的项目:

enter image description here

的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="KnowUrMates-Business"
        transaction-type="JTA">
        <jta-data-source>java:/jdbc/domain_model_ee_ds</jta-data-source>
        <!-- The datasource is deployed as <EAR>/META-INF/sri-srv-ds.xml, you can 
            find it in the source at ear/src/main/resources/META-INF/domain-model-ee-ds.xml -->
        <class>business.Participant</class>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <shared-cache-mode>NONE</shared-cache-mode>
        <properties>        
            <property name="javax.persistence.schema-generation.database.action"
                value="drop-and-create" />
            <property name="javax.persistence.schema-generation.create-source"
                value="metadata" />
            <property name="javax.persistence.schema-generation.drop-source"
                value="metadata" />
            <property name="javax.persistence.sql-load-script-source"
                value="META-INF/load-script.sql" />
        </properties>
    </persistence-unit>
</persistence>

KnowUrMates-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">
   <!-- The datasource is bound into JNDI at this location. We reference 
      this in META-INF/persistence.xml -->
    <datasource jndi-name="java:/jdbc/domain_model_ee_ds" pool-name="mysql_domain_model_ee_ds_Pool" enabled="true" use-java-context="true">
        <connection-url>jdbc:mysql://192.168.2.101/KnowUrMates</connection-url>
        <driver>KnowUrMates-ear-1.0.ear_com.mysql.jdbc.Driver_5_1</driver>
        <pool>
            <min-pool-size>5</min-pool-size>
            <max-pool-size>15</max-pool-size>
        </pool>
        <security>
            <user-name>root</user-name>
            <password>raspberry</password>
        </security>
        <statement>
            <prepared-statement-cache-size>100</prepared-statement-cache-size>
            <share-prepared-statements/>
        </statement>
    </datasource>
</datasources>

0 个答案:

没有答案