Tuesday, 15 September 2015

eclipse - Hibernate error while compiling -


I am attempting to include Hibernate v4 in my dynamic web project in Eclipse I am using Maven for Dependency I have written all the code and have created unit sections and mapping XML files but on the building project I get this error

  This project was not created because its build path is incomplete Javax Class F for .name Il eluded. Fix the build path, try creating this project. MyProject  

I wrote the hibernate youth class as:

  import org.hibernate. SessionFactory; Import org.hibernate.boot.registry.StandardServiceRegistryBuilder; Import org.hibernate.cfg.configuration; Import org.hibernate.service.ServiceRegistry; Public Class Hibernate Youths {Private Status Session Session. Factory = buildSessionFactory (); Private Static Session Facial Fabrication (FACT) {try (sessionFactory == empty) {configuration configuration = new configuration (). Configure (Hibernate Utility Class.getResource ("/ hibernate.cfg.xml")); StandardServiceRegistryBuilder Service RegistryBuilder = New StandardServiceRegistryBuilder (); ServiceRegistryBuilder.applySettings (Configuration .getProperties ()); ServiceRegistration ServiceResearch = ServiceRajistBiller Builder (); SessionFactory = Configuration .buildSessionFactory (serviceRegistry); } Return session; } Catch (Throttle Pre) {System.err.println ("Initial Session. Factoring Failure." + East); New ExceptionInInitializerError (ex) Throw; }} Public stable session - Factory getSessionFactory () {Return Session Factory; } Public static void close () {getSessionFactory () Close (); }}  

EDIT: I get this error on the GetSessionFactory method call in the shutdown method. Anyone know what the problem might be?

It is not available on the class build path as it says, you have to fix the build path. Do this by giving a package that is javax.naming.Referenceable.

What makes me feel strange is to rewrite the hibernate unit? There is probably nothing that you want to do here. And I'm not getting any explanation why you write your own.

I recommend forgetting the hibernate uplit class and starting the hibernate framework completely.


No comments:

Post a Comment