Servlet service for servlet jsp in context with path /

               
 Servlet.service() for servlet [jsp] in context with path [/] threw exception [Unable to compile class for JSP] with root cause

1.在work目录下找到名为"_"的文件夹里的hello_jsp.java但是没有hello_jsp.class
2.更改了servlet.xml的虚拟路径path名(如day4)后,没有错误了,也生成了hello_jsp.class
3.在上下文路径中抛出异常

解决办法:其实只要在D:\OpenSources\apache-tomcat-7.0.81\conf下的servlet.xml下如下配置
       
        
        不需要再在D:\OpenSources\apache-tomcat-7.0.81\conf\Catalina\localhost下自己设置一个 ".xml"(其实这是另一种部署方法,就是在相应的文件夹下自己设置新的xml文件
        其文件里面可以配置如下 不需要path这样其文件名就是他的上下文路径

九月 14, 2017 1:30:30 下午 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() for servlet [jsp] in context with path [/] threw exception [Unable to compile class for JSP] with root causejava.lang.IllegalArgumentException: Negative time     at java.io.File.setLastModified(File.java:1427)     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:377)     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)     at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:660)     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364)     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)     at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)     at java.lang.Thread.run(Thread.java:748)





           

你可能感兴趣的:(Servlet service for servlet jsp in context with path /)