|
我写了一个监听session的类,编译成class,放在~/myweb/jsp/WEB-INF/classes/里,这里放的bean都是可以找到的。也配置了classpath
- echo $CLASSPATH
- /home/gray/myweb/jsp/WEB-INF/classes/:/opt/blackdown-jdk-1.4.2.01/lib:/opt/blackdown-jdk-1.4.2.01/jre/lib:/opt/blackdown-jdk-1.4.2.01/lib/tools/jar:.
复制代码
在web.xml的<webapp>标签下填写
- <listener>
- <listener-class>SessionControl.userListener</listener-class>
- </listener>
复制代码
但是日志提示找不到类,这是catalina.out
- 严重: Skipped installing application listeners due to previous error(s)
- 2005-4-22 21:28:31 org.apache.catalina.core.StandardContext start
- 严重: Error listenerStart
- 2005-4-22 21:28:31 org.apache.catalina.core.StandardContext start
- 严重: Context startup failed due to previous errors
- 2005-4-22 21:28:31 org.apache.catalina.core.StandardHostDeployer install
- 信息: Installing web application at context path /servlets-examples from URL file:/opt/tomcat5/webapps/servlets-examples
- 2005-4-22 21:28:31 org.apache.catalina.core.StandardContext listenerStart
- 严重: Skipped installing application listeners due to previous error(s)
- 2005-4-22 21:28:31 org.apache.catalina.core.StandardContext start
- 严重: Error listenerStart
- 2005-4-22 21:28:31 org.apache.catalina.core.StandardContext start
- 严重: Context startup failed due to previous errors
- 2005-4-22 21:28:31 org.apache.catalina.core.StandardHostDeployer install
- 信息: Installing web application at context path /jsp-examples from URL file:/opt/tomcat5/webapps/jsp-examples
- 2005-4-22 21:28:32 org.apache.catalina.core.StandardContext listenerStart
- 严重: Skipped installing application listeners due to previous error(s)
- 2005-4-22 21:28:32 org.apache.catalina.core.StandardContext start
- 严重: Error listenerStart
复制代码
这是localhost_admin_log.2005-04-22.txt
- 2005-04-22 21:28:31 StandardContext[/admin]Error configuring application listener of class SessionControl.userListener
- java.lang.ClassNotFoundException: SessionControl.userListener
- at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
- at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
- at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3775)
- at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
- at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
- at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
- at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
- at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
- at java.lang.reflect.Method.invoke(Method.java:324)
- at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252)
- at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
- at org.apache.commons.digester.Rule.end(Rule.java:276)
- at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
- at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)
- at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
- at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
- at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
- at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
- at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
- at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
- at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
- at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
- at org.apache.commons.digester.Digester.parse(Digester.java:1567)
- at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)
- at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
- at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:482)
- at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
- at org.apache.catalina.startup.HostConfig.start(HostConfig.java:968)
- at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
- at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
- at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
- at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
- at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
- at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
- at org.apache.catalina.core.StandardService.start(StandardService.java:480)
- at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
复制代码 |
|