2

I'm using Mojarra 2.2 on Tomcat 8 and Eclipse 4.4.1 (Build id: 20140925-1800) without any additional plugins and no Maven.

Everything works fine, but in last few days I have the following problem:

I start Tomcat, can navigate and submit data, etc, everything works correct. Now if I change my Java code, then Tomcat republishes as usual, but if I try to refresh the page in browser via F5, then I get the following error:

HTTP Status 503 - Servlet Faces Servlet is currently unavailable

In Eclipse console the following appears:

Apr 27, 2015 5:18:27 PM org.apache.catalina.core.ApplicationDispatcher invoke
WARNUNG: Servlet Faces Servlet is currently unavailable

Now I have to restart Tomcat after every little change in Java source code in order to solve it.

I don't know since when I have this issue, but I am sure I haven't it before. I changed many things in the project, but I cannot figure out the cause of this problem.

Here's a snippet of my 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" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
    .....
    .....
    <servlet>
            <servlet-name>Faces Servlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>/ps/*</url-pattern>
        </servlet-mapping>

        <context-param>
            <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
            <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
            <param-value>client</param-value>
        </context-param>
        <context-param>
            <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
            <param-value>resources.application</param-value>
        </context-param>
        <context-param>
            <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
            <param-value>.xhtml</param-value>
        </context-param>
        <context-param>
            <param-name>facelets.DEVELOPMENT</param-name>
            <param-value>true</param-value>
        </context-param>
        <context-param>
            <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
            <param-value>0</param-value>
        </context-param>

        <context-param>
            <param-name>javax.faces.PROJECT_STAGE</param-name>
            <param-value>Development</param-value>
        </context-param>
        <context-param>
            <param-name>javax.faces.CONFIG_FILES</param-name>
            <param-value>/WEB-INF/faces-config.xml,/WEB-INF/navigations.xml</param-value>
        </context-param>
    ....
    <listener>
            <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
        </listener>

    ....
    <security-constraint>
            <display-name>Restrict XHTML Documents</display-name>
            <web-resource-collection>
                <web-resource-name>XHTML</web-resource-name>
                <url-pattern>*.xhtml</url-pattern>
            </web-resource-collection>
        </security-constraint>
    <session-config>
            <session-timeout>60</session-timeout>
            <tracking-mode>COOKIE</tracking-mode>
        </session-config>

        <error-page>
            <exception-type>javax.faces.application.ViewExpiredException</exception-type>
            <location>/index.jsp</location>
        </error-page>
        <locale-encoding-mapping-list>
            <locale-encoding-mapping>
                <locale>de</locale>
                <encoding>UTF-8</encoding>
            </locale-encoding-mapping>
        </locale-encoding-mapping-list>
</web-app>

How is this caused and how can I solve it?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Rami.Q
  • 2,486
  • 2
  • 19
  • 30
  • 1
    This is a problem in tooling, not in JSF. You'd better tell which tooling you're using (IDE, plugins, etc) – BalusC Apr 27 '15 at 15:53
  • I figured you're using Eclipse. Now yet the version, plugins and the server config. – BalusC Apr 27 '15 at 15:59
  • @BalusC, thx, i updated the Question with Tooling Infos – Rami.Q Apr 27 '15 at 16:01
  • OK. There are for sure no recent plugins/updates in Eclipse? Now we can concentrate on Tomcat. Do you see any stack traces in Tomcat log? You can look in Eclipse console, but you'd depending on exact Tomcat server configuration better also check logfiles in Tomcat installation folder. By the way, those Eclipse-generated `localizationContext` and `ConfigureListener` entries in `web.xml` are unnecessary. I don't think they're causing the problem, but you'd better just remove them to reduce noise. – BalusC Apr 27 '15 at 16:07
  • @BalusC, thank you for your help. after trying manythings in Tomcat and Eclipse Configurations/Logging/Cleaning...etc with no luck, i just downloaded new Eclipse, new Tomcat & new Mojarra, then imported my old Project and every thing works just fine. no Idea what causes the Problem. – Rami.Q Apr 27 '15 at 21:27

0 Answers0