java.lang.NullPointerException in a simple servlet

If I utilize org.apache.struts.action.ActionServlet in the web-app/servlet/servlet-class attribute, then the welcome-file comes up fine.

If I use my own servlet, servlet2, then I get
“SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException: Module 'null' not found.”, and a blank page.

Using a println, I know servlet2.init() method is firing ok.

It looks to me, a newbie, that the container can’t find a moduleConfig object. But, neither GenericServlet or HttpServlet reference this module. And my servlet doesn’t reference it. ActionServlet does provide a method which returns this object.

I included ActionServlet’s getModuleConfig(HttpServletRequest request) in my servlet, but received the same result. Based upon the println, control doesn’t reach this method anyway.

Code is below.

As an aside, do the parentheses in “return (config);” have any significance?

Many thanks.

Matt

loginPackage.servlet2.java

--------------------------------------------
Web.xml
--------------------------------------------
struts-config
--------------------------------------------
stack trace
Feb 22, 2010 3:52:28 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException: Module 'null' not found.
at org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755)
at org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735)
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:488)
at org.apache.jsp.login_jsp._jspx_meth_html_005fform_005f0(login_jsp.java:168)
at org.apache.jsp.login_jsp._jspService(login_jsp.java:100)
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)