Forums Register Login

createEntityManagerFactory null

+Pie Number of slices to send: Send
Hi all,

I have a problem with my jpa project.

here is the persistence file:
----------------------------------------------------------------------------
<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="QuotePickerPU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.quotepicker.beans.QuoteBean</class>
<class>com.quotepicker.beans.CompanyBean</class>
<class>com.quotepicker.beans.QuoteBeanId</class>
<properties>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/trainning" />
<property name="hibernate.connection.username" value="root"/>
</properties>
</persistence-unit>
----------------------------------------------------------------------------

i get null when calling this

emf = Persistence.createEntityManagerFactory("QuotePickerPU");




any ideas ??

Thanks in advance

--------------------
+Pie Number of slices to send: Send
emf = Persistence.createEntityManagerFactory("QuotePickerPU");

should always be called when outside the EJB container.

Can you let us know, are you calling it inside EJB container.
+Pie Number of slices to send: Send
Hi Amandeep

How you say this

should always be called when outside the EJB container.



I went through the spec, But I couldn't find such restriction. That is true that we use this method for em creation outside container. But I think there is no restriction to use it in side the container
[ December 02, 2008: Message edited by: Chaminda Amarasinghe ]
+Pie Number of slices to send: Send
Hi Tarik,
Please let us know if your application is a stand alone application or deployed in a managed environment.
[ December 02, 2008: Message edited by: Amol Nayak ]
+Pie Number of slices to send: Send
 

here is the persistence file


Where did you put persistence.xml ?
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1065 times.
Similar Threads
Problem with Mapping between 1 bit column and boolean field
Hibernate: Error getting property 'lastItem'
createEntityManagerFactory is null
JPA: Can't find Persistence Provider
Could not resolve a persistence unit corresponding to the persistence-context-ref-name
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 08:43:27.