Why servletContext.getResource returns null and throws JBWEB000236 java.lang.NullPointerException ?

Solution Unverified - Updated -

Issue

  • We are in the migrating process from jboss 5.0 GA to jboss eap 6.4 from windows server to RHEL 6.4. Not able to redirect to login page.
  • Under what circumstances the following application code will return null, which will lead to the java.lang.NullPointerException:
servletContext.getResource( "/" );

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/test].[jsp]] (http-10.130.30.31-8080-19) Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
    • 5.x
    • 4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.