【发布时间】:2016-05-13 06:48:34
【问题描述】:
我的应用程序连接到一个 postgresql 数据库,但是当我启动我的 jboss 时
JBAS014775:新的缺失/不满足的依赖项:
服务 jboss.jdbc-driver.postgresql-9_4_1208_jre7_jar(缺失) 家属:[服务 jboss.data-source.java:jboss/postgresDS]
我该如何解决这个问题?尽管缺少依赖项,但当我继续使用我的应用程序时,我得到了 java.lang.ClassNotFoundException: org.postgresql.Driver 异常
我已经找了几个小时的解决方案,但仍然无法解决问题。
独立的.xml
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jta="false" jndi-name="java:jboss/postgresDS" pool-name="postgresDS" enabled="true" use-ccm="false">
<connection-url>jdbc:postgresql://localhost:5432/testdb</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<driver>postgresql-9.4.1208.jre7.jar</driver>
<security>
<user-name>postgres</user-name>
<password>test</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<background-validation-millis>0</background-validation-millis>
</validation>
<statement>
<prepared-statement-cache-size>0</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="postgresql-9.4.1208.jre7.jar" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
我的 /jboss-as-7.1.0.Final/modules/org/postgresql/main 上的模块/xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" xmlns="urn:jboss:domain:datasources:1.0" name="org.postgresql">
<resources>
<resource-root path="postgresql-9.4.1208.jre7.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
我正在使用 servlet、jsp 和 jdbc。
【问题讨论】:
标签: java postgresql jdbc jboss