缺少jboss.jdbc-driver.org_postgresql_Driver

时间:2015-05-06 06:49:23

标签: jboss7.x

我正在尝试在standalone.xml中配置Postgres数据源。我把驱动程序jar放在正确的位置“jboss-as-7.2.0.Final \ modules \ org \ postgresql \ main”,这是我的“standalone.xml”:

            <datasource jta="true" jndi-name="java:jboss/datasources/ProcessEngine" pool-name="ProcessEngine" enabled="true" use-java-context="true" use-ccm="true">
                <connection-url>jdbc:postgresql://localhost:5432/camunda_process_engine</connection-url>
                <driver-class>org.postgresql.Driver</driver-class>
                <driver>postgresql</driver>
                <security>
                    <user-name>postgres</user-name>
                    <password>postgres</password>
                </security>                   
            </datasource>
        <drivers>
            </driver>
            <driver name="postgresql" module="org.postgresql">
                <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
            </driver>
        </drivers>

...

“jboss-as-7.2.0.Final \模块\有机\的PostgreSQL \主\ module.xml”

<?xml version="1.0" encoding="UTF-8"?>  
<module xmlns="urn:jboss:module:1.0" name="org.postgresql">  
  <resources>  
  <resource-root path="postgresql-9.3-1102.jdbc41.jar"/>  
  </resources>  
  <dependencies>  
      <module name="javax.api"/>  
      <module name="javax.transaction.api"/>  
  </dependencies>  
</module>

我正在尝试启动服务器,但它显示错误。

JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.jdbc-driver.org_postgresql_Driver (missing) dependents: [service jboss.driver-demander.java:jboss/datasources/ProcessEngine, service jboss.data-source.java:jboss/datasources/ProcessEngine] 

1 个答案:

答案 0 :(得分:1)

您还必须在应用程序中添加新模块的依赖项。最简单的方法是将一个jboss-deployment-structure.xml添加到您的Ear的META-INF中,或者如果您刚刚发生了战争,请将其放入WEB-INF。

<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <deployment>
        <dependencies>
            <module name="org.postgresql" />
        </dependencies>
    </deployment>
</jboss-deployment-structure>

重新部署时,JBoss会知道将新的自定义模块放在类路径中。 AS7 here中的类加载体面指南。