Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4J is forbidden

 
Rodine Villar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello... I am new to Hibernate OR Mapping in Netbeans 6.9
I have a database that has a lot of tables and foreign keys
I managed to create a hibernate.cfg.xml file and enabled the HQL editor
I also managed to create the reverse engineering file and eventually made
the POJO classes along with their corresponding hbm.xml mapping files

(Supposing my table is named "User")
Now I am trying to make a simple "from User" query in the HQL editor in the context menu of the hibernate.cfg.xml file and I get a pop-up message saying:

A java.lang.NoClassDefFoundError exception has occurred.
Please report this at http://www.netbeans.org/community/issues.html,
including a copy of your messages.log file as an attachment.
The messages.log file is located in your /home/Dine/.netbeans/6.9/var/log folder.


And when I navigated to /home/Dine/.netbeans/6.9/var/log folder this is the error:

SEVERE [org.openide.util.Exceptions]
java.lang.ClassNotFoundException: Log4J is forbidden
at org.netbeans.modules.hibernate.util.CustomClassLoader.loadClass(CustomClassLoader.java:126)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Caused: java.lang.NoClassDefFoundError: org/apache/log4j/Level
at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:120)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
at org.hibernate.validator.ClassValidator.<clinit>(ClassValidator.java:53)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:378)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at org.netbeans.modules.hibernate.hqleditor.HQLEditorController.getHibernateSessionFactoryForThisContext(HQLEditorController.java:234)
at org.netbeans.modules.hibernate.hqleditor.HQLEditorController.processAndConstructSessionFactory(HQLEditorController.java:325)
[catch] at org.netbeans.modules.hibernate.hqleditor.HQLEditorController$1.run(HQLEditorController.java:123)


* I do not understand the error and I have searched google countless times already because I need my POJOs up and running as soon as possible.
* Im not sure but im using FEDORA 14 (Laughlin) as my OS and it usually has some file permissions to some files/folder when reading/writing/executing
* But I am not sure what file/folder to grant permissions to.
* Please help me solve this issue, or just say something that may shed some light.

 
Rodine Villar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.. I managed to solve it by upgrading my slf4j jar files from to 1.6.1.. thanks anyway.
 
Vijitha Kumara
Bartender
Pie
Posts: 3918
10
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And Welcome to JavaRanch, Rodine Villar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic