java - No Persistence provider found -
i getting following error when using jboss 4.2.3 ga , configured ms-sql.ds file. created entity bean ejb3 , trying access entity bean ejb 2.1 session bean. first of all, wanted check if possible. because when use entitymanager
or entitymanagerfactory
, entitymanager
comming null. instead if use entitymanagerfactory
, gives error saying:
javax.persistence.persistenceexception: no persistence provider entitymanager named ejbcomponentpu
below class
public class testbean implements sessionbean { //pass persistence unit entitymanager. @persistencecontext(unitname="ejbcomponentpu") private entitymanager entitymanager;
my project folder structure is:
src
- has packages. inside have meta-inf
folder has persistence.xml
file
thanks help.
this persistence.xml file.
<?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="ejbcomponentpu" transaction-type="jta"> <provider>org.hibernate.ejb.hibernatepersistence</provider> <jta-data-source>java:/testds</jta-data-source> <exclude-unlisted-classes>false</exclude-unlisted-classes> </persistence-unit>
Comments
Post a Comment