Error configuring application listener
sjz209
|
1#
sjz209 发表于 2008-01-27 12:45
Error configuring application listener
Tomcat日志文件
2008-01-27 12:13:30 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]] 2008-01-27 12:13:32 StandardContext[/netstore]Error configuring application listener of class tc.listener.AccessListener java.lang.ClassNotFoundException: tc.listener.AccessListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1366) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1213) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3723) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4257) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:832) 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:585) 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:123) 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.DTDConfiguration.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:512) at org.apache.catalina.core.StandardHost.install(StandardHost.java:890) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:523) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468) 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(LifecycleSupport.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:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343) 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(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) 2008-01-27 12:13:32 StandardContext[/jsp-examples]ContextListener: contextInitialized() 2008-01-27 12:13:32 StandardContext[/jsp-examples]SessionListener: contextInitialized() 2008-01-27 12:13:33 StandardContext[/servlets-examples]ContextListener: contextInitialized() 2008-01-27 12:13:33 StandardContext[/servlets-examples]SessionListener: contextInitialized() 这是我的web.xml中的监听 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <servlet> <servlet-name>action </servlet-name> <servlet-class> org.apache.struts.action.ActionServlet </servlet-class> <init-param> <param-name>config </param-name> <param-value>/WEB-INF/struts-config.xml </param-value> </init-param> <load-on-startup>0 </load-on-startup> </servlet> <servlet-mapping> <servlet-name>action </servlet-name> <url-pattern>*.do </url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>/index.jsp </welcome-file> </welcome-file-list> <filter> <filter-name>Set Character Encoding </filter-name> <filter-class>tc.filter.SetCharacterEncodingFilter </filter-class> <init-param> <param-name>encoding </param-name> <param-value>utf-8 </param-value> </init-param> <init-param> <param-name>ignore </param-name> <param-value>true </param-value> </init-param> </filter> <filter-mapping> <filter-name>Set Character Encoding </filter-name> <url-pattern>/* </url-pattern> </filter-mapping> <listener> <listener-class>tc.listener.AccessListener </listener-class> </listener> </web-app> AccessListener.java public class AccessListener implements HttpSessionListener { public void sessionCreated(HttpSessionEvent arg0) { HttpSession session = arg0.getSession(); ServletContext sc = session.getServletContext(); Collection <Book> c = new ArrayList <Book>(); try { Session session1 = HibernateSessionFactory.getSession(); Query query = session1.createQuery("from Book where in (select id from ( select hitnum,id from feiyu_book t order by hitnum desc ) where rownum <7)");//查询点击率前六位的图书 for(Iterator i=query.list().iterator();i.hasNext();) { c.add((Book)i.next()); } } catch(HibernateException e) { e.printStackTrace(); } finally { try { HibernateSessionFactory.closeSession(); } catch(HibernateException e){} } sc.setAttribute("index", c); } public void sessionDestroyed(HttpSessionEvent arg0) { HttpSession session = arg0.getSession(); } 大侠们请帮忙,在线等谢谢了 |