java - Error while creating SessionFactory object form hibernate.cfg.xml -


i creating hibernateutil.java class return sessionfactory object. it's giving error "the type java.lang.object cannot resolved. indirectly referenced required .class". code --

import org.hibernate.sessionfactory; import org.hibernate.cfg.configuration;  public class hibernateutil {  private static final sessionfactory sessionfactory = buildsessionfactory(); @suppresswarnings("deprecation") private static sessionfactory buildsessionfactory() {     try {         // create sessionfactory hibernate.cfg.xml         return new configuration().configure().buildsessionfactory();     } catch (throwable ex) {         system.err.println("initial sessionfactory creation failed." + ex);         throw new exceptionininitializererror(ex);     } }  public static sessionfactory getsessionfactory() {     return sessionfactory; } } 

it seems didn't include jre system liberary in build path.

right click on project --> properties --> select java build path --> libraries -->     add library --> jre system library --> next --> workspace default jre --> finish 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -