DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13682>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13682

AxisServletBase throws NullPointerException when destroying on Tomcat 3.3.1

           Summary: AxisServletBase throws NullPointerException when
                    destroying on Tomcat 3.3.1
           Product: Axis
           Version: current (nightly)
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Basic Architecture
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Tomcat used to automagically reload my classes when I compiled. This does no 
more work with Axis 1.0 (by the way, there is not version entry '1.0' for Axis 
in Bugzilla).

The reason is that the destroying of the servlet fails. Stack trace:
2002-10-16 09:48:46 - Ctx(/axis) : Error in destroy  - 
java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:380)
        at org.apache.tomcat.core.Context.setAttribute(Context.java:792)
        at org.apache.tomcat.facade.ServletContextFacade.setAttribute
(ServletContextFacade.java:121)
        at org.apache.axis.transport.http.AxisServletBase.storeEngine
(AxisServletBase.java:238)
        at org.apache.axis.transport.http.AxisServletBase.destroy
(AxisServletBase.java:174)
        at org.apache.tomcat.facade.ServletHandler.doDestroy
(ServletHandler.java:379)

Fix: change the following method in 
org/apache/axis/transport/http/AxisServletBase.java from:
//>>> old
    private static void storeEngine(ServletContext context, AxisServer engine) {
        context.setAttribute(ATTR_AXIS_ENGINE, engine);
    }
//<<< old

to this:

//>>> new
    private static void storeEngine(ServletContext context, AxisServer engine) {
        if (engine == null) {
            context.removeAttribute(ATTR_AXIS_ENGINE);
        } else {
            context.setAttribute(ATTR_AXIS_ENGINE, engine);
        }
    }
//<<< new

Reply via email to