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 30149] New: - IllegalArgumentException when using context-param in web.xml
Date Fri, 16 Jul 2004 12:53:45 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30149>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30149

IllegalArgumentException when using context-param in web.xml

           Summary: IllegalArgumentException when using context-param in
                    web.xml
           Product: Tomcat 5
           Version: Nightly Build
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: cheng.fang@sun.com


It appears any wars with context-param failed to
deploy.  When parsing web.xml, context-param elements are parsed and added
to map twice for some reason, and thus cause the second adding to throw
IllegalArgumentException.

I instrumented
apache/jakarta-tomcat-
catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java
addParameter method

Here it shows context-param was added twice:

INFO: Installing web application at context path /jsp-examples from URL
file:/.../jakarta-tomcat-5/webapps/jsp-examples
### name=webmaster value=myaddress@mycompany.com
### map={}
### value=null
### to add ok
### name=webmaster value=myaddress@mycompany.com
### map={webmaster=myaddress@mycompany.com}
### value=myaddress@mycompany.com
### to throw

To repruduce it, just add to jsp-examples/web-inf/web.xml:

    <context-param>
      <param-name>webmaster</param-name>
      <param-value>myaddress@mycompany.com</param-value>
      <description>
        The EMAIL address of the administrator to whom questions
        and comments about this application should be addressed.
      </description>
    </context-param>

Stack trace from catalina.log:
Jul 15, 2004 9:54:37 PM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.tomcat.util.IntrospectionUtils.callMethodN
(IntrospectionUtils.java:907)
        at org.apache.tomcat.util.digester.CallMethodRule.end
(CallMethodRule.java:576)
        at org.apache.tomcat.util.digester.Rule.end(Rule.java:228)
        at org.apache.tomcat.util.digester.Digester.endElement
(Digester.java:1057)
        at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1720)
        at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
        at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
        at org.apache.catalina.startup.ContextConfig.applicationConfig
(ContextConfig.java:234)
        at org.apache.catalina.startup.ContextConfig.start
(ContextConfig.java:557)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent
(ContextConfig.java:187)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:119)
        at org.apache.catalina.core.StandardContext.start
(StandardContext.java:4285)
        at org.apache.catalina.core.ContainerBase.addChildInternal
(ContainerBase.java:755)
        at org.apache.catalina.core.ContainerBase.addChild
(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
        at org.apache.catalina.core.StandardHostDeployer.install
(StandardHostDeployer.java:276)
        at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
        at org.apache.catalina.startup.HostConfig.deployWARs
(HostConfig.java:584)
        at org.apache.catalina.startup.HostConfig.deployApps
(HostConfig.java:398)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:997)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent
(HostConfig.java:298)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:119)
        at org.apache.catalina.core.StandardHost.backgroundProcess
(StandardHost.java:800)
        at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChild
ren(ContainerBase.java:1511)
        at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChild
ren(ContainerBase.java:1520)
        at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run
(ContainerBase.java:1500)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.IllegalArgumentException: Duplicate context initialization 
parameter webmaster
        at org.apache.catalina.core.StandardContext.addParameter
(StandardContext.java:2116)
        ... 35 more
Jul 15, 2004 9:54:37 PM org.apache.catalina.startup.ContextConfig 
applicationConfig
SEVERE: Parse error in application web.xml
java.lang.IllegalArgumentException: Duplicate context initialization parameter 
webmaster
        at org.apache.tomcat.util.digester.Digester.createSAXException
(Digester.java:2740)
        at org.apache.tomcat.util.digester.Digester.createSAXException
(Digester.java:2766)
        at org.apache.tomcat.util.digester.Digester.endElement
(Digester.java:1060)
        at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1720)

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


Mime
View raw message