JSF - Web.xml file not found in Web Context - eclipse

I am having trouble getting my web.xml to recognize a welcome/login file.
The following lines produce something along the lines of "references to 'filename' that does not exist in web content"
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/login.html</form-error-page>
</form-login-config>
Both login.html and index.xhtml exist in ProjectRoot/WebContent
What allows Eclipse, and I assume JSF, to recognize a file in the WebContent folder?
Here is the full web.xml:
<?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>MyApp</display-name>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>bluesky</param-value>
</context-param>
<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>*.xhtml</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>120</session-timeout>
</session-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>All</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>MyLDAP</realm-name>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/login.html</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>*</role-name>
</security-role>
</web-app>

Related

how to deploy war file on weblogic 12c

few days ago my boss told to deploy our project war file on weblogic12c and I did it but weblogic gave me this two error and I don't what should I do :
all I see is about these error and next key stop
this is my xml file
<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="3.0" id="WebApp_ID" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<display-name>JournalDev-PrimefacesWebApplication</display-name>
-<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>*.xhtml</url-pattern>
</servlet-mapping>
-<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
-<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>ultima-#{guestPreferences.theme}</param-value>
</context-param>
-<context-param>
<param-name>primefaces.FONT_AWESOME</param-name>
<param-value>true</param-value>
</context-param>
-<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/primefaces-ultima.taglib.xml</param-value>
</context-param>
-<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>
-<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
-<context-param>
<param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
<param-value>false</param-value>
</context-param>
-<context-param>
<param-name>org.apache.myfaces.CONFIG_REFRESH_PERIOD</param-name>
<param-value>0</param-value>
</context-param>
-<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>ApplicationResources</param-value>
</context-param>
-<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-beans.xml,/WEB-INF/faces-navigations.xml</param-value>
</context-param>
-<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/config/applicationContext-*.xml,**/applicationContext-*.xml </param-value>
</context-param>
-<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.fallbackLocale</param-name>
<param-value>en</param-value>
</context-param>
-<context-param>
<param-name>datasource</param-name>
<param-value>news_DS</param-value>
</context-param>
-<welcome-file-list>
<welcome-file>user/body.xhtml</welcome-file>
</welcome-file-list>
-<session-config>
<session-timeout>30</session-timeout>
</session-config>
-<filter>
<filter-name>requestContextFilter</filter-name>
<filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
</filter>
-<filter-mapping>
<filter-name>requestContextFilter</filter-name>
<url-pattern>*.xhtml</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
-<filter-mapping>
<filter-name>requestContextFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
-<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
-<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
-<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
-<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
-<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.xhtml</url-pattern>
</filter-mapping>
-<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
-<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.xhtml</url-pattern>
</filter-mapping>
-<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
-<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
</filter-mapping>
-<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.xhtml</url-pattern>
</filter-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>*.xhtml</url-pattern>
</filter-mapping>
-<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
</filter-mapping>
-<filter>
<filter-name>AccessFilter</filter-name>
<filter-class>org.nspl.access.AccessFilter</filter-class>
</filter>
-<filter-mapping>
<filter-name>AccessFilter</filter-name>
<url-pattern>/user/*</url-pattern>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
-<filter-mapping>
<filter-name>AccessFilter</filter-name>
<url-pattern>/admin/*</url-pattern>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
-<servlet>
<servlet-name>picServlet</servlet-name>
<servlet-class>org.nspl.access.PicServlet</servlet-class>
</servlet>
-<servlet-mapping>
<servlet-name>picServlet</servlet-name>
<url-pattern>/picServlet</url-pattern>
</servlet-mapping>
-<servlet>
<servlet-name>Select</servlet-name>
<servlet-class>org.nspl.access.Select</servlet-class>
</servlet>
-<servlet-mapping>
<servlet-name>Select</servlet-name>
<url-pattern>/Select</url-pattern>
</servlet-mapping>
-<servlet>
<servlet-name>Index</servlet-name>
<servlet-class>org.nspl.access.Index</servlet-class>
</servlet>
-<servlet-mapping>
<servlet-name>Index</servlet-name>
<url-pattern>/Index</url-pattern>
</servlet-mapping>
-<servlet>
<servlet-name>AttachmentServlet</servlet-name>
<servlet-class>org.nspl.access.AttachmentServlet</servlet-class>
</servlet>
-<servlet-mapping>
<servlet-name>AttachmentServlet</servlet-name>
<url-pattern>/AttachmentServlet</url-pattern>
</servlet-mapping>
-<servlet>
<servlet-name>picPersonServlet</servlet-name>
<servlet-class>org.nspl.access.PicPersonServlet</servlet-class>
</servlet>
-<servlet-mapping>
<servlet-name>picPersonServlet</servlet-name>
<url-pattern>/picPersonServlet</url-pattern>
</servlet-mapping>
-<servlet>
<servlet-name>baseInfoACMServlet</servlet-name>
<servlet-class>org.nspl.access.BaseInfoACMServlet</servlet-class>
</servlet>
-<servlet-mapping>
<servlet-name>baseInfoACMServlet</servlet-name>
<url-pattern>/baseInfoACMServlet</url-pattern>
</servlet-mapping>
-<servlet>
<servlet-name>operationServlet</servlet-name>
<servlet-class>org.nspl.access.OperationServlet</servlet-class>
</servlet>
-<servlet-mapping>
<servlet-name>operationServlet</servlet-name>
<url-pattern>/operationServlet</url-pattern>
</servlet-mapping>
-<servlet>
<servlet-name>bulletinServlet</servlet-name>
<servlet-class>org.nspl.access.BulletinServlet</servlet-class>
</servlet>
-<servlet-mapping>
<servlet-name>bulletinServlet</servlet-name>
<url-pattern>/bulletinServlet</url-pattern>
</servlet-mapping>
-<servlet>
<servlet-name>reportsServlet</servlet-name>
<servlet-class>org.nspl.access.ReportsServlet</servlet-class>
</servlet>
-<servlet-mapping>
<servlet-name>reportsServlet</servlet-name>
<url-pattern>/reportsServlet</url-pattern>
</servlet-mapping>
-<servlet>
<servlet-name>Kaptcha</servlet-name>
<servlet-class>com.google.code.kaptcha.servlet.KaptchaServlet</servlet-class>
</servlet>
-<servlet-mapping>
<servlet-name>Kaptcha</servlet-name>
<url-pattern>/kaptcha.jpg</url-pattern>
</servlet-mapping>
-<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
-<listener>
<listener-class>org.nspl.access.SessionListener</listener-class>
</listener>
-<listener>
<listener-class> org.springframework.web.util.IntrospectorCleanupListener </listener-class>
</listener>
-<listener>
<listener-class> org.springframework.web.context.request.RequestContextListener </listener-class>
</listener>
-<context-param>
<param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
<param-value>false</param-value>
</context-param>
-<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>false</param-value>
</context-param>
-<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
-<filter>
<filter-name>Character Encoding Filter</filter-name>
<filter-class>org.primefaces.ultima.filter.CharacterEncodingFilter</filter-class>
</filter>
-<filter-mapping>
<filter-name>Character Encoding Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
-<mime-mapping>
<extension>ttf</extension>
<mime-type>application/font-sfnt</mime-type>
</mime-mapping>
-<mime-mapping>
<extension>woff</extension>
<mime-type>application/font-woff</mime-type>
</mime-mapping>
-<mime-mapping>
<extension>woff2</extension>
<mime-type>application/font-woff2</mime-type>
</mime-mapping>
-<mime-mapping>
<extension>eot</extension>
<mime-type>application/vnd.ms-fontobject</mime-type>
</mime-mapping>
-<mime-mapping>
<extension>eot?#iefix</extension>
<mime-type>application/vnd.ms-fontobject</mime-type>
</mime-mapping>
-<mime-mapping>
<extension>svg</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
-<mime-mapping>
<extension>svg#exosemibold</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
-<mime-mapping>
<extension>svg#exobolditalic</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
-<mime-mapping>
<extension>svg#exomedium</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
-<mime-mapping>
<extension>svg#exoregular</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
-<mime-mapping>
<extension>svg#fontawesomeregular</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
</web-app>
and my admin server log : https://drive.google.com/open?id=0B4URKdA128Y5WURXT1lnby13blE
I google it and found some solution it's about web.xml file but I don't don't understand what should i do ?
thank you for posting the admin server log. There is a long stack trace error in your server log that states:
Caused by: com.bea.xml.XmlException: weblogic.descriptor.BeanAlreadyExistsException: **Bean already exists**: "weblogic.j2ee.descriptor.FilterMappingBeanImpl#f5a45ff9(/FilterMappings[[CompoundKey: **hibernateFilter**[CompoundKey: ][CompoundKey: *.xhtml]]])".
This can happen sometimes particularly when you're using WebLogic's autodeploy feature. I've made an assumption here that you're deploying to a single server (Admin Server) in DEVELOPMENT mode using the autodeploy feature.
I would recommend the following:
In the admin console, delete the deployment, even if it is marked FAILED. If you get an error trying to delete it, then see below.
Shutdown all running WebLogic servers
Delete the contents of the auto deploy directory (if you're using autodeploy, which is what it looks like)
Delete the contents of
/home/sadr/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/servers/AdminServer/tmp
If you were unable to delete the deployment via the admin console, you will have to remove the deployment from your domain's config.xml:
/home/sadr/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/config/config.xml
(make a backup before you edit)
Restart the admin server
Redeploy the WAR file
On a personal note, I'm not a fan of autodeploy unless you're doing the actual development on your own workstation. And even then, you would use JDeveloper to integrate with WebLogic in a local dev environment. If you are working in more of an integration type environment, then I would recommend not using the autodeploy feature - which can be unrealiable at times.

Error 403:Authentication Failed in sso

I have created bluemix sso and enabled cloud directory
I have configured web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>SSOTestPoject</display-name>
<servlet>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>UserCollection</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>any-authenticated</role-name>
</auth-constraint>
</security-constraint>
</web-app>
I have configured ibm-application-bnd.xml
<?xml version="1.0" encoding="UTF-8"?>
<application-bnd
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-application-bnd_1_2.xsd"
version="1.2">
<security-role name="any-authenticated">
<special-subject type="ALL_AUTHENTICATED_USERS" />
</security-role>
</application-bnd>
After pushing the application in bluemix I am able to access the application it is redirecting to login pageSSO Login Page.
After login instead of taking to application it is throwing error. Error 403:Authentication Failed

Form Based authentication in REST Web serivces

I have created the REST web services using dynamic web project in eclipse and running in tomcat 7.
I am able to do basic authentication for the web services. Now I am trying to implement form based authentication.Now, any web service call from the browser shows 404 error instead of showing the login form.
May be , I guess the issue is path of the LoginForm.html. I have created the LoginForm.html directly under webcontent.
My web.xml code 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>CustomerConnect</display-name>
<security-role>
<role-name>manager</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>management pages</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/LoginForm.html</form-login-page>
<form-error-page>/LoginError.html</form-error-page>
</form-login-config>
</login-config>
<!-- <session-config> -->
<!-- <session-timeout> -->
<!-- 1 -->
<!-- </session-timeout> -->
<!-- </session-config> -->
<servlet>
<servlet-name>Jersey REST Service</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.feature.Redirect</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.JSPTemplatesBasePath</param-name>
<param-value>/views/</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
<param-value>/(images|css|jsp)/.*</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.bvbi.customerconnect.middletier</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<context-param>
<description>Location to store uploaded file</description>
<param-name>file-upload</param-name>
<param-value>
/home/bvbi/Desktop/apache-tomcat-7.0.26/webapps/CredoImages/
</param-value>
</context-param>
</web-app>
Your path configuration is correct. Remove * from your <url-pattern> inside the <servlet-mapping>.
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Does it make any difference?

Error Could not find Factory: javax.faces.context.FacesContextFactory

I am trying to run a sample primefaces 3.1 application using eclipse. When I run I am getting the following exception. I have placed jstl-1.0.2.jar,jsf-impl-2.0.3.jar,jsf-api-2.0.3.jar,primefaces-3.1.jar under WEb-INF/lib folder and index.jsf is placed under /WebContent.
Problem accessing /TestPrime/index.jsf. Reason:
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
Caused by:
javax.servlet.UnavailableException: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
at org.mortbay.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:415)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:458)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.eclipse.wst.server.preview.internal.PreviewStarter.run(PreviewStarter.java:72)
at org.eclipse.wst.server.preview.internal.PreviewStarter.main(PreviewStarter.java:29)
My web.xml is as follows:
<web-app version="2.5">
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" >
<welcome-file-list>
<welcome-file>index.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>*.jsf</url-pattern>
</servlet-mapping>
</web-app>
Update 1
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<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>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<mime-mapping>
<extension>png</extension>
<mime-type>image/png</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>login.jsf</welcome-file>
</welcome-file-list>
</web-app>
It's Jetty's fault. It is somehow not executing the JSF ConfigureListener which is been registered in the JSF TLD file.
Add the following entry to your webapp's web.xml to manually register it:
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
See also:
could not find Factory: javax.faces.context.FacesContextFactory

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>
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.