HTTP 500 javax.servlet.ServletException: file not found

1.9k views Asked by At

I'm developping a J2EE application that works fine when run from eclipse, but when I deploy it on tomcat I get the following exception, I don't understand what's wrong cause I need to refresh several times until the page is displayed

(eclipse returns empty file when trying to export war, so I deploy by copying all the files in WebContent in tomcat/webapps/my project, and I copy classes in my WEB-INF)

Etat HTTP 500 - javax.servlet.ServletException: Le fichier "/menu_dashboard_top.jsp" n'a pas été trouvé

javax.servlet.ServletException: Le fichier "/menu_dashboard_top.jsp" n'a pas été trouvé
org.apache.jasper.servlet.JspServlet.handleMissingResource(JspServlet.java:418)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:398)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:934)
org.apache.jsp.impotg50_jsp._jspService(impotg50_jsp.java:173)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:431)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)

menu_dashboard_top.jsp is in WebContent, it's not a servlet just a jsp page that contains the menu that I include in all my web pages

I have mapped all my servlets in web.xml. Here is my web.xml file

 <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  <display-name>e-declaration</display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>register</servlet-name>
    <servlet-class>servlet.register</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>register</servlet-name>
    <url-pattern>/register</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>login</servlet-name>
    <servlet-class>servlet.login</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>login</servlet-name>
    <url-pattern>/login</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>logout</servlet-name>
    <servlet-class>servlet.logout</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>logout</servlet-name>
    <url-pattern>/logout</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>profil</servlet-name>
    <servlet-class>servlet.profil</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>profil</servlet-name>
    <url-pattern>/profil</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>impotg50</servlet-name>
    <servlet-class>servlet.impotg50</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>impotg50</servlet-name>
    <url-pattern>/impotg50</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>aimpotg50</servlet-name>
    <servlet-class>servlet.aimpotg50</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>aimpotg50</servlet-name>
    <url-pattern>/aimpotg50</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>declaration</servlet-name>
    <servlet-class>servlet.declaration</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>declaration</servlet-name>
    <url-pattern>/declaration</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>dashboard</servlet-name>
    <servlet-class>servlet.dashboard</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>dashboard</servlet-name>
    <url-pattern>/dashboard</url-pattern>
  </servlet-mapping>
  <filter>
    <filter-name>Set Character Encoding</filter-name>
    <filter-class>org.apache.catalina.filters.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>false</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>
1

There are 1 answers

0
sugar On

Fixed it by reinstalling tomcat from scratch