tomcat can't start projectname/index.jsp

I have the exact same problem as but Run JSF project on Apache Tomcat solution provided by BalusC somehow doesn't work for me. Problem started after i added jar's for file upload tomahawk-1.1.10.jar, commons-fileupload-1.2.2.jar, commons-io-1.4.jar, commons-logging-1.1.1.jar, commons-el.jar and set filter in web.xml. Tried to delete jar's and get project back in state it was before adding but still doesn't work. Any ideas ?

I'm using JSF 1.2 and web.xml is

<?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"
id="WebApp_ID" version="2.5">
<display-name>iProJournal</display-name>
<welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<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>/faces/*</url-pattern>
</servlet-mapping>
    <filter>
    <filter-name>extensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
    <init-param>
        <description>Set the size limit for uploaded files.
        Format: 10 - 10 bytes
        10k - 10 KB
        10m - 10 MB
        1g - 1 GB
    </description>
        <param-name>uploadMaxFileSize</param-name>
        <param-value>100m</param-value>
    </init-param>
    <init-param>
        <description>Set the threshold size - files below this 
         limit are stored in memory, files above this limit 
         are stored on disk.
                     Format: 10 - 10 bytes
                     10k - 10 KB
                     10m - 10 MB
                     1g - 1 GB
     </description>
        <param-name>uploadThresholdSize</param-name>
        <param-value>100k</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
</filter-mapping>
</web-app>

I managed to get my project back in state it was before adding these files and it started to work but I'm not shore what was causing the problem. This is the web.xml that I'm using now

<?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"
id="WebApp_ID" version="2.5">
<display-name>iProJournal</display-name>
<welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<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>/faces/*</url-pattern>
</servlet-mapping>
</web-app>

Answers


The extensions filter should not be mapped on *.jsp files. It should only be mapped on JSF requests. I suggest to use a different mapping though, in such a way that you don't need to worry about URLs of the servlet you'd actually to filter. Remove the both filter mappings and use this one instead:

<filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>

Now it will be invoked whenever the FacesServlet is invoked.

If that still doesn't work (also not after you placed Tomahawk libs in the /WEB-INF/lib), then you'd need to read the server startup logs.


Need Your Help

Updating an object on realm

ios realm

I want to update an object with realm. But my app is crashing.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.