1

I want to use maven integrated with eclipse to develop webapp according this tutorial: http://jacksonps4.me/wordpress/?p=868

But when I open jsp page, it throw NullPointerException as following

SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
    at org.apache.jsp.index_jsp._jspInit(index_jsp.java:23)
    at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
    at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:164)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)

I googled this bug, it seems that this is caused by put jsp-api.jar under WEB-INF/lib

But actually I did not do that, even when I move the jsp-api dependency from maven, the exception still come out. How can I solve it?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
zjffdu
  • 25,496
  • 45
  • 109
  • 159
  • Possible duplicate of http://stackoverflow.com/questions/2322031/severe-servlet-service-for-servlet-jsp-threw-exception – Raghuram Apr 06 '11 at 11:54

1 Answers1

1

It can also be caused by putting it in lib folder of the JDK/JRE of the machine, which is also covered by the webapp's runtime classpath. It can also be caused by having servlet-api from a different servletcontainer make/version somewhere in the runtime classpath.

I don't do Maven, but I believe that you have to specify them as provided scope in order to not have them to end up in /WEB-INF/lib of the build.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555