4 Replies Latest reply on Sep 27, 2002 5:58 AM by sameer

    Exception while Deploying war file

    sameer Newbie

      i am getting an exception saying "<param-name> is not allowed inside <init-param>" of web.xml file;when i deployed war file into ../server/default/deploy directory.But my application needs to access those parameters for start-up, please suggest if there is any alternative for the same.

        • 1. Re: Exception while Deploying war file
          Julian Gosnell Expert

          check the ordering in the dtd.

          we insist (per spec) on strict element ordering. This will ensure maximum portabilityof your app.

          Jules

          • 2. Re: Exception while Deploying war file
            sameer Newbie

            here is the stack trace.....
            org.xml.sax.SAXParseException: Element "init-param" does not allow "param-name" here.
            10:53:18,268 ERROR [Engine] ContextConfig[/kodiak] Parse error in application web.xml
            org.xml.sax.SAXParseException: Element "init-param" does not allow "param-name" here.
            at org.apache.crimson.parser.Parser2.error(Parser2.java:3086)
            at org.apache.crimson.parser.ValidatingParser$ChildrenValidator.consume(ValidatingParser.java:349)
            at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1311)
            at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
            at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
            at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
            at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
            at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
            at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
            at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
            at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
            at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
            at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
            at javax.xml.parsers.SAXParser.parse(SAXParser.java:326)
            at javax.xml.parsers.SAXParser.parse(SAXParser.java:101)
            at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275)
            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:3345)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
            at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.createWebContext(EmbeddedCatalinaServiceSX.java:321)
            at org.jboss.web.catalina.EmbeddedCatalinaServiceSX.performDeploy(EmbeddedCatalinaServiceSX.java:238)
            at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
            at org.jboss.deployment.MainDeployer.start(MainDeployer.java:678)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:513)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:481)
            at java.lang.reflect.Method.invoke(Native Method)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
            at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
            at $Proxy4.deploy(Unknown Source)
            at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:405)
            at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:586)
            at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:465)
            at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:237)
            at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162)
            at java.lang.reflect.Method.invoke(Native Method)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
            at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:894)
            at $Proxy0.start(Unknown Source)
            at org.jboss.system.ServiceController.start(ServiceController.java:340)
            at java.lang.reflect.Method.invoke(Native Method)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
            at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
            at $Proxy3.start(Unknown Source)
            at org.jboss.deployment.SARDeployer.start(SARDeployer.java:243)
            at org.jboss.deployment.MainDeployer.start(MainDeployer.java:678)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:513)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:481)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:465)
            at java.lang.reflect.Method.invoke(Native Method)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
            at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:314)
            at org.jboss.system.server.ServerImpl.start(ServerImpl.java:216)
            at org.jboss.Main.boot(Main.java:142)
            at org.jboss.Main$1.run(Main.java:375)
            at java.lang.Thread.run(Thread.java:484)
            10:53:18,278 INFO [Engine] ContextConfig[/kodiak]: Occurred at line 20 column -1
            10:53:18,278 INFO [Engine] ContextConfig[/kodiak]: Marking this application unavailable due to previous error(s)
            10:53:18,448 INFO [EmbeddedCatalinaServiceSX] Using Java2 parent classloader delegation: true
            10:53:18,448 INFO [Engine] StandardContext[/kodiak]: Context startup failed due to previous errors
            10:53:18,518 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/JBoss3.0/server/default/deploy/kodiak.war
            10:53:18,518 INFO [URLDeploymentScanner] Started
            10:53:18,518 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/JBoss3.0/server/default/conf/jboss-service.xml
            10:53:18,518 INFO [Server] JBoss (MX MicroKernel) [3.0.0 Date:200205311035] Started in 0m:57s:803ms

            Exception thrown for the portion of web.xml is


            <servlet-name>
            InitiateWFTrackerServlet
            </servlet-name>
            <servlet-class>
            kdk_SystemUtils.workflowtracker.InitiateWFTrackerServlet
            </servlet-class>

            <init-param>
            <param-name>kdk_ResourceBundleClass</param-name>
            <param-value>kdk_Library.kdk_ResourceBundleClass</param-value>
            <param-name>kdk_WFTrackerTimerClass</param-name>
            <param-value>kdk_SystemUtils.workflowtracker.kdk_WFTrackerTimerClass</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>


            same xml file is read without any error by tomcat server

            • 3. Re: Exception while Deploying war file
              Christoph Grimm Newbie

              if you look at the dtd you will see, that <init-param> is a repeatable element while <param-name> in <init-param> may only occur once. That's why the parser throws an error for your xml.

              change it to:

              <init-param>
              <param-name>kdk_ResourceBundleClass</param-name>
              <param-value>kdk_Library.kdk_ResourceBundleClass</param-value>
              </init-param>
              <init-param>
              <param-name>kdk_WFTrackerTimerClass</param-name>
              <param-value>kdk_SystemUtils.workflowtracker.kdk_WFTrackerTimerClass</param-value>
              </init-param>


              PS:
              dtd's are awfull to read but it's worth to have a look in you run in this kind of problems
              you find the dtd at http://java.sun.com/dtd/web-app_2_3.dtd

              • 4. Re: Exception while Deploying war file
                sameer Newbie

                thank you
                i downloaded the dtd it allows only one pair per init-param