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 Lydia P <ly...@attglobal.net> on 2003/02/14 20:10:44 UTC

More WSAD5 , log4j , commons-logging problems...

Any help would be greatly appreciated - Im really stuck here and the 
harder I look at it the more lost I become!

Level of WSAD 5 - GA build 20021125_2118
Log4j:  1.2.7
Commons-logging: 1.0.2

Error received:
[2/14/03 13:36:09:907 EST] 66920342 WebGroup      E SRVE0020E: [Servlet 
Error]-[action]: Failed to load servlet: java.lang.NoClassDefFoundError: 
org/apache/log4j/Layout
    at 
org.apache.commons.logging.impl.Log4jFactory.getInstance(Log4jFactory.java:140)
    at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:257)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
    at 
org.apache.struts.action.ActionServlet.<clinit>(ActionServlet.java:375)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:262)
    at java.beans.Beans.instantiate(Beans.java:233)
    at java.beans.Beans.instantiate(Beans.java:77)
    at 
com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
    at 
com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:453)
    at 
com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1233)
    at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:273)
    at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:317)
    at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:194)
    at 
com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:950)
    at 
com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:133)
    at 
com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:360)
    at 
com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:401)
    at 
com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:743)
    at 
com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:337)
    at 
com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:531)
    at 
com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:254)
    at 
com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:232)
    at 
com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:343)
    at 
com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234)
    at 
com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:117)
    at 
com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:343)
    at 
com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234)
    at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:182)
    at com.ibm.ws.runtime.WsServer.start(WsServer.java:135)
    at com.ibm.ws.runtime.WsServer.main(WsServer.java:232)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
    at 
com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:105)








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


Re: More WSAD5 , log4j , commons-logging problems...

Posted by Davor Cengija <da...@mail.inet.hr>.
Lydia P wrote:

> Any help would be greatly appreciated - Im really stuck here and the
> harder I look at it the more lost I become!
> 
> Level of WSAD 5 - GA build 20021125_2118
> Log4j:  1.2.7
> Commons-logging: 1.0.2
> 
> Error received:
> [2/14/03 13:36:09:907 EST] 66920342 WebGroup      E SRVE0020E: [Servlet
> Error]-[action]: Failed to load servlet: java.lang.NoClassDefFoundError:
> org/apache/log4j/Layout
>     at

I never had problems using log4j in WSAD. 

The above message obviously says you don't have log4j.jar in the project's 
classpath. Well, edit the project's classpath and put log4j.jar in it :-) 
Actually, put log4j.jar in Web Content/WEB-INF/lib dir. That should be it. 
Regarding log4j.properties file, I read in your previous post that you have 
that file in WEB-INF/classes. It should go to Java Source and it will 
beautomatically copied to WEB-INF/classes. Actually, the content of 
WEB-INF/classes is deleted whenever you do full build and all the resources 
and classes are copied there on each save or build.

I just created a simple web application from scratch to see what's going on 
in WSAD, and no problems. Simple servlet with only 

// doGet()
Logger log = Logger.getLogger(Log4jTestServlet.class);
log.error("Display something");

and FileAppender in the configuration file. And it works.

Hmm... I read your previuos messages once more. You wrote:


>>My commons-logging.properties file in the /WEB-INF/classes directory :
>># commons logging config - use Log4J

>>org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog 

>>
>>
>>My log4j.properties file in the /WEB-INF/classes directory :
>>
>>#  log4j configuration file
>>#   DEBUG, INFO, WARN, ERROR and FATAL

Do you actually have properties files in Java Source dir?
-- 
davor.cengija@mail.inet.hr


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


Re: More WSAD5 , log4j , commons-logging problems...UPDATE

Posted by Lydia P <ly...@attglobal.net>.
I hated to have to do this, but I uninstalled WSAD5 and reinstalled it , 
renamed my directory for
commons-logging so that it wouldnt be seen by WSAD, removed the 
%WSAD_HOME%/runtimes/lib/ws-commons-logging.jar file and created a brand 
new project with the log4j jar file in the 
%WSAD_HOME%/workspace/ProjectName/Web Content/WEB-INF/lib directory. 
 NOW log4j works like a charm in WSAD version 5.  
I suspect that something got messed up in the migration from WSAD 4.03 
to 5.0 as well as confusion between the
commons-logging directory on my machine vs the one that is already in WSAD.

Lydia P wrote:

> Any help would be greatly appreciated - Im really stuck here and the 
> harder I look at it the more lost I become!
>
> Level of WSAD 5 - GA build 20021125_2118
> Log4j:  1.2.7
> Commons-logging: 1.0.2
>
> Error received:
> [2/14/03 13:36:09:907 EST] 66920342 WebGroup      E SRVE0020E: 
> [Servlet Error]-[action]: Failed to load servlet: 
> java.lang.NoClassDefFoundError: org/apache/log4j/Layout
>    at 
> org.apache.commons.logging.impl.Log4jFactory.getInstance(Log4jFactory.java:140) 
>
>    at 
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:257) 
>
>    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
>    at 
> org.apache.struts.action.ActionServlet.<clinit>(ActionServlet.java:375)
>    at java.lang.Class.newInstance0(Native Method)
>    at java.lang.Class.newInstance(Class.java:262)
>    at java.beans.Beans.instantiate(Beans.java:233)
>    at java.beans.Beans.instantiate(Beans.java:77)
>    at 
> com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224) 
>
>    at 
> com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:453) 
>
>    at 
> com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1233) 
>
>    at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:273)
>    at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:317)
>    at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:194)
>    at 
> com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:950) 
>
>    at 
> com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:133) 
>
>    at 
> com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:360) 
>
>    at 
> com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:401) 
>
>    at 
> com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:743) 
>
>    at 
> com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:337) 
>
>    at 
> com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:531) 
>
>    at 
> com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:254) 
>
>    at 
> com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:232) 
>
>    at 
> com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:343) 
>
>    at 
> com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234)
>    at 
> com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:117) 
>
>    at 
> com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:343) 
>
>    at 
> com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234)
>    at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:182)
>    at com.ibm.ws.runtime.WsServer.start(WsServer.java:135)
>    at com.ibm.ws.runtime.WsServer.main(WsServer.java:232)
>    at java.lang.reflect.Method.invoke(Native Method)
>    at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
>    at 
> com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:105) 
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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: More WSAD5 , log4j , commons-logging problems...

Posted by Lydia P <ly...@attglobal.net>.
Thanks, Ceki, thats something I will look into next.....regarding Davor's email, yes, the
files go into the source directory first and get copied automatically to the classes directory...
Im wondering how much of my problem is the actual migration of this project from WSAD 4.03
to WSAD 5.0, how much is my struts/tiles stuff and how much is commons-logging, log4j.
I will  create a totally new application, and see if I have anymore success with the logging that way...
that will eliminate any configuration difficulties I have with the logging stuff if it works.
Will keep you guys updated, thanks!
Lydia


Ceki Gülcü wrote:

> Have you tried contacting struts or commons-logging mailing lists?
>
> At 14:10 14.02.2003 -0500, you wrote:
> >Any help would be greatly appreciated - Im really stuck here and the
> >harder I look at it the more lost I become!
> >
> >Level of WSAD 5 - GA build 20021125_2118
> >Log4j:  1.2.7
> >Commons-logging: 1.0.2
> >
> >Error received:
> >[2/14/03 13:36:09:907 EST] 66920342 WebGroup      E SRVE0020E: [Servlet
> >Error]-[action]: Failed to load servlet: java.lang.NoClassDefFoundError:
> >org/apache/log4j/Layout
> >    at
> > org.apache.commons.logging.impl.Log4jFactory.getInstance(Log4jFactory.java:140)
> >    at
> > org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:257)
> >    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
> >    at org.apache.struts.action.ActionServlet.<clinit>(ActionServlet.java:375)
> >    at java.lang.Class.newInstance0(Native Method)
> >    at java.lang.Class.newInstance(Class.java:262)
> >    at java.beans.Beans.instantiate(Beans.java:233)
> >    at java.beans.Beans.instantiate(Beans.java:77)
> >    at
> > com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
> >    at
> > com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:453)
> >    at
> > com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1233)
> >    at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:273)
> >    at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:317)
> >    at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:194)
> >    at
> > com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:950)
> >    at
> > com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:133)
> >    at
> > com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:360)
> >    at
> > com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:401)
> >    at
> > com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:743)
> >    at
> > com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:337)
> >    at
> > com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:531)
> >    at
> > com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:254)
> >    at
> > com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:232)
> >    at
> > com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:343)
> >    at
> > com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234)
> >    at
> > com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:117)
> >    at
> > com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:343)
> >    at
> > com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234)
> >    at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:182)
> >    at com.ibm.ws.runtime.WsServer.start(WsServer.java:135)
> >    at com.ibm.ws.runtime.WsServer.main(WsServer.java:232)
> >    at java.lang.reflect.Method.invoke(Native Method)
> >    at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
> >    at
> > com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:105)
> >
> >
> >
> >
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> >
>
> --
> Ceki
>
> ---------------------------------------------------------------------
> 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: More WSAD5 , log4j , commons-logging problems...

Posted by Ceki Gülcü <ce...@qos.ch>.
Have you tried contacting struts or commons-logging mailing lists?

At 14:10 14.02.2003 -0500, you wrote:
>Any help would be greatly appreciated - Im really stuck here and the 
>harder I look at it the more lost I become!
>
>Level of WSAD 5 - GA build 20021125_2118
>Log4j:  1.2.7
>Commons-logging: 1.0.2
>
>Error received:
>[2/14/03 13:36:09:907 EST] 66920342 WebGroup      E SRVE0020E: [Servlet 
>Error]-[action]: Failed to load servlet: java.lang.NoClassDefFoundError: 
>org/apache/log4j/Layout
>    at 
> org.apache.commons.logging.impl.Log4jFactory.getInstance(Log4jFactory.java:140)
>    at 
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:257)
>    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
>    at org.apache.struts.action.ActionServlet.<clinit>(ActionServlet.java:375)
>    at java.lang.Class.newInstance0(Native Method)
>    at java.lang.Class.newInstance(Class.java:262)
>    at java.beans.Beans.instantiate(Beans.java:233)
>    at java.beans.Beans.instantiate(Beans.java:77)
>    at 
> com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
>    at 
> com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:453)
>    at 
> com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1233)
>    at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:273)
>    at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:317)
>    at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:194)
>    at 
> com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:950)
>    at 
> com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:133)
>    at 
> com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:360)
>    at 
> com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:401)
>    at 
> com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:743)
>    at 
> com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:337)
>    at 
> com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:531)
>    at 
> com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:254)
>    at 
> com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:232)
>    at 
> com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:343)
>    at 
> com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234)
>    at 
> com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:117)
>    at 
> com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:343)
>    at 
> com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:234)
>    at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:182)
>    at com.ibm.ws.runtime.WsServer.start(WsServer.java:135)
>    at com.ibm.ws.runtime.WsServer.main(WsServer.java:232)
>    at java.lang.reflect.Method.invoke(Native Method)
>    at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
>    at 
> com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:105)
>
>
>
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>

--
Ceki 


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