Skip to main content

Problem with NoClassDefFoundError: org/apache/log4j/Level

6 replies [Last post]
glesiak
Offline
Joined: 2010-05-10
Points: 0

Hi
I am working under NetBeans 6.9.RC2 under Win XP SP2
I try to run simple ejb application using Hibernate JPA as my persistence provider.
Unfortunatelly as I try to create entity manager factory I always get an error:
java.lang.NoClassDefFoundError: org/apache/log4j/Level
and followed from it:
java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.ejb.Ejb3Configuration
I put log4j1.2.16 into libraries folder in netbeans and also other libraries like slf4j, hibernate required libs, jpa and my jdbc driver but it didn't make any difference. Here is my stack trace:
http://pastebin.com/gBneksfq

I give you my project maybe you could find out what I am doing wrong.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sigal Shaharabani

In glassfish v2 it is quite easy to do it, I just added the lib location
to the classpath
I know it's different in v3, but I don't know how to do so

P please consider the environment - do you really need to print this
email?

-----Original Message-----
From: glassfish@javadesktop.org [mailto:glassfish@javadesktop.org]
Sent: Wednesday, June 16, 2010 12:21 PM
To: users@glassfish.dev.java.net
Subject: Re: RE: Problem with NoClassDefFoundError:
org/apache/log4j/Level

it's Glassfish v3 (Java EE 6)
[Message sent by forum member 'glesiak']

http://forums.java.net/jive/thread.jspa?messageID=474456

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

glesiak
Offline
Joined: 2010-05-10
Points: 0

Thank you for a response. I put my log4j into glassfish/domain1/lib and everything is fine now. I also have some other question. I prepared my persistence.xml
http://pastebin.com/XH9vcXU1
which worked fine previously but now shows me an error
http://pastebin.com/UQb8peyx

Have you any idea ?

glesiak
Offline
Joined: 2010-05-10
Points: 0

Nevermind I have answered myself Thanks for your help with this question. It helped me a lot.

Sigal Shaharabani

Which glassfish are you working with?

P please consider the environment - do you really need to print this
email?

-----Original Message-----
From: glassfish@javadesktop.org [mailto:glassfish@javadesktop.org]
Sent: Wednesday, June 16, 2010 9:25 AM
To: users@glassfish.dev.java.net
Subject: Problem with NoClassDefFoundError: org/apache/log4j/Level

Hi
I am working under NetBeans 6.9.RC2 under Win XP SP2
I try to run simple ejb application using Hibernate JPA as my
persistence provider.
Unfortunatelly as I try to create entity manager factory I always get an
error:
java.lang.NoClassDefFoundError: org/apache/log4j/Level
and followed from it:
java.lang.NoClassDefFoundError: Could not initialize class
org.hibernate.ejb.Ejb3Configuration
I put log4j1.2.16 into libraries folder in netbeans and also other
libraries like slf4j, hibernate required libs, jpa and my jdbc driver
but it didn't make any difference. Here is my stack trace:
http://pastebin.com/gBneksfq

I give you my project maybe you could find out what I am doing wrong.
[Message sent by forum member 'glesiak']

http://forums.java.net/jive/thread.jspa?messageID=474430

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

glesiak
Offline
Joined: 2010-05-10
Points: 0

it's Glassfish v3 (Java EE 6)

glesiak
Offline
Joined: 2010-05-10
Points: 0

i have simplified my app and still it throws this exception: http://pastebin.com/CimS0jYp
I have all my libs inside lib folder I use default netbeans hibernate jpa lib and log4j1.2.11