tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julio César Chaves Fernández <he...@hotmail.com>
Subject NullPointerException on Struts Action
Date Fri, 18 Sep 2009 13:44:19 GMT


Hi, i've been having a strange behavior with some struts apps deployed on Oracle portal. Lately,
they're giving the 500 Internal Server Error and this output:

09/09/17 16:10:19 java.lang.NullPointerException
09/09/17 16:10:19     at org.apache.struts.action.Action.getDataSource(Action.java:532)
09/09/17 16:10:19     at co.edu.icesi.notas.action.InicioAction.execute(InicioAction.java:46)
09/09/17 16:10:19     at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
09/09/17 16:10:19     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
09/09/17 16:10:19     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
09/09/17 16:10:19     at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
09/09/17 16:10:19     at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
09/09/17 16:10:19     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
09/09/17 16:10:19     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
09/09/17 16:10:19     at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
09/09/17 16:10:19     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:674)
09/09/17 16:10:19     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:341)
09/09/17 16:10:19     at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:230)
09/09/17 16:10:19     at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:228)
09/09/17 16:10:19     at _index._jspService(_index.java:48)
09/09/17 16:10:19     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
09/09/17 16:10:19     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:356)
09/09/17 16:10:19     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498)
09/09/17 16:10:19     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402)
09/09/17 16:10:19     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
09/09/17 16:10:19     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
09/09/17 16:10:19     at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
09/09/17 16:10:19     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:674)
09/09/17 16:10:19     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:341)
09/09/17 16:10:19     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:816)
09/09/17 16:10:19     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:231)
09/09/17 16:10:19     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:136)
09/09/17 16:10:19     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
09/09/17 16:10:19     at java.lang.Thread.run(Thread.java:534)


InicioAction is the init action that sets some data in the user session and makes some validations.
The code in Action.java at line 532 is:

protected DataSource getDataSource(HttpServletRequest request, String key)
  {
    ServletContext context = getServlet().getServletContext();  ------------------------->
line 532
    ModuleConfig moduleConfig = RequestUtils.getModuleConfig(request, context);

    return ((DataSource)context.getAttribute(key + moduleConfig.getPrefix()));
  }

with this info you know the getServlet() method is returning null according to output, but
then why could this have happened if the application was working well up untill that day for
at least a week or so. How could that servlet get lost on runtime? What kind of event could
trigger that error?

TIA

Julio César Chaves

_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message