首页上一页 1 下一页尾页 8 条记录 1/1页
java项目开发案例全程实录(第2版)——医药管理系统--过滤器引起错误,请帮忙解决,谢谢!!
发表在JavaWeb图书答疑
2014-12-30
是否精华
是
否
版块置顶:
是
否
启动后tomcat 服务器过程中报:
SEVERE: Exception starting filter CharacterEncodingFilter
java.lang.NoClassDefFoundError: Filter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2477)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:880)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1290)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1173)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:550)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:531)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4594)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5201)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1071)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1722)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: Filter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1320)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1173)
... 26 more
十二月 30, 2014 3:34:06 下午 org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter HibernateFilter
java.lang.NoClassDefFoundError: Filter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2477)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:880)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1290)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1173)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:550)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:531)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4594)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5201)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1071)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1722)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: Filter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1320)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1173)
... 26 more
在浏览器输入网址打不开主页:
HTTP Status 404 - /medicinemanager/
type Status report
message /medicinemanager/
description The requested resource is not available.
Apache Tomcat/8.0.12
把web.xml中的两个过滤器注释掉以后可以出现登录界面,但是登楼后出现错误页面,提示信息如下:
HTTP Status 500 - Servlet execution threw an exception
type Exception report
message Servlet execution threw an exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.lang.Error: 无法解析的编译问题:
无法解析导入 javax.servlet.http.HttpServletRequest
无法解析导入 javax.servlet.http.HttpServletResponse
HttpServletRequest 无法解析为类型
HttpServletResponse 无法解析为类型
com.lyq.struts.action.LoginAction.<init>(LoginAction.java:3)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
java.lang.Class.newInstance(Class.java:374)
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:143)
org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:292)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.12 logs.
Apache Tomcat/8.0.12
请帮忙解决,谢谢!!
SEVERE: Exception starting filter CharacterEncodingFilter
java.lang.NoClassDefFoundError: Filter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2477)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:880)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1290)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1173)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:550)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:531)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4594)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5201)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1071)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1722)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: Filter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1320)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1173)
... 26 more
十二月 30, 2014 3:34:06 下午 org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter HibernateFilter
java.lang.NoClassDefFoundError: Filter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2477)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:880)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1290)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1173)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:550)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:531)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4594)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5201)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1071)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1722)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: Filter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1320)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1173)
... 26 more
在浏览器输入网址打不开主页:
HTTP Status 404 - /medicinemanager/
type Status report
message /medicinemanager/
description The requested resource is not available.
Apache Tomcat/8.0.12
把web.xml中的两个过滤器注释掉以后可以出现登录界面,但是登楼后出现错误页面,提示信息如下:
HTTP Status 500 - Servlet execution threw an exception
type Exception report
message Servlet execution threw an exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.lang.Error: 无法解析的编译问题:
无法解析导入 javax.servlet.http.HttpServletRequest
无法解析导入 javax.servlet.http.HttpServletResponse
HttpServletRequest 无法解析为类型
HttpServletResponse 无法解析为类型
com.lyq.struts.action.LoginAction.<init>(LoginAction.java:3)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
java.lang.Class.newInstance(Class.java:374)
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:143)
org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:292)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.12 logs.
Apache Tomcat/8.0.12
请帮忙解决,谢谢!!