1

I am trying to start with JSF installation.

In JSF file, I just added h tag and f tag. Once I do <f:view> it gives below error.

    May 30, 2012 2:49:20 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
    at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1858)
    at org.apache.jsp.ClinicInformation_jsp._jspx_meth_f_005fview_005f0(ClinicInformation_jsp.java:98)
    at org.apache.jsp.ClinicInformation_jsp._jspService(ClinicInformation_jsp.java:70)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Thread.java:619)

I can't understand what is missing. I added two Jars...

  1. javax.faces-2.1.8.jar
  2. javax.servlet.jsp.jstl-api-1.2.1.jar
  3. primefaces-3.2.jar
Ketan Bhavsar
  • 5,338
  • 9
  • 38
  • 69

2 Answers2

4

The stacktrace indicates that you're using the old and deprecated JSP for some reason. JSP has been succeeded by Facelets since JSF 2.0 end of 2009.

Rename ClinicInformation.jsp to ClinicInformation.xhtml and read the Facelets tutorial. For some kickoff examples how such a Facelets file should look like, check the following answers:

Note that you can configure JSF 2.0 to use JSP instead by some web.xml params, but this is absolutely not recommended as it's an inferior view technology. Even more, PrimeFaces doesn't support JSP at all.

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Ohh ok Balus... I need to read more then... But once everything is configured fine. I can start further... But thanks for your help. – Ketan Bhavsar May 29 '12 at 21:36
  • Thanks BalusC. I am always fan of your comments... It's always helpful to me.. when I converted .jsp to .xhtml everything worked fine but my help in eclipse tool using CTRL + Space is no more now. http://stackoverflow.com/questions/10807291/eclipase-not-giving-any-help-on-ctrl-space Is there any way to start it? – Ketan Bhavsar May 29 '12 at 22:01
2

I had the same problem when calling the app not using the string faces.

Example:

  1. http://ADDRESS:PORT/APP/JSP

  2. http://ADDRESS:PORT/APP

But the issue was gone after using http://ADDRESS:PORT/APP/faces/JSP.
What type of URL are you using?

Hope this helps.

Sam
  • 86,580
  • 20
  • 181
  • 179
Mario
  • 21
  • 1