error cannot resolve symbol
807603Dec 18 2007 — edited Dec 19 2007while comiling this program i am getting errors
/*
* Created on Dec 18, 2007
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package src.util;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class HibernateUtil {
private static final SessionFactory sessionFactory;
static {
try {
// Create the SessionFactory from hibernate.cfg.xml
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}
These are the errors
HibernateUtil.java:9: package org.hibernate does not exist
import org.hibernate.SessionFactory;
^
HibernateUtil.java:10: package org.hibernate.cfg does not exist
import org.hibernate.cfg.Configuration;
^
HibernateUtil.java:19: cannot resolve symbol
symbol : class SessionFactory
location: class src.util.HibernateUtil
private static final SessionFactory sessionFactory;
^
HibernateUtil.java:32: cannot resolve symbol
symbol : class SessionFactory
location: class src.util.HibernateUtil
public static SessionFactory getSessionFactory() {
^
HibernateUtil.java:24: cannot resolve symbol
symbol : class Configuration
location: class src.util.HibernateUtil
sessionFactory = new Configuration().configure().buildSessionFactory();
^
5 errors
please help me to resolve this
Edited by: devi16 on Dec 17, 2007 10:40 PM