java ee - DeploymentException while deploying the remote EJB -
i getting exception while running dynamic web project
error installing 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 resolve persistence unit bookmartejb . . . caused by: java.lang.illegalargumentexception: can't find persistence unit named 'bookmartejb' in abstractvfsdeploymentcontext@26167457{vfsfile:/c:/jboss-5.0.1.ga_1/jboss-5.0.1.ga/server/default/deploy/bookmartear.ear/bookmartejb.jar/}
the ejb, ear , web project names mentioned.
the persistence.xml looks this:
<?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>
is there problem xml file? using jboss server, , mysql database.
kindly suggest have gone wrong. also, tell if other information required.
what's location of persistence.xml
in ear? should inside meta-inf folder of ejb module. if it's not there (e.g. it's in ear root or in web module), indeed can not found.
also, if persistence unit going found might run next problem. data source set mysqlds
, should java:/mysqlds
that's location jboss bind data sources to.
further unrelated question, don't have list classes explicitly. unless don't want run-time scanning occur have include <exclude-unlisted-classes/>
element. (oh, , 1 last thing jta default leave out transaction-type="jta")
Comments
Post a Comment