处理Servlet.service() for servlet [jsp] in context with path [/ssh_test02] threw exception [java.

今天问题出现很奇怪的问题,报错Servlet.service() for servlet [jsp] in context with path [/ssh_test02] threw 


exception [java.lang.ClassNotFoundException: org.apache.jsp.Register_jsp] with root cause

java.lang.ClassNotFoundException: org.apache.jsp.Register_jsp

,为什么奇怪呢,因为我就引入了一个jar,启动,访问后报错了,我将jar包弄出去,再启动错误一直还在,奇怪!!上网查了很久资料没有找到解决方式,没办法自己捣鼓捣鼓,终于被我解决了,我解决的方式很简单

首先这个错误是我在前端输入url(http://localhost:8080/ssh_test02/Register.jsp)地址后,访问web项目,控制台报出来的错误,这肯定是struts这块出问题了,后面接着看是因为Register.jsp文件,我就将这个文件重新剪切出来,在放进去,重新启动服务,错误解决,希望可以帮助到你。


严重: Servlet.service() for servlet [jsp] in context with path [] threw exception

08-31

严重: Servlet.service() for servlet [jsp] in context with path [] threw exception [java.lang.NoClassDefFoundError: javax/el/ELResolver] with root causernjava.lang.ClassNotFoundException: javax.el.ELResolverrn at java.net.URLClassLoader$1.run(URLClassLoader.java:366)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:355)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:354)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:423)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:356)rn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:791)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)rn at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)rn at java.net.URLClassLoader.access$100(URLClassLoader.java:71)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:361)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:355)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:354)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:423)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:410)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:410)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:356)rn at java.lang.Class.forName0(Native Method)rn at java.lang.Class.forName(Class.java:186)rn at javax.el.CompositeELResolver.(CompositeELResolver.java:30)rn at org.apache.jasper.el.ELContextImpl.(ELContextImpl.java:79)rn at org.apache.jasper.compiler.Validator$ValidateVisitor.prepareExpression(Validator.java:1571)rn at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:747)rn at org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:954)rn at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)rn at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)rn at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)rn at org.apache.jasper.compiler.Node$Root.accept(Node.java:475)rn at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)rn at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1798)rn at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)rn at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)rn at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)rn at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnrn启动Tomcat后,访问http://localhost:8080,就出现这个错误,网上百度了很多方法都不管用,求大神指点

Servlet.service() for servlet jsp threw exception

12-18

严重: Servlet.service() for servlet jsp threw exceptionrnjava.io.IOException: Stream closedrn at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:203)rn at org.apache.jasper.runtime.JspWriterImpl.clearBuffer(JspWriterImpl.java:159)rn at org.apache.jsp.web.Page_005fContent_jsp._jspService(Page_005fContent_jsp.java:74)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)rn at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)rn at java.lang.Thread.run(Unknown Source)

严重: Servlet.service() for servlet [spring] in context with path [] threw

08-04

严重: Servlet.service() for servlet [spring] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: com.dayainfo.ssp.model.UserInfo cannot be cast to com.dayainfo.ssp.model.NoveltyEntrust] with root causernjava.lang.ClassCastException: com.dayainfo.ssp.model.UserInfo cannot be cast to com.dayainfo.ssp.model.NoveltyEntrustrn at com.dayainfo.common.util.SessionUtil.getConsultUserInfo(SessionUtil.java:36)rn at com.dayainfo.ssp.user.controller.UserController.toPersonUserController(UserController.java:64)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)rn at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)rn at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)rn at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:619)rn求大神帮我看看这个错误具体怎么改。

Servlet.service() for servlet [appServlet] in context with path [/kylmp-p] threw

08-29

错误问题如下,请大神指教rnrn严重: Servlet.service() for servlet [appServlet] in context with path [/kylmp-p] threw exception [An exception occurred processing JSP page /WEB-INF/views/student-answer-sheet.jsp at line 7rnrn4: String path = request.getContextPath();rn5: String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";rn6: String servletPath = (String) request.getAttribute("javax.servlet.forward.servlky_path");rn7: String[] list = servletPath.split("\\/");rn8: request.setAttribute("role", list[1]);rn9: request.setAttribute("topMenuId", list[2]);rn10: request.setAttribute("leftMenuId", list[3]);rnrnrnStacktrace:] with root causernjava.lang.NullPointerExceptionrn at org.apache.jsp.WEB_002dINF.views.student_002danswer_002dsheet_jsp._jspService(student_002danswer_002dsheet_jsp.java:97)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)rn at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108)rn at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:64)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:65)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)rn at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:166)rn at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)rn at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:729)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)rn at org.aparnche.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:319)rn at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:168)rn at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)rn at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1228)rn at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1011)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)rn at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)rn at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)rn at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)rn at org.springframework.security.web.FilrnterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)rn at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)rn at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)rn at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)rn at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)rn at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn rn rn

严重: Servlet.service() for servlet [jsp] in context with path [/mybbs] threw exce

06-09

3: <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>rn4: <%rn5: PageBean pb = (PageBean)request.getAttribute("pb");rn6: List userinfo = (List)pb.getData();rn7: %>rn8: rn9: rn这是 servlet rnint currpage = request.getParameter("page")==null?1:Integer.parseInt(request.getParameter("page"));rn System.out.println("page");rn int pagesize = Integer.parseInt(this.getServletConfig().getInitParameter("pagesize"));rn UserService us=new UserService();rn PageBean pb = us.findAllUserByPage(pagesize, currpage);rn request.setAttribute("pb", pb);rn System.out.println(pb);rn request.getRequestDispatcher("manageruser.jsp").forward(request, response);rn这是service里的方法 rnpublic int getUserCount()rn String sql = "select count(*) from user_info";rn DBHelper dh = new DBHelper();rn ResultSet rs = dh.execQuery(sql);rn try rn if(rs.next())rn int n = rs.getInt(1);rn rs.close();rn dh.closeAll();rn return n;rn rn catch (SQLException e) rn e.printStackTrace();rn rn return -1;rn rn public PageBean findAllUserByPage(int pagesize,int currpage)rn PageBean pb = new PageBean();rn pb.setCurrpage(currpage);rn pb.setPagesize(pagesize);rn pb.setRowcount(getUserCount());rn pb.setPagecount(pb.getPagecount()); rn String sql = "select * from user_info order by user_id asc limit "+pagesize*(currpage-1)+","+pagesize;rn DBHelper dh = new DBHelper();rn ResultSet rs = dh.execQuery(sql);rn List userinfo = new ArrayList();rn try rn while(rs.next())rn Userinfo user = new Userinfo();rn user.setUser_id(rs.getInt(1));rn user.setUsername(rs.getString(2));rn user.setUsersex(rs.getString(3));rn user.setBirthdate(rs.getString(4));rn user.setPhoto(rs.getString(5));rn user.setEmail(rs.getString(6));rn user.setNickname(rs.getString(7));rn user.setTruename(rs.getString(8));rn userinfo.add(user); rn rn pb.setData(userinfo);rn return pb;rn catch (SQLException e) rn e.printStackTrace();rn rn return null;rn rnrnPB为什么会为null啊

[[jsp]] Servlet.service() for servlet jsp threw exception

07-08

JBOSSS服务器启动后无法访问JSP页面,请问有人遇到过吗rnrnrn10:59:54,984 ERROR [[jsp]] Servlet.service() for servlet jsp threw exceptionrnjavax.servlet.ServletException: OncePerRequestFilter just supports HTTP requestsrn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:62)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)rn at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)rn at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)rn at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rn

严重: Servlet.service() for servlet [jsp] in context with path [/qq] threw excepti

06-27

16: 博主信息rn17: rn18: rn19: 博主姓名:<%=((MasterBean)session.getAttribute("master")).getMasterName() %>rn20: rn21: rn22: rnrnrnStacktrace:] with root causernjava.lang.NullPointerExceptionrn at org.apache.jsp.front.article.ArticleIndex_jsp._jspService(ArticleIndex_jsp.java:155)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Unknown Source)

严重: Servlet.service() for servlet jsp threw exception java.lang.IllegalStateEx

11-18

2009-11-18 14:44:34 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet jsp threw exceptionrnjava.lang.IllegalStateException: No Java compiler availablern at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationrnContext.java:225)rn at org.apache.jasper.JspCompilationContext.compile(JspCompilationContextrn.java:560)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapperrn.java:302)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3rn29)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplrnicationFilterChain.java:269)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFrnilterChain.java:188)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVrnalve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVrnalve.java:174)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticarntorBase.java:433)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jrnava:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jrnava:117)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValrnve.java:108)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.javrna:151)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.javarn:874)rn at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.prnrocessConnection(Http11BaseProtocol.java:665)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpornint.java:528)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFolrnlowerWorkerThread.java:81)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPrnool.java:689)rn at java.lang.Thread.run(Thread.java:620)

请教:: Servlet.service() for servlet jsp threw exception java.lang.NullPointerExce

08-15

刚我启动浏览器的时候,提示错误:rn严重: Servlet.service() for servlet jsp threw exceptionrnjava.lang.NullPointerExceptionrn at org.apache.jsp.index_jsp._jspService(index_jsp.java:105)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Unknown Source)rn当我把这段代码删了,页面可以正常显示,但是我不知道这段代码哪里出错了,请各位指教rn[code=java] rn <%rn String info;rn String dt;rn String user;rnrn List> messageList = JDBCOption.query(SQLConstant.getmessage);rn for (int i = 0; i < messageList.size(); i++) rn HashMap hm = messageList.get(i);rn user = hm.get("author").toString();rn info = hm.get("info").toString();rn dt = hm.get("published").toString();rn %>rn rn <%=user %>rn <%=info %>rn <%=dt %>rn rnrn <%rn rn %>rn rn [/code]rn源代码如下rn[code=text]<%@ page language="java" contentType="text/html; charset=UTF-8"rn pageEncoding="UTF-8"%>rn<%@ page import="java.util.List"%>rn<%@ page import="java.util.HashMap"%>rn<%@page import="com.dedo.BBS.Jdbc.SQLConstant"%>rn<%@page import="com.dedo.BBS.Jdbc.JDBCOption"%>rnrnrnrnrnrnrn rn Untitled Documentrn rn rnrnrnrn rn rn rn rn 所有 /正向 / 反向/rn rn 公告区rn //这里有错******rn <%rn String info;rn String dt;rn String user;rnrn List> messageList = JDBCOption.query(SQLConstant.getmessage);rn for (int i = 0; i < messageList.size(); i++) rn HashMap hm = messageList.get(i);rn user = hm.get("author").toString();rn info = hm.get("info").toString();rn dt = hm.get("published").toString();rn %>rn rn <%=user %>rn <%=info %>rn <%=dt %>rn rnrn <%rn rn %>rn rn rn rn rn rn rn rn 输入发布内容rn rn rn rn rn rn 小白rn rn rn rn rn rn rnrnrn[/code]rn[code=java]package com.dedo.BBS.Servlet;rnrnimport java.io.IOException;rnimport java.io.PrintWriter;rnimport java.sql.Timestamp;rnrnimport javax.servlet.ServletException;rnimport javax.servlet.http.HttpServlet;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnimport com.dedo.BBS.Jdbc.JDBCOption;rnimport com.dedo.BBS.Jdbc.SQLConstant;rnimport com.dedo.BBS.Tool.Common;rnrnrnrn/**rn * Servlet implementation class SubMessagern */rnpublic class SubMessage extends HttpServlet rn private static final long serialVersionUID = 1L;rn rn /**rn * @see HttpServlet#HttpServlet()rn */rn public SubMessage() rn super();rn // TODO Auto-generated constructor stubrn rnrn /**rn * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)rn */rn protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException rn processRequest(request, response);rn rnrn /**rn * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)rn */rn protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException rn processRequest(request, response);rn rn rn protected void processRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOExceptionrn rn String message = request.getParameter("message");rn java.util.Date d = new java.util.Date();rn JDBCOption.update(SQLConstant.addmessage, 1,message,new Timestamp(d.getTime()));rn response.sendRedirect("index.jsp");rn rnrnrn[/code]rn[code=java]package com.dedo.BBS.Jdbc;rnrnimport java.sql.Connection;rnimport java.sql.DriverManager;rnimport java.sql.PreparedStatement;rnimport java.sql.ResultSet;rnimport java.sql.ResultSetMetaData;rnimport java.sql.SQLException;rnimport java.sql.Statement;rnimport java.util.ArrayList;rnimport java.util.HashMap;rnimport java.util.List;rnimport java.util.Map;rnrnimport com.dedo.BBS.Tool.Common;rnrnpublic class JDBCOption rn private static DBConfig dbconfig = null;rnrn static //连接数据库rn dbconfig = new DBConfig();rn try rn Class.forName(dbconfig.getDriver());rn catch (ClassNotFoundException e) rn e.printStackTrace();rn rn rn /*rn * 查询操作rn */rn public static List query(String sql, Object... paramters) rn List returnValue = new ArrayList();rn ResultSet rs = null;rn Connection conn = null;rn PreparedStatement ps = null;rnrn try rn conn = DriverManager.getConnection(dbconfig.getUrl(), dbconfig.getUsername(), dbconfig.getPassword());rn ps = conn.prepareStatement(sql);rn for (int i = 0; i < paramters.length; i++) rn ps.setObject(i + 1, paramters[i]);rn rn rn rs = ps.executeQuery();rn rn while (rs.next()) rn ResultSetMetaData md = rs.getMetaData();rn Map map = new HashMap();rn rn for (int i = 0; i < md.getColumnCount(); i++) rn map.put(md.getColumnLabel(i + 1), rs.getObject(i + 1));rn rn returnValue.add(map);rn rnrn catch (SQLException e) rn e.printStackTrace();rn finallyrn Common.free(conn, ps, rs);rn rnrn return returnValue;rn rn rn rn rnrn[/code]

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试