logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Ortiz <chrono.d...@gmail.com>
Subject Error while Logger.getLogger(Mylcass.class) [java.lang.NoClassDefFoundError]
Date Fri, 17 Jul 2009 21:43:39 GMT
Hi , I'm having a problem while trying to deploy a ear [witch only contains
a EJB ] in weblogic 10.01 AKA 10mp1 ,

java.lang.NoClassDefFoundError

      at org.apache.log4j.Logger.getLogger(Logger.java:104)

      at MyClass.<clinit>(MyClass.java:62)

      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:494)

      at java.lang.Class.newInstance0(Class.java:354)

      at java.lang.Class.newInstance(Class.java:307)

      at
weblogic.ejb.container.manager.BaseEJBManager.createNewBeanInstance(BaseEJBManager.java:222)

      ...

A little more info



MyClass.java:62 = private static Logger log =
Logger.getLogger(MyClass.class);

I also have try

MyClass.java:62 = private static Logger log = Logger.getRootLogger();



Both with the same result.



My Log4j properties are simple

#==================================================================

#std-out Logger Configuration

#==================================================================

log4j.appender.std-out=org.apache.log4j.ConsoleAppender

log4j.appender.std-out.target=System.out

log4j.appender.std-out.layout=org.apache.log4j.PatternLayout

log4j.appender.std-out.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS}
[%t] %-5p %c %x - %m\n

log4j.rootCategory=${root.log}, std-out



Also have Try Hard Code Properties , but having the same error.



static {

      PatternLayout out=new PatternLayout("%d{dd MMM yyyy HH:mm:ss,SSS} [%t]
%-5p %c %x - %m\n");

      ConsoleAppender appender=new ConsoleAppender(out);

      appender.setTarget(ConsoleAppender.SYSTEM_OUT);

      Logger.getRootLogger().addAppender(appender);



}



I'm aware of a "bug" of Weblogic 9.2 to 10.02 that weblogic adds first his
jars instead the web-inf\lib jars I have added this xml's to the
weblogic-application.xml

      <wls:prefer-application-packages>

            <wls:package-name>org.apache.log4j.*</wls:package-name>

      </wls:prefer-application-packages>



Please note a add the weblogic-application.xml in ejb META-INF folder , as
well in the EAR META-INF folder

That doesn't resolve my problem has you can imagine already



I'm using log4j 1.2.15 and log4j extras both download from maven repository



I'll really appreciate some sort of guide since this problem is really
annoying me



Regards

Carlos Ortiz



PS. If you need more info , please ask I will facilitate as much as I can

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message