You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by henry human <he...@yahoo.de> on 2011/02/02 10:49:03 UTC

Get the following error: NoClassDefFoundError: org.apache.log4j.Logger

Hi folks
I try my question in this list, maybe you have an idea!I get the following error when I try to call a smal java application(hello friends!) which i placed in a jar file. the application has the log4j.jar in its lib directory (and classpath) and calls the log4j.logger like this:private static final Logger LOGGER = Logger.getLogger(Hello.class);It works when i run the application in eclipsebut not when I pack it as a JAR application! (he application is not running on tomcat an is only a smal commandline application)
Error:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
Thanks for your advice


Re: Get the following error: NoClassDefFoundError: org.apache.log4j.Logger

Posted by Ruwan Linton <ru...@gmail.com>.
Hi Henry,

This is not the right list for your question, this list is about Axis2 (web
services) user issues and discussions.

Anyway, I think it is purely because log4j is not on the classpath. Are you
passing the -classpath argument and giving log4j jar with all the other
dependencies when you run the jar? That is just a hint, please use a proper
java user list.

Thanks,
Ruwan

On Wed, Feb 2, 2011 at 3:19 PM, henry human <he...@yahoo.de> wrote:

> Hi folks*
>
> *
> I try my question in this list, maybe you have an idea!
> I get the following error when I try to call a smal java application(hello
> friends!) which i placed in a jar file. the application has the log4j.jar in
> its lib directory (and classpath) and calls the log4j.logger like this:
> private static final Logger LOGGER = Logger.getLogger(Hello.class);
> It works when i run the application in eclipse
> but not when I pack it as a JAR application! (he application is not running
> on tomcat an is only a smal commandline application)
>
> Error:
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/log4j/Logger
>
> Thanks for your advice
>
>


-- 
Ruwan Linton
Member, Apache Software Foundation; http://www.apache.org
Software Architect & Product Manager, WSO2 Inc.; http://wso2.org

phone: +1 408 754 7388 ext 51789
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton

AW: Get the following error: NoClassDefFoundError: org.apache.log4j.Logger

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
In which directories (plural) did you place log4j.jar?

In which directories did you place log4j.properties?

Can you give us your log4j.properties content?

Josef

 

Von: henry human [mailto:henry_human@yahoo.de] 
Gesendet: Mittwoch, 2. Februar 2011 10:49
An: java-user@axis.apache.org
Betreff: Get the following error: NoClassDefFoundError: org.apache.log4j.Logger

 

Hi folks

I try my question in this list, maybe you have an idea!

I get the following error when I try to call a smal java application(hello friends!) which i placed in a jar file. the application has the log4j.jar in its lib directory (and classpath) and calls the log4j.logger like this:

private static final Logger LOGGER = Logger.getLogger(Hello.class);

It works when i run the application in eclipse

but not when I pack it as a JAR application! (he application is not running on tomcat an is only a smal commandline application)

 

Error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger

 

Thanks for your advice