My application connects to a postgresql database, but when I start my jboss a
JBAS014775: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.postgresql-9_4_1208_jre7_jar (missing) dependents: [service jboss.data-source.java:jboss/postgresDS]
How do I fix this? and when I continue with my application despite the missing dependencies, I got a java.lang.ClassNotFoundException: org.postgresql.Driver exception
I have been searching for a solution for hours but I can't still fix the issue.
standalone.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>
module/xml on my /jboss-as-7.1.0.Final/modules/org/postgresql/main
<?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>
I'm using servlets, jsp and jdbc.
You need to add a jboss-dependencies,xml file with a module dependency on the org.postgresql module. You can also do this with a MANIFEST.MF. Both files are placed in the WAR's META-INF dir.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.