2

I've got RESTful web services that I deploy in a .war file in JBoss AS 7.1. So far so good. Now I'm adding a .jar file with JPA 2.0 Entities. When I deploy the .war with the .jar file with the JPA Entities included I get this Exception at deploy time:

org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory

This problem is posted numerous times all over the web and there are about half as many suggested solutions but none of them work.

There is no dom4j.jar in my archive. My Hibernate 4.0 dependencies are all <scope>provided</scope>. None of the .jar files included in my .war file have any dom4j classes in them.

Does anyone know what causes this with JBoss 7.1 and what the solution is?

Thanks.

4

1 回答 1

1

dom4j 异常是由于standalone.xml 中的端口号不正确引起的。JBoss 没有抛出有意义的异常,而是抛出了关于 dom4j 的无意义异常。

更正端口号后,我尝试通过取消部署存档、关闭 JBoss 并将端口号设置回不正确的端口号来重现错误。这次我部署并启用存档时,JBoss 显示了一个异常,它无法获得数据源的托管连接。在第一次成功部署具有正确 .

关于这个过程的更长的线程是here

于 2012-08-27T22:06:17.607 回答