0
package session;

import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import java.util.*;
public class SessionCreate {

private static final SessionFactory sessionFactory = buildSessionFactory1();

private static SessionFactory buildSessionFactory1() {
Configuration configuration = new Configuration().configure(); // configuration
                                                                // settings
                                                                // from
                                                                // hibernate.cfg.xml

StandardServiceRegistryBuilder serviceRegistryBuilder = new StandardServiceRegistryBuilder();


serviceRegistryBuilder.applySettings(configuration.getProperties());

ServiceRegistry serviceRegistry = serviceRegistryBuilder.build();

return configuration.buildSessionFactory(serviceRegistry);
}

public static SessionFactory getSessionFactory() {
return sessionFactory;
 }

public static void shutdown() {
// Close caches and connection pools
getSessionFactory().close();
 }

}

I had JRE8 installed on my computer and I restored it to JRE7 but still i get errors. Please help me with this. This is the only error I am getting: "Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor" error for SessionCreate Class. What kind of constructor should I make? Another error for configuration.Properties() method :"The type java.util.Properties cannot be resolved. It is indirectly referenced from required .class files"

I have searched a lot for the solution.. Thanks.

danrodi
  • 296
  • 1
  • 4
  • 24
Abhijeet
  • 689
  • 2
  • 10
  • 19
  • Try adding `public SessionCreate() { super(); }` or check if you have correctly set up jre path for project.Check this http://stackoverflow.com/questions/1197634/java-error-implicit-super-constructor-is-undefined-for-default-constructor – Rohan Jul 30 '14 at 13:54

1 Answers1

0

If you recently changed JRE versions you may have to clean and recompile your code as your .class files may be incompatible between the 2 versions.

PaulS
  • 21
  • 1
  • 2
  • When I had JRE8 installed then it was giving an error like java.util.Map$Entry cannot be resolved. Now when i go back to JRE7 it is giving me the above 2 errors...! – Abhijeet Jul 30 '14 at 17:34
  • Hey Guys, Really thanks, everything is working great...I had to restart eclipse after restting the Build path once... – Abhijeet Jul 31 '14 at 05:54