aspose file tools*
The moose likes Object Relational Mapping and the fly likes Log4J is forbidden Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Log4J is forbidden" Watch "Log4J is forbidden" New topic
Author

Log4J is forbidden

Rodine Villar
Greenhorn

Joined: Apr 16, 2011
Posts: 6
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.


I believe in God not in religion.
Rodine Villar
Greenhorn

Joined: Apr 16, 2011
Posts: 6
Hi.. I managed to solve it by upgrading my slf4j jar files from to 1.6.1.. thanks anyway.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3859

And Welcome to JavaRanch, Rodine Villar


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Log4J is forbidden