Deployment JBoss5上的分解部署失败
我有一个web应用程序,它可以很好地部署为ear文件。但当我尝试以分解形式部署它时,失败如下:Deployment JBoss5上的分解部署失败,deployment,jboss,jboss5.x,ear,exploded,Deployment,Jboss,Jboss5.x,Ear,Exploded,我有一个web应用程序,它可以很好地部署为ear文件。但当我尝试以分解形式部署它时,失败如下: 17:13:17,305 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=app.ear/#app-persistence state=Create java.lang.RuntimeException: could not find relative path: li
17:13:17,305 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=app.ear/#app-persistence state=Create
java.lang.RuntimeException: could not find relative path: lib/persistence-jpa.jar
at org.jboss.jpa.deployment.PersistenceUnitDeployment.getRelativeURL(PersistenceUnitDeployment.java:208)
at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:267)
.
.
.
Caused by: java.lang.RuntimeException: could not find child 'lib/persistence-jpa.jar' on 'FileHandler@4348388[path= context=file:/home/petteri/bin/jboss-5.1.0.GA/server/standard/deploy/ real=file:/home/petteri/bin/jboss-5.1.0.GA/server/standard/deploy/]'
at org.jboss.jpa.deployment.PersistenceUnitDeployment.getRelativeURL(PersistenceUnitDeployment.java:203)
<persistence
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"
version="1.0">
<persistence-unit name="app-persistence">
<jta-data-source>java:/app</jta-data-source>
<jar-file>lib/persistence-jpa.jar</jar-file>
<properties>
... some hibernate stuff ...
</properties>
</persistence-unit>
</persistence>
persistence.xml如下所示:
17:13:17,305 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=app.ear/#app-persistence state=Create
java.lang.RuntimeException: could not find relative path: lib/persistence-jpa.jar
at org.jboss.jpa.deployment.PersistenceUnitDeployment.getRelativeURL(PersistenceUnitDeployment.java:208)
at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:267)
.
.
.
Caused by: java.lang.RuntimeException: could not find child 'lib/persistence-jpa.jar' on 'FileHandler@4348388[path= context=file:/home/petteri/bin/jboss-5.1.0.GA/server/standard/deploy/ real=file:/home/petteri/bin/jboss-5.1.0.GA/server/standard/deploy/]'
at org.jboss.jpa.deployment.PersistenceUnitDeployment.getRelativeURL(PersistenceUnitDeployment.java:203)
<persistence
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"
version="1.0">
<persistence-unit name="app-persistence">
<jta-data-source>java:/app</jta-data-source>
<jar-file>lib/persistence-jpa.jar</jar-file>
<properties>
... some hibernate stuff ...
</properties>
</persistence-unit>
</persistence>
java:/app
lib/persistence-jpa.jar
... 一些冬眠的东西。。。
有什么想法吗?谢谢 您的服务器目录结构是什么。您应该拥有deploy/lib/persistence-jpa.jar/,才能使其正常工作
Caused by: java.lang.RuntimeException: could not find child 'lib/persistence-jpa.jar' on
'FileHandler@4348388[path= context=file:/home/petteri/bin/jboss-5.1.0.GA/server/standard
/deploy/ real=file:/home/petteri/bin/jboss-5.1.0.GA/server/standard/deploy/]'
表示找不到该文件/目录。目录结构应为: 耳朵
-warfile.WAR
-lib
-持久性jpa.jar
-包含persistence.xml的另一个jar文件
-enterpricejavabean.ejb
persistace.xml文件jar元素应该是../lib/persistence jpa.jarHmm,true-我修改了persistence.xml,使其具有app.ear/lib/persistence-jpa.jar,现在它可以工作了。我假设查找将发生在分解的ear目录中。