I have An EJB3 Entity Persistence project in NetBeans, using GlassFish .
I have in Continer configured JDBC pool and JDBC connection via MS.SQLServer
.
I have META-INF/persistence.xml file like this:
<persistence xmlns="
http://java.sun.com/xml/ns/persistence">
<persistence-unit name ="myEntityManager">
<description>Sample Customer Database</description>
<jta-data-source>jdbc/DataSourse</jta-data-source>
<class>avr.Author</class>
<class>avr.Book</class>
</persistence-unit>
</persistence>
But when I deploy this project is throws Exception :
[#|2006-01-12T10:28:35.043+0300|INFO|sun-appserver-pe9.0|javax.enterprise.sys
tem.core.classloading|_ThreadID=12;_ThreadName=httpWorkerThread-4848-3;jdbc/D
ataSourse;|JTADSName = jdbc/DataSourse|#]
[#|2006-01-12T10:28:35.059+0300|INFO|sun-appserver-pe9.0|javax.enterprise.sys
tem.core.classloading|_ThreadID=12;_ThreadName=httpWorkerThread-4848-3;jdbc/D
ataSourse;|nonJTADSName = jdbc/DataSourse|#]
[#|2006-01-12T10:28:35.059+0300|INFO|sun-appserver-pe9.0|javax.enterprise.sys
tem.core.classloading|_ThreadID=12;_ThreadName=httpWorkerThread-4848-3;|Persi
stenceInfo for this pud is :
<persistence-unit>
<PURoot>file:/E:/NetBeansProject/EnterpriseApplication2/EnterpriseApplication
2-war/build/web/WEB-INF/classes/</PURoot>
<name>myEntityManager</name>
<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</pr
ovider>
<transaction-type>JTA</transaction-type>
<jta-data-source>com.sun.gjc.spi.DataSource_at_14a4067</jta-data-source>
<non-jta-data-source>com.sun.gjc.spi.DataSource_at_1ca623f</non-jta-data-source>
<class-name>avr.Author</class-name>
<class-name>avr.Book</class-name>
<properties>{}</properties>
<class-loader>InstrumentableWebappClassLoader
Parent -> WebappClassLoader
delegate: true
repositories:
/WEB-INF/classes/
It uses oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider , but
I need MSSql Server's EntityManagerFactoryProvider.
When I run client wthis this part of this code throws excetion
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("myEntityManager");
// create EntityManager
EntityManager em = emf.createEntityManager();
Exception:
javax.persistence.PersistenceException: No Persistence provider for
EntityManager named myEntityManager
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:67)
Now I have queshen: How I can make correct persistence.xml file to complile
project correctly and Persistence.createEntityManagerFactory find this
myEntityManager.
If can you, help me!
Tamri!
CONFIDENTIAL
This message contains confidential information and is intended only for persistence_at_glassfish.dev.java.net. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.