I have some questions regarding using log4j with Weblogic Server 5.1.

We've been using log4j successfully for many months to handle logging from
JSPs, servlets, and EJBs.  Up until now we've been using JDK 1.2.2 and all
was well.

Weblogic supports "startup classes" which are invoked during the app server
startup.  We need to support logging from these startup classes so I created
a base class for these startup classes to allow us to initalize log4j (in a
static block).  This ensures that log4j is initialized before we attempt to
log anything and it ensures that we only call
PropertyConfigurator.configure() one time.

Note: We are using a custom-built PatternLayout called MarsPatternLayout.

This works great under JRE 1.2.2, but when I substitute JRE 1.3 I get a
"ClassNotFoundException" from PropertyConfigurator.configure() [See attached
weblogic console output].

Any ideas?  I'm wondering how other people using app-servers handle this
issue of initializing log4j.  Thanks!

Mon Mar 26 12:43:39 PST 2001:<I> <WebLogicServer> Invoking T3StartupDef foo
com.mbasys.mars.foo.Foo with {}
log4j:ERROR Could not instantiate class
[com.mbasys.mars.utility.MarsPatternLayout].
java.lang.ClassNotFoundException: com.mbasys.mars.utility.MarsPatternLayout
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:120)
        at
org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConver
ter.java:194)
        at
org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConverter.ja
va:88)
        at
org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.jav
a:588)
        at
org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.jav
a:555)
        at
org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigur
ator.java:462)
        at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:
388)
        at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:
300)
        at
org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:30
8)
        at com.mbasys.mars.utility.Startup.<clinit>(Startup.java:57)
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Class.java:237)
        at weblogic.t3.srvr.StartupThread.runStartup(StartupThread.java:180)
        at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java:146)
        at
weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java:62)
log4j:ERROR No layout set for appender named "marslog".
Mon Mar 26 12:43:40 PST 2001:<I> <WebLogicServer> T3StartupDef scheduler
com.mbasys.mars.foo.Foo reports: OK
Mon Mar 26 12:43:40 PST 2001:<I> <ListenThread> Listening on port: 7001
Mon Mar 26 12:43:40 PST 2001:<I> <SSLListenThread> Listening on port: 7002
<NT Performance Pack> NATIVE: created IoCompletionPort successfully.
IoPort=0x00000418
Mon Mar 26 12:43:41 PST 2001:<I> <WebLogicServer> WebLogic Server started

------------------------------------------------------------------
John Lindwall                              mailto:[EMAIL PROTECTED]
XIFIN                                      http://www.xifin.com
2233 Faraday Ave Ste A, Carlsbad CA 92008  (760) 804-0770 ext 16

This message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender and destroy all copies of the original
message.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to