6 Replies Latest reply on Feb 28, 2013 1:58 AM by nickarls

    Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: File "/" not found

    coral123

      when I visit the html page,I got the following exception :

       

      21:10:58,328 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-

      host].[/].[jsp]] (http--0.0.0.0-8080-5) Servlet.service() for servlet jsp threw

      exception: org.apache.jasper.JasperException: File "/" not found

              at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorH

      andler.java:51) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.j

      ava:409) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.j

      ava:116) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.JspUtil.getInputStream(JspUtil.java:826) [

      jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.xmlparser.XMLEncodingDetector.getEncoding(XMLEncodi

      ngDetector.java:108) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.ParserController.determineSyntaxAndEncodin

      g(ParserController.java:348) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.ParserController.doParse(ParserController.

      java:207) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.ParserController.parse(ParserController.ja

      va:136) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java

      :296) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.Parser.addInclude(Parser.java:351) [jbossw

      eb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.Parser.parse(Parser.java:124) [jbossweb-7.

      0.13.Final.jar:]

              at org.apache.jasper.compiler.ParserController.doParse(ParserController.

      java:255) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.ParserController.parseDirectives(ParserCon

      troller.java:120) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189) [

      jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.Compiler.compile(Compiler.java:360) [jboss

      web-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340) [jboss

      web-7.0.13.Final.jar:]

              at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327) [jboss

      web-7.0.13.Final.jar:]

              at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext

      .java:607) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper

      .java:312) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3

      26) [jbossweb-7.0.13.Final.jar:]

              at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [jb

      ossweb-7.0.13.Final.jar:]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-s

      ervlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

      icationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

      ilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at com.zfibs.web.Filter.ServerFilter.doFilter(ServerFilter.java:57) [cla

      sses:]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

      icationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

      ilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at com.zfibs.web.Filter.EncodingFilter.doFilter(EncodingFilter.java:32)

      [classes:]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

      icationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

      ilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV

      alve.java:275) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV

      alve.java:161) [jbossweb-7.0.13.Final.jar:]

              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(Secu

      rityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

       

       

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j

      ava:155) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j

      ava:102) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal

      ve.java:109) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav

      a:368) [jbossweb-7.0.13.Final.jar:]

              at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcesso

      r.java:897) [jbossweb-7.0.13.Final.jar:]

              at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.pr

      ocess(Http11AprProtocol.java:626) [jbossweb-7.0.13.Final.jar:]

              at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:20

      39) [jbossweb-7.0.13.Final.jar:]

              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_23]

        • 1. Re: Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: File "/" not found
          nickarls

          Any deployment errors? Are you accessing the context root and have a welcome-file in web.xml?

          • 2. Re: Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: File "/" not found
            jaikiran

            Also, what exactly does the jsp look like?

            • 3. Re: Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: File "/" not found
              coral123

              Yes,I have a welcome-file in web.xml.

              I was able to access the jsp page, shtml, but can not access static html page.Why?

              • 4. Re: Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: File "/" not found
                nickarls

                can you show a jar -tf of the war and your web.xml?

                • 5. Re: Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: File "/" not found
                  coral123

                  web.xml

                  <?xml version="1.0" encoding="UTF-8"?>

                  <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                            xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                            xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                            version="2.5">

                            <display-name>Test</display-name>

                            <description>Test description</description>

                   

                            <!-- spring config -->

                            <context-param>

                                      <param-name>contextConfigLocation</param-name>

                                      <param-value>

                                classpath:configure/spring/applicationContext-setting.xml

                                      </param-value>

                            </context-param>

                            <listener>

                                      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

                            </listener>

                            <!-- jboss server config -->

                            <context-param>

                                      <param-name>contextClass</param-name>

                                      <param-value>org.jboss.spring.vfs.context.VFSXmlWebApplicationContext</param-value>

                            </context-param>

                   

                            <filter>

                                      <filter-name>encode</filter-name>

                                      <filter-class>com.zfibs.web.Filter.EncodingFilter</filter-class>

                                      <init-param>

                                                <param-name>encoding</param-name>

                                                <param-value>UTF-8</param-value>

                                      </init-param>

                            </filter>

                            <filter-mapping>

                                      <filter-name>encode</filter-name>

                                      <url-pattern>/*</url-pattern>

                            </filter-mapping>

                   

                      <jsp-config>

                                      <jsp-property-group>

                                                <description>Special property group for html Configuration JSP example.</description>

                                                <display-name>JSPConfiguration</display-name>

                                                <url-pattern>*.html</url-pattern>

                                                <el-ignored>true</el-ignored>

                                                <page-encoding>UTF-8</page-encoding>

                                                <scripting-invalid>false</scripting-invalid>

                                                <include-prelude></include-prelude>

                                                <include-coda></include-coda>

                                      </jsp-property-group>

                            </jsp-config>

                            <!-- welcome-file  -->

                            <welcome-file-list>

                                      <welcome-file>login.jsp</welcome-file>

                            </welcome-file-list>

                   

                            <error-page>

                                      <error-code>404</error-code>

                                      <location>/error404.jsp</location>

                            </error-page>

                            <error-page>

                                      <error-code>500</error-code>

                                      <location>/error500.jsp</location>

                            </error-page>  

                   

                              <session-config>

                                        <session-timeout>120</session-timeout>

                              </session-config>           

                   

                   

                  </web-app>

                   

                   

                  jar -tf

                  a.jpg2.jpg3.jpg

                  • 6. Re: Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: File "/" not found
                    nickarls

                    It might have something to do with

                     

                    <url-pattern>*.html</url-pattern> in the jsp-config?