tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5597] New: - NullPointerException if web.xml not in particular order
Date Thu, 27 Dec 2001 21:25:45 GMT
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=5597>.
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=5597

NullPointerException if web.xml not in particular order

           Summary: NullPointerException if web.xml not in particular order
           Product: Tomcat 4
           Version: 4.0.1 Beta 1
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Webapps
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: scott@xigole.com


If, when configuring a servlet, the order of the elements is incorrect, you get
a NullPointerException in XmlMapper.java and a somewhat confusing message to the
console (stdout/stderr).

web.xml has:
    <servlet>
	<servlet-name>myservlet</servlet-name>
	<init-param>
            <param-name>aParam</param-name>
            <param-value>and its value</param-value>
	</init-param>
	<servlet-class>com.myco.some.ClassName</servlet-class>
	<load-on-startup>2</load-on-startup>
    </servlet>

If I put the servlet-class definition before the init-param then everything is
fine.  In localhost_log I have:

2001-12-27 14:05:00 ContextConfig[/xigole] Parse error in application web.xml
java.lang.NullPointerException
    at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:295)
    at
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:256)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:824)
    at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:224)
    at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3334)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
    at org.apache.catalina.core.StandardHost.install(StandardHost.java:712)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:599)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:777)
    at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:463)
    at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:612)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
    at org.apache.catalina.core.StandardService.start(StandardService.java:388)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)

2001-12-27 14:05:00 ContextConfig[/xigole]: Marking this application unavailable
due to previous error(s)

and the console has:

ERROR reading java.io.ByteArrayInputStream@60f2f6
At The content of element type "servlet" must match
"(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),init-param*,load-on-startup?,security-role-ref*)".

Starting service Tomcat-Apache
Apache Tomcat/4.0.1

O/S is: SunOS turtle 5.8 Generic_108528-12 sun4u sparc SUNW,Ultra-5_10
Java is: Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message