I have just deployed my first JSF site using eatj.com.
I have tested my application on netbeans using glassfish and the site with JSF tags runs fine on localhost.
I have uploaded the project file by ftp to the webapps director folder on the tomcat server.
The jsp-api.jar file is present in the /lib file on the Tomcat server.
When i restart the server and go to /webapps/myproject/web/index.xhtml the page loads but non of the jsf tags are visible.
I have tried to copy the jar libraries to /webapps/myproject/web/WEB-INF/lib/ however there is no change.
Perhaps it is something to do with the fact my home page is .xhtml not .jsf? But I would have thought if it worked on my localhost then it work work on this server?
I am sure that the server supports JSF as there are examples of JSF pages running.
Any help would be greatly appreciated.
Thanks
edit:
Below is my current web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<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">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</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>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
Edit:
Below is a paste from my catalina.out file for server startup:
INFO: Server startup in 1594 ms
May 7, 2012 1:09:50 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-6713
May 7, 2012 1:09:51 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
May 7, 2012 1:09:51 PM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-6713
May 7, 2012 1:09:57 PM org.apache.catalina.core.AprLifecycleListener init
INFO:
May 7, 2012 1:09:57 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-6713
May 7, 2012 1:09:57 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1017 ms
May 7, 2012 1:09:57 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 7, 2012 1:09:57 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.14
May 7, 2012 1:09:59 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-6713
May 7, 2012 1:09:59 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:4713
May 7, 2012 1:09:59 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/62 config=null
May 7, 2012 1:09:59 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1580 ms
JSF tags will only be processed if the request URL matches the
<url-pattern>of theFacesServletinweb.xml. You seem to have mapped it on*.jsf, but the<welcome-file>ofindex.xhtmldoes not match that. You have 2 options:Map the
FacesServleton an<url-pattern>of*.xhtmlinstead of*.jsf. This way you never need to fiddle with virtual URLs.Change
<welcome-file>toindex.jsfand create an emptyindex.jsffile next toindex.xhtmlin the root folder to fool the server that it really exists, to prevent a 404 error.By the way, the confirmation that you’ve a
jsp-api.jarfile in Tomcat’s/libis irrelevant to this problem. First, that’s standard part of Tomcat and second, that’s not used at all when you’re using Facelets.Last but not least, make sure that you ship a concrete JSF implementation along with your webapp in its
/WEB-INF/libfolder. Tomcat does as being a simple JSP/Servlet container namely not ship with JSF bundled, while Glassfish as being a full fledged Java EE application server does. If you don’t have any one, download and drop thejavax.faces.jarfile in/WEB-INF/libfolder of your webapp before deploying to Tomcat. Also make sure that yourweb.xmlis declared conform Servlet 2.5, because Tomcat 6 is a rather old version which doesn’t support Servlet 3.0 like as Glassfish 3.