IntelliJ Java IDE
The moose likes Object Relational Mapping and the fly likes NoInitialContextException Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "NoInitialContextException" Watch "NoInitialContextException" New topic
Author

NoInitialContextException

Hamzah khammash
Greenhorn

Joined: Jan 05, 2012
Posts: 15

Hi ,
i have face a strange thing , i created a JPA project with hibernate annotations implementation ,when i run the application it give me this error


and then get the data i want so what is happened here ?

here is the persistence.xml which is inside src/META-INF folder :



and Hibernate.cfg.xml :

I faced this problem before it caused by persistence not correctly named and didn't give any output but now is strange for me .
Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 46
I get this exception every time and never search for it as my programs are all working correctly despite this error.
Hamzah khammash
Greenhorn

Joined: Jan 05, 2012
Posts: 15

Alex Armenteros wrote:I get this exception every time and never search for it as my programs are all working correctly despite this error.

I solve it man , it happened because i give an name for <session-factory> and this wrong so just removed my name attribute and it works , i hope it work with you to.
 
 
subject: NoInitialContextException
 
Threads others viewed
JPA: Unable to configure EntityManagerFactory
HibernateException: Hibernate Dialect must be explicitly set
JPA not working with EJB3
I'm trying to build a JPA application , but i am getting an error NoClassFound
Problem in config. JPA in JBOSS
developer file tools