0

i try to build simple crud app using java hibernate 3.6, but i've got a problem, when try to run, it was error, like this:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Inisialisasi sessionFactory failed org.hibernate.InvalidMappingException: Unable to read XML
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError

any suggestion please? thanks's,

public class HibernateUtil {

private static final SessionFactory sessionFactory;
private static final orangDao orangDao;

static {
    try {
        sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
        orangDao = new orangDaoImpl(sessionFactory);
    } catch (Throwable e) {
        System.err.println("Inisialisasi sessionFactory gagal "+e);
        throw new ExceptionInInitializerError(e);
    }
}

public static orangDao getPersonDao() {
    return orangDao;
}

public static SessionFactory getSessionFactory() {
    return sessionFactory;
}
 }
sgtoka
  • 21
  • 4
  • 1
    Please provide the relevant code and xml, as well as the full stacktrace. Otherwise, we won't be able to help you. – forgivenson Aug 18 '14 at 14:12
  • which code and xml? mapping class or another class? sorry i am new in hibernate – sgtoka Aug 18 '14 at 14:16
  • First, the stacktrace should have some reference to a line and file in your code. Use that to guide you toward the relevant code. Second, the xml I asked for is the xml mentioned in the error, the xml that it can't read. – forgivenson Aug 18 '14 at 14:18
  • 1
    Check this out http://www.slf4j.org/manual.html – Al1en313 Aug 18 '14 at 14:32
  • i just added my hibernate util class – sgtoka Aug 18 '14 at 14:40
  • Please provide the project structure and the .hbn.xml file so we ca see where the .xml file is located. Also check this question http://stackoverflow.com/questions/5574285/mapping-problem-with-hibernate – bogdan.rusu Mar 29 '15 at 17:56

0 Answers0