JBoss7 + PostgreSQL新的缺少/不满意的依赖关系 [英] JBoss7 + PostgreSQL New missing/unsatisfied dependencies
问题描述
im将项目从JBoss3迁移到JBoss7.我昨天才刚开始,并重新配置了standalone.xml,module.xml和persistence.xml.
im migrating a Project from JBoss3 to JBoss7. I just started yesterday and reconfigured my standalone.xml, module.xml and persistence.xml.
在JBoss modules文件夹中,我创建了org/postgres/main目录.在此目录中,我获得了新的Postgres JDBC41驱动程序和我的module.xml.
In the JBoss modules folder, i created the org/postgres/main dir. In this dir i got the new Postgres JDBC41 Driver and my module.xml.
如果我想启动JBoss,这就是我得到的:
This is what i get, if i want to start the JBoss:
14:42:53,697 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.postgresql (missing) dependents: [service jboss.data-source.java:jboss/datasources/RESyDS]
14:42:53,725 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
14:42:53,726 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 3800ms - Started 155 of 234 services (2 services failed or missing dependencies, 76 services are passive or on-demand)
这是我的/modules/org/postgresql/main中的module.xml
Here is my module.xml in /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.3-1101.jdbc41.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
standalone.xml数据源部分:
standalone.xml datasources-part:
<datasources>
<datasource jta="true" jndi-name="java:jboss/datasources/RESyDS" pool-name="RESyDS" enabled="true" use-java-context="true">
<connection-url>jdbc:postgresql://192.168.28.123:5432/dgap</connection-url>
<driver>postgresql</driver>
<driver-class>org.postgresql.Driver</driver-class>
<security>
<user-name>resy</user-name>
<password>resy</password>
</security>
</datasource>
<drivers>
<driver name="postgresql" module="org.postgresql">
<driver-class>org.postgresql.Driver</driver-class>
</driver>
</drivers>
</datasources>
persistence.xml
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.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_1_0.xsd">
<persistence-unit name="em">
<jta-data-source>java:jboss/datasources/RESyDS</jta-data-source>
<properties>
<property name="hibernate.archive.autodetection" value="class" />
</properties>
</persistence-unit>
</persistence>
我不知道如何解决问题. 已经尝试部署驱动程序文件,但是它没有任何改变.
I have no Idea, how to solve the problem. Already tried to deploy the driver file, but it doesnt change anything.
我检查了所有文件名,问我的同事,感觉就像在整个互联网上检查此问题一样.没有人知道提示.
I checked all file names, asked my colleagues,im feeling like checked the whole internet for this issue. Nobody knows the hint.
我希望有人可以提供帮助;)
I hope someone can help ;)
欢呼
推荐答案
我遇到了完全相同的问题,这是上面注释中的解决方案:
I had exactly the same problem, here's the solution from the comments above:
-
在
<datasource>
节点中不包括<driver-class>
.那只属于<driver>
声明.这可以解决上述错误
Don't include
<driver-class>
in the<datasource>
node. That belongs to the<driver>
declaration only. This fixes the error described above
请勿在modules/org/postgresql/main/module.xml中使用xmlns="urn:jboss:domain:datasources:1.0"
.这样可以解决在解决拳头问题时出现的另一个错误.
Don't use xmlns="urn:jboss:domain:datasources:1.0"
in modules/org/postgresql/main/module.xml. That fixes another error which appears when the fist issue is fixed.
这篇关于JBoss7 + PostgreSQL新的缺少/不满意的依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!