RE: tomcat 5.0.16 log4j wierd behaviour
On Thu, 4 Dec 2003, Shapira, Yoav wrote: > Howdy, > > >When I deploy the webapp into /webapps/ then start tomcat, I get the > >error below--not when it loads my webapp--but when it loads the > >tomcat-docs webapp...?? So I copy the commons-logging.jar and > >log4j.jar into /commons/lib/ dir and the problem goes away, but is that > >how things should be done? But I really want to keep my webapps as > >self-contained as possible... Any pointers? > > There was nothing else in your message, i.e. no error. ;) > > Tomcat 5 uses the commons-logging api a lot more than tomcat 4. Tomcat > 5 (and tomcat 4) don't use log4j directly (which I dislike, but that's > another story). > > You shouldn't have to put log4j.jar and commons-logging.jar in > common/lib. You should be able to deploy in a completely self-contained > manner: I have a bunch of applications using log4j deploying fine in > tomcat 5, without adding anything to common/lib, just log4j.jar in > WEB-INF/lib of each application. > > Perhaps your error message will shed more light... > > Yoav Shapira Hi Yoav, Yeah I thought that was the case...but it seems like my webapp and the default ones that came with tomcat don't like each other, in regards to logging. I included the errors below. I'm still having some really wierd log4j errors that I'm not sure if it's coming from tomcat or turbine :( INFO: Installing web application at context path from URL file:E:\Java\Software \jakarta-tomcat-5.0.16\webapps\ROOT Dec 14, 2003 1:45:28 PM org.apache.catalina.core.StandardHostDeployer install INFO: Error installing org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundExc eption: org.apache.commons.logging.impl.Log4jFactory at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:609) at java.security.AccessController.doPrivileged(Native Method) at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561) at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:298) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395) at org.apache.catalina.session.ManagerBase.(ManagerBase.java:107) at org.apache.catalina.session.StandardManager.(StandardManager.ja va:111) at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig .java:350) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:65 5) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfi g.java:254) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl eSupport.java:166) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4 212) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase .java:866) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:85 0) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep loyer.java:316) at org.apache.catalina.core.StandardHost.install(StandardHost.java:859) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j ava:723) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473 ) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java :393) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl eSupport.java:166) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardHost.start(StandardHost.java:816) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518 ) at org.apache.catalina.core.StandardService.start(StandardService.java:5 19) at org.apache.catalina.core.StandardServer.start(StandardServer.java:234 3) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.Log 4jFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:199) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
Re: tomcat 5.0.16 log4j wierd behaviour
Oops, it would help if I included the stack trace :) See below... On Thu, 4 Dec 2003, Daniel wrote: > > Hi everyone, > > I'm trying out the new tomcat 5.0.16 with a simple turbine 2.3 webapp that > uses log4j. > > When I deploy the webapp into /webapps/ then start tomcat, I get the > error below--not when it loads my webapp--but when it loads the > tomcat-docs webapp...?? So I copy the commons-logging.jar and > log4j.jar into /commons/lib/ dir and the problem goes away, but is that > how things should be done? But I really want to keep my webapps as > self-contained as possible... Any pointers? > > Thanks. > Regards, > Daniel ...all fine up to about this point...(notice Turbine app deployed fine, and now tomcat is trying to deploy /tomcat-docs)... Dec 4, 2003 3:50:50 PM org.apache.turbine.Turbine init INFO: Turbine: init() Ready to Rumble! Dec 4, 2003 3:50:50 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /tomcat-docs from URL file:C:\J ava\Software\jakarta-tomcat-5.0.16\webapps\tomcat-docs Dec 4, 2003 3:50:50 PM org.apache.catalina.core.StandardHostDeployer install INFO: Error installing org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundExc eption: org.apache.commons.logging.impl.Log4jFactory at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:609) at java.security.AccessController.doPrivileged(Native Method) at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561) at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:298) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395) at org.apache.catalina.session.ManagerBase.(ManagerBase.java:107) at org.apache.catalina.session.StandardManager.(StandardManager.ja va:111) at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig .java:350) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:65 5) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfi g.java:254) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl eSupport.java:166) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4 212) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase .java:866) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:85 0) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep loyer.java:316) at org.apache.catalina.core.StandardHost.install(StandardHost.java:859) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j ava:723) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473 ) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java :393) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl eSupport.java:166) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133) at org.apache.catalina.core.StandardHost.start(StandardHost.java:816) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518 ) at org.apache.catalina.core.StandardService.start(StandardService.java:5 19) at org.apache.catalina.core.StandardServer.start(StandardServer.java:234 3) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.Log 4jFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:199) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:607) ... 34 more Dec 4, 2003 3
RE: tomcat 5.0.16 log4j wierd behaviour
Howdy, >When I deploy the webapp into /webapps/ then start tomcat, I get the >error below--not when it loads my webapp--but when it loads the >tomcat-docs webapp...?? So I copy the commons-logging.jar and >log4j.jar into /commons/lib/ dir and the problem goes away, but is that >how things should be done? But I really want to keep my webapps as >self-contained as possible... Any pointers? There was nothing else in your message, i.e. no error. ;) Tomcat 5 uses the commons-logging api a lot more than tomcat 4. Tomcat 5 (and tomcat 4) don't use log4j directly (which I dislike, but that's another story). You shouldn't have to put log4j.jar and commons-logging.jar in common/lib. You should be able to deploy in a completely self-contained manner: I have a bunch of applications using log4j deploying fine in tomcat 5, without adding anything to common/lib, just log4j.jar in WEB-INF/lib of each application. Perhaps your error message will shed more light... Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]