Problems with hibernate log4j



I'm a newbie of hibernate and I have a problem with my first hibernate application. The problem is this:



> log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
Warning: Caught exception attempting to use SAX to load a SAX XMLReader
Warning: Exception was: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
Warning: I will print the stack trace then carry on using the default SAX parser
org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)
at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894)
at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715)
at org.dom4j.io.SAXReader.read(SAXReader.java:435)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2157)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2077)
at util.HibernateUtil.<clinit>(HibernateUtil.java:16)
at events.EventManager.createAndStoreEvent(EventManager.java:44)
at events.EventManager.main(EventManager.java:17)
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.xml.sax.helpers.NewInstance.newInstance(Unknown Source)
... 11 more
Initial SessionFactory creation failed.org.hibernate.HibernateException: Could not parse configuration: hibernate.cfg.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at util.HibernateUtil.<clinit>(HibernateUtil.java:22)
at events.EventManager.createAndStoreEvent(EventManager.java:44)
at events.EventManager.main(EventManager.java:17)
Caused by: org.hibernate.HibernateException: Could not parse configuration: hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2165)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2077)
at util.HibernateUtil.<clinit>(HibernateUtil.java:16)
... 2 more
Caused by: org.dom4j.DocumentException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found Nested exception: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2157)
... 4 more


My main class is:


http://ift.tt/1sQ0tkD


and my log4j.properties is this:


http://ift.tt/1t0UIGh


No comments:

Post a Comment