1
我得到這個例外在運行如提到的EJB,EAR和Web項目名稱的動態Web項目DeploymentException,同時部署遠程EJB
Error installing to Real: name=vfsfile:/C:/jboss-5.0.1.GA_1/jboss-5.0.1.GA/server/default/deploy/BookMartEAR.ear/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: Error deploying BookMartEJB.jar: Container jboss.j2ee:ear=BookMartEAR.ear,jar=BookMartEJB.jar,name=BookMartBean,service=EJB3 failed to resolve persistence unit BookMartEjb
.
.
.
Caused by: java.lang.IllegalArgumentException: Can't find a persistence unit named 'BookMartEjb' in [email protected]{vfsfile:/C:/jboss-5.0.1.GA_1/jboss-5.0.1.GA/server/default/deploy/BookMartEAR.ear/BookMartEJB.jar/}
。
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="BookMartEJB" transaction-type="JTA">
<jta-data-source>MySqlDS</jta-data-source>
<class>com.misys.book.Book</class>
<class>com.misys.book.Sale</class>
<class>com.misys.book.Saleitem</class>
<class>com.misys.book.Customer</class>
<class>com.misys.book.User</class>
</persistence-unit>
</persistence>
是有這個xml文件的任何問題? 我使用的是JBoss AS服務器和MySql數據庫。
請建議,我可以出了問題。此外,請告知是否需要其他信息。
感謝名單4回覆中...雅persistance.xml是EJB module..i它改變成Java :/ MySqlDS ..持久性錯誤消失...但是,我還沒有能夠運行該項目。它引發同樣的異常。 Ne其他建議? – 2011-02-10 04:48:16