You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Jerry Cattell <je...@yahoo.com> on 2003/06/14 12:25:50 UTC

Problems with log4j and WebLogic

I am trying to get log4j working with a very simple
session bean in weblogic 7.0.  The bean works fine if
I comment out all of the logging code.  If I leave the
logging code in I get this exception:

java.lang.NoClassDefFoundError:
org/apache/log4j/Category
at java.lang.Class.getMethods0(Native Method)
at java.lang.Class.getMethods(Class.java:737)
at
weblogic.ejb20.ejbc.EJBCompiler.computeCRC(EJBCompiler.java:626)
at
weblogic.ejb20.ejbc.EJBCompiler.makeFileHash(EJBCompiler.java:539)
at
weblogic.ejb20.ejbc.EJBCompiler.setupEJB(EJBCompiler.java:160)
at
weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:332)
at
weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:489)
at
weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:819)
at
weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1268)
at
weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:232)
at
weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:1570)
at
weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:737)
at
weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:555)
at
weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1062)
at
weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:730)
at
weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
--------------- nested within: ------------------
weblogic.management.ManagementException: 149233 - with
nested exception:
[java.lang.NoClassDefFoundError:
org/apache/log4j/Category]
at
weblogic.management.deploy.slave.SlaveDeployer.convertThrowable(SlaveDeployer.java:834)
at
weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1180)
at
weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:730)
at
weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)



Here is all of the pertinent information I can think
of:

The manifest for the EJB JAR:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.3
Created-By: 1.3.1_07-b02 (Sun Microsystems Inc.)
Built-By: Jerry Cattell
Built-On: 2003-06-14T06:13:20
Class-Path: log4j-1.2.8.jar

The files in the EAR:
META-INF/MANIFEST.MF
test-ejb.jar
log4j-1.2.8.jar
log4j.properties
META-INF/application.xml

The files in the JAR:
META-INF/MANIFEST.MF
test/ejb/NetworkServerBean.class
test/ejb/NetworkServerSession.class
test/interfaces/NetworkServerLocal.class
test/interfaces/NetworkServerLocalHome.class
test/interfaces/NetworkServerRemote.class
test/interfaces/NetworkServerRemoteHome.class
test/util/NetworkServerUtil.class
META-INF/ejb-jar.xml
META-INF/weblogic-ejb-jar.xml

If someone can see what I'm doing wrong, I would
greatly appreciate it.

Thanks,
Jerry

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Problems with log4j and WebLogic

Posted by Jerry Cattell <je...@yahoo.com>.
Well, I've resolved the immediate problem by adding
the WL_HOME/common/lib/log4j to the PRE_CLASSPATH in
the WebLogic startup script and removing it from the
manifest.

It seems the problem is a more general classpath issue
with WebLogic. I tried using a simple call to
StringUtils in commons-lang and adding it to the
manifest, but I had the same issue finding that class.

If anyone does have any experience with this problem,
I'd love to hear from you, but as it doesn't pertain
to log4j try not to reply to the list.

Thanks,
Jerry

--- Jerry Cattell <je...@yahoo.com> wrote:
> I considered that, but it doesn't seem to be the
> problem.  Weblogic has a log4j.jar in the common/lib
> directory, so I thought it might be using that one
> instead.  I replaced it with the jar I am using
> (renaming it to log4j.jar just in case they are
> using
> the exact name).  Then I removed my jar from the EAR
> and the classpath from the JAR's manifest file. 
> Still
> getting the exact same error.  It seems like it
> really
> can't find it anywhere in the classpath, I just
> don't
> know why.
> 
> Thanks,
> Jerry
>  
> --- Jacob Kjome <ho...@visi.com> wrote:
> > 
> > NoClassDefFoundError means that you probably have
> > conflicting versions of 
> > Log4j in your classpath.  Try to set it up where
> you
> > only have one copy of 
> > log4j.jar in your classpath and see if that fixes
> > things.
> > 
> > Jake
> > 
> > At 03:25 AM 6/14/2003 -0700, you wrote:
> > >I am trying to get log4j working with a very
> simple
> > >session bean in weblogic 7.0.  The bean works
> fine
> > if
> > >I comment out all of the logging code.  If I
> leave
> > the
> > >logging code in I get this exception:
> > >
> > >java.lang.NoClassDefFoundError:
> > >org/apache/log4j/Category
> > >at java.lang.Class.getMethods0(Native Method)
> > >at java.lang.Class.getMethods(Class.java:737)
> > >at
> >
>
>weblogic.ejb20.ejbc.EJBCompiler.computeCRC(EJBCompiler.java:626)
> > >at
> >
>
>weblogic.ejb20.ejbc.EJBCompiler.makeFileHash(EJBCompiler.java:539)
> > >at
> >
>
>weblogic.ejb20.ejbc.EJBCompiler.setupEJB(EJBCompiler.java:160)
> > >at
> >
>
>weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:332)
> > >at
> >
>
>weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:489)
> > >at
> >
>
>weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:819)
> > >at
> >
>
>weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1268)
> > >at
> >
>
>weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:232)
> > >at
> >
>
>weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:1570)
> > >at
> >
>
>weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:737)
> > >at
> >
>
>weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:555)
> > >at
> >
>
>weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1062)
> > >at
> >
>
>weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:730)
> > >at
> >
>
>weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
> > >at
> >
>
>weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
> > >at
> >
>
>weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
> > >--------------- nested within: ------------------
> > >weblogic.management.ManagementException: 149233 -
> > with
> > >nested exception:
> > >[java.lang.NoClassDefFoundError:
> > >org/apache/log4j/Category]
> > >at
> >
>
>weblogic.management.deploy.slave.SlaveDeployer.convertThrowable(SlaveDeployer.java:834)
> > >at
> >
>
>weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1180)
> > >at
> >
>
>weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:730)
> > >at
> >
>
>weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
> > >at
> >
>
>weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
> > >at
> >
>
>weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
> > >
> > >
> > >
> > >Here is all of the pertinent information I can
> > think
> > >of:
> > >
> > >The manifest for the EJB JAR:
> > >Manifest-Version: 1.0
> > >Ant-Version: Apache Ant 1.5.3
> > >Created-By: 1.3.1_07-b02 (Sun Microsystems Inc.)
> > >Built-By: Jerry Cattell
> > >Built-On: 2003-06-14T06:13:20
> > >Class-Path: log4j-1.2.8.jar
> > >
> > >The files in the EAR:
> > >META-INF/MANIFEST.MF
> > >test-ejb.jar
> > >log4j-1.2.8.jar
> > >log4j.properties
> > >META-INF/application.xml
> > >
> > >The files in the JAR:
> > >META-INF/MANIFEST.MF
> > >test/ejb/NetworkServerBean.class
> > >test/ejb/NetworkServerSession.class
> > >test/interfaces/NetworkServerLocal.class
> > >test/interfaces/NetworkServerLocalHome.class
> > >test/interfaces/NetworkServerRemote.class
> > >test/interfaces/NetworkServerRemoteHome.class
> > >test/util/NetworkServerUtil.class
> > >META-INF/ejb-jar.xml
> > >META-INF/weblogic-ejb-jar.xml
> > >
> > >If someone can see what I'm doing wrong, I would
> > >greatly appreciate it.
> > >
> > >Thanks,
> > >Jerry
> > >
> >
>
>---------------------------------------------------------------------
> > >To unsubscribe, e-mail:
> > log4j-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail:
> > log4j-user-help@jakarta.apache.org
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> log4j-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Problems with log4j and WebLogic

Posted by Jerry Cattell <je...@yahoo.com>.
I considered that, but it doesn't seem to be the
problem.  Weblogic has a log4j.jar in the common/lib
directory, so I thought it might be using that one
instead.  I replaced it with the jar I am using
(renaming it to log4j.jar just in case they are using
the exact name).  Then I removed my jar from the EAR
and the classpath from the JAR's manifest file.  Still
getting the exact same error.  It seems like it really
can't find it anywhere in the classpath, I just don't
know why.

Thanks,
Jerry
 
--- Jacob Kjome <ho...@visi.com> wrote:
> 
> NoClassDefFoundError means that you probably have
> conflicting versions of 
> Log4j in your classpath.  Try to set it up where you
> only have one copy of 
> log4j.jar in your classpath and see if that fixes
> things.
> 
> Jake
> 
> At 03:25 AM 6/14/2003 -0700, you wrote:
> >I am trying to get log4j working with a very simple
> >session bean in weblogic 7.0.  The bean works fine
> if
> >I comment out all of the logging code.  If I leave
> the
> >logging code in I get this exception:
> >
> >java.lang.NoClassDefFoundError:
> >org/apache/log4j/Category
> >at java.lang.Class.getMethods0(Native Method)
> >at java.lang.Class.getMethods(Class.java:737)
> >at
>
>weblogic.ejb20.ejbc.EJBCompiler.computeCRC(EJBCompiler.java:626)
> >at
>
>weblogic.ejb20.ejbc.EJBCompiler.makeFileHash(EJBCompiler.java:539)
> >at
>
>weblogic.ejb20.ejbc.EJBCompiler.setupEJB(EJBCompiler.java:160)
> >at
>
>weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:332)
> >at
>
>weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:489)
> >at
>
>weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:819)
> >at
>
>weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1268)
> >at
>
>weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:232)
> >at
>
>weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:1570)
> >at
>
>weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:737)
> >at
>
>weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:555)
> >at
>
>weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1062)
> >at
>
>weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:730)
> >at
>
>weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
> >at
>
>weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
> >at
>
>weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
> >--------------- nested within: ------------------
> >weblogic.management.ManagementException: 149233 -
> with
> >nested exception:
> >[java.lang.NoClassDefFoundError:
> >org/apache/log4j/Category]
> >at
>
>weblogic.management.deploy.slave.SlaveDeployer.convertThrowable(SlaveDeployer.java:834)
> >at
>
>weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1180)
> >at
>
>weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:730)
> >at
>
>weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
> >at
>
>weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
> >at
>
>weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
> >
> >
> >
> >Here is all of the pertinent information I can
> think
> >of:
> >
> >The manifest for the EJB JAR:
> >Manifest-Version: 1.0
> >Ant-Version: Apache Ant 1.5.3
> >Created-By: 1.3.1_07-b02 (Sun Microsystems Inc.)
> >Built-By: Jerry Cattell
> >Built-On: 2003-06-14T06:13:20
> >Class-Path: log4j-1.2.8.jar
> >
> >The files in the EAR:
> >META-INF/MANIFEST.MF
> >test-ejb.jar
> >log4j-1.2.8.jar
> >log4j.properties
> >META-INF/application.xml
> >
> >The files in the JAR:
> >META-INF/MANIFEST.MF
> >test/ejb/NetworkServerBean.class
> >test/ejb/NetworkServerSession.class
> >test/interfaces/NetworkServerLocal.class
> >test/interfaces/NetworkServerLocalHome.class
> >test/interfaces/NetworkServerRemote.class
> >test/interfaces/NetworkServerRemoteHome.class
> >test/util/NetworkServerUtil.class
> >META-INF/ejb-jar.xml
> >META-INF/weblogic-ejb-jar.xml
> >
> >If someone can see what I'm doing wrong, I would
> >greatly appreciate it.
> >
> >Thanks,
> >Jerry
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> log4j-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail:
> log4j-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Problems with log4j and WebLogic

Posted by Jacob Kjome <ho...@visi.com>.
NoClassDefFoundError means that you probably have conflicting versions of 
Log4j in your classpath.  Try to set it up where you only have one copy of 
log4j.jar in your classpath and see if that fixes things.

Jake

At 03:25 AM 6/14/2003 -0700, you wrote:
>I am trying to get log4j working with a very simple
>session bean in weblogic 7.0.  The bean works fine if
>I comment out all of the logging code.  If I leave the
>logging code in I get this exception:
>
>java.lang.NoClassDefFoundError:
>org/apache/log4j/Category
>at java.lang.Class.getMethods0(Native Method)
>at java.lang.Class.getMethods(Class.java:737)
>at
>weblogic.ejb20.ejbc.EJBCompiler.computeCRC(EJBCompiler.java:626)
>at
>weblogic.ejb20.ejbc.EJBCompiler.makeFileHash(EJBCompiler.java:539)
>at
>weblogic.ejb20.ejbc.EJBCompiler.setupEJB(EJBCompiler.java:160)
>at
>weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:332)
>at
>weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:489)
>at
>weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:819)
>at
>weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1268)
>at
>weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:232)
>at
>weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:1570)
>at
>weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:737)
>at
>weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:555)
>at
>weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1062)
>at
>weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:730)
>at
>weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
>at
>weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
>at
>weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
>--------------- nested within: ------------------
>weblogic.management.ManagementException: 149233 - with
>nested exception:
>[java.lang.NoClassDefFoundError:
>org/apache/log4j/Category]
>at
>weblogic.management.deploy.slave.SlaveDeployer.convertThrowable(SlaveDeployer.java:834)
>at
>weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:1180)
>at
>weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:730)
>at
>weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
>at
>weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
>at
>weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
>
>
>
>Here is all of the pertinent information I can think
>of:
>
>The manifest for the EJB JAR:
>Manifest-Version: 1.0
>Ant-Version: Apache Ant 1.5.3
>Created-By: 1.3.1_07-b02 (Sun Microsystems Inc.)
>Built-By: Jerry Cattell
>Built-On: 2003-06-14T06:13:20
>Class-Path: log4j-1.2.8.jar
>
>The files in the EAR:
>META-INF/MANIFEST.MF
>test-ejb.jar
>log4j-1.2.8.jar
>log4j.properties
>META-INF/application.xml
>
>The files in the JAR:
>META-INF/MANIFEST.MF
>test/ejb/NetworkServerBean.class
>test/ejb/NetworkServerSession.class
>test/interfaces/NetworkServerLocal.class
>test/interfaces/NetworkServerLocalHome.class
>test/interfaces/NetworkServerRemote.class
>test/interfaces/NetworkServerRemoteHome.class
>test/util/NetworkServerUtil.class
>META-INF/ejb-jar.xml
>META-INF/weblogic-ejb-jar.xml
>
>If someone can see what I'm doing wrong, I would
>greatly appreciate it.
>
>Thanks,
>Jerry
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org