File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Log4J is forbidden" Watch "Log4J is forbidden" New topic

Log4J is forbidden

Rodine Villar

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,
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(
at java.lang.ClassLoader.loadClass(
Caused: java.lang.NoClassDefFoundError: org/apache/log4j/Level
at org.slf4j.LoggerFactory.getSingleton(
at org.slf4j.LoggerFactory.bind(
at org.slf4j.LoggerFactory.performInitialization(
at org.slf4j.LoggerFactory.getILoggerFactory(
at org.slf4j.LoggerFactory.getLogger(
at org.slf4j.LoggerFactory.getLogger(
at org.hibernate.validator.ClassValidator.<clinit>(
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(
at org.hibernate.cfg.Configuration.buildSessionFactory(
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(
at org.netbeans.modules.hibernate.hqleditor.HQLEditorController.getHibernateSessionFactoryForThisContext(
at org.netbeans.modules.hibernate.hqleditor.HQLEditorController.processAndConstructSessionFactory(
[catch] at org.netbeans.modules.hibernate.hqleditor.HQLEditorController$

* 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

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

Joined: Mar 24, 2008
Posts: 3902

And Welcome to JavaRanch, Rodine Villar

[How to ask questions] [Twitter]
I agree. Here's the link:
subject: Log4J is forbidden
jQuery in Action, 3rd edition