0

When I go to http://localhost:8081/installer/index.xhtml via IE11 or Firefox45, I see only Setup Wizard and no JSF components. The HTTP status code is 200. I do not have any errors on Tomcat 7. It is running without problem on JSF 1.2. I am only not sure about web.xml file.

Thanks in advance. Can you advise me what can be wrong, please?

EDITED When I changed extension from .xhtml to .faces, I got an useful exception on Tomcat output, thanks.

Skyware
  • 352
  • 1
  • 7
  • 16

1 Answers1

0

Please check the servlet mapping in web.xml

<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>
    <url-pattern>*.jsf</url-pattern>
  </servlet-mapping>

Now which url you are running like here servlet is called when i will run http://localhost:Port/Path/PageName.jsf but when i will try to run http://localhost:Port/Path/PageName.xhtml it will not work. Or I have to us like this http://localhost:Port/faces/Path/PageName.xhtml

Community
  • 1
  • 1
Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
  • I am running http://localhost:8081/installer/index.xhtml Faces Servlet javax.faces.webapp.FacesServlet 30 Faces Servlet *.faces – Skyware Apr 18 '16 at 09:17
  • What about your servlet mapping in web.xml file ? – Subodh Joshi Apr 18 '16 at 09:17
  • try this url http://localhost:8081/installer/index.faces – Subodh Joshi Apr 18 '16 at 09:20
  • I ran localhost:8081/installer/index.faces and I got #{msg.WEB_ERROR_SHOW_TRACE} #{msg.WEB_ERROR_LINK_BACK} #{msg.WEB_ERROR_LINK_HOME} #{msg.WEB_TOOLBAR_BTN_SETTINGS} #{msg.WEB_TOOLBAR_BTN_LOGIN} – Skyware Apr 18 '16 at 09:23
  • Try with simple code first just add one two component in page and render it see what is happening. – Subodh Joshi Apr 18 '16 at 09:30
  • I ran http://localhost:8081/installer/index.faces. Looks the same no component only text. Here is my JS console. GET http://localhost:8081/installer/index.faces [HTTP/1.1 500 Internal Server Error 194ms] GET http://localhost:8081/allfa-web/pages/login.faces [HTTP/1.1 500 Internal Server Error 22ms] GET http://localhost:8081/installer/index.faces [HTTP/1.1 500 Internal Server Error 4ms] GET http://localhost:8081/allfa-web/pages/login.faces [HTTP/1.1 500 Internal Server Error 5ms] GET http://localhost:8081/allfa-web/pages/index.faces [HTTP/1.1 500 Internal Server Error 5ms] and so on... – Skyware Apr 18 '16 at 09:41
  • My simple page with a component.

    Hello World PrimeFaces

    – Skyware Apr 18 '16 at 09:42
  • Your Simple Page worked or not? – Subodh Joshi Apr 18 '16 at 09:44
  • My simple page not worked. I got #{msg.WEB_ERROR_SHOW_TRACE} #{msg.WEB_ERROR_LINK_BACK} #{msg.WEB_ERROR_LINK_HOME} #{msg.WEB_TOOLBAR_BTN_SETTINGS} #{msg.WEB_TOOLBAR_BTN_LOGIN} – Skyware Apr 18 '16 at 09:45
  • If you migrating from JSF1.2 to JSF2 did you follow standard document .How you are migrating ? – Subodh Joshi Apr 18 '16 at 09:48
  • I have changed pom.xml, web.xml, faces-config.xml to meet Java EE 7 standarrd requirements. However, I am migrating also from icefaces to primfaces 5.2. So, I commented out many lines related to icefaces on back-end and a few on front-end. – Skyware Apr 18 '16 at 09:55
  • This is my tomcat output when I run http://localhost:8081/installer/example.faces org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [] threw exception [null] with root cause java.lang.NullPointerException at com.sun.faces.application.view.FaceletViewHandlingStrategy.createView(FaceletViewHandlingStrategy.java:822) at com.sun.faces.application.view.MultiViewHandler.createView(MultiViewHandler.java:168) at com.ocpsoft.pretty.faces.application.PrettyViewHandler.createView(PrettyViewHandler.java:55) – Skyware Apr 18 '16 at 10:07
  • @Michal Please have a look on this http://stackoverflow.com/questions/22038140/nullpointerexception-at-com-sun-faces-application-view-faceletviewhandlingstrate – Subodh Joshi Apr 18 '16 at 10:59