2 Replies Latest reply on Oct 10, 2002 9:43 AM by Oleg Vershinin

    JBoss 3.0.0 Tomcat 4.1.12 Struts 1.1beta

    Theo Harper Newbie

      Hi,

      I am having problems using struts (more precisely tiles) with JBoss-3.0.3_Tomcat-4.1.12.

      My application uses the following in the struts-config.xml file.

      <plug-in className="org.apache.struts.tiles.TilesPlugin" >
      <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml"/>
      <set-property property="definitions-debug" value="0" />
      <set-property property="definitions-parser-details" value="0" />
      <set-property property="definitions-parser-validate" value="true" />
      </plug-in>

      The tiles-defs.xml file contains the following (cut down):

      <tiles-definitions>










      I have traced the error down to the class loader being used by commons-digester, when it creates the XmlDefinition class. It does not seem to be the class loader I would expect for my web app, i.e. the WebappClassLoader. Should the digester be set to use the Thread.currentThread().getContextClassLoader()?

      The CL I get is:

      org.jboss.mx.loading.UnifiedClassLoader@17e4dee{ url=file:/E:/My Projects/EvoDev/jboss-3.0.3_tomcat-4.1.12/server/evo/tmp/deploy/tomcat-4.1.x/server/lib/commons-digester.jar/79.commons-digester.jar }

      The struts.jar is definitely in the WEB-INF/lib dirctory.

      The error is as follows:

      java.lang.ClassNotFoundException: org.apache.struts.tiles.xmlDefinition.XmlDefinition
      at org.jboss.mx.loading.UnifiedLoaderRepository2.loadClass(UnifiedLoaderRepository2.java:166)
      at org.jboss.mx.loading.UnifiedClassLoader.loadClass(UnifiedClassLoader.java:283)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
      at org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252)
      at org.apache.commons.digester.Digester.startElement(Digester.java:1237)
      at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
      at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1284)
      at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)
      at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1182)
      at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
      at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
      at org.apache.commons.digester.Digester.parse(Digester.java:1514)
      at org.apache.struts.tiles.xmlDefinition.XmlParser.parse(XmlParser.java:341)
      at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFile(I18nFactorySet.java:529)
      at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFiles(I18nFactorySet.java:466)
      at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.createDefaultFactory(I18nFactorySet.java:294)
      at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:267)
      at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:215)
      at org.apache.struts.tiles.definition.ComponentDefinitionsFactoryWrapper.init(ComponentDefinitionsFactoryWrapper.java:69)
      at org.apache.struts.tiles.DefinitionsUtil.createDefinitionsFactory(DefinitionsUtil.java:276)
      at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:147)
      at org.apache.struts.action.ActionServlet.initApplicationPlugIns(ActionServlet.java:991)
      at org.apache.struts.action.ActionServlet.init(ActionServlet.java:458)
      at javax.servlet.GenericServlet.init(GenericServlet.java:256)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:924)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3341)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
      at org.jboss.web.catalina.EmbeddedCatalinaService41.createWebContext(EmbeddedCatalinaService41.java:427)
      at org.jboss.web.catalina.EmbeddedCatalinaService41.performDeploy(EmbeddedCatalinaService41.java:302)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:802)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:794)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:580)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:564)
      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.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.jmx.adaptor.rmi.RMIAdaptorImpl.invoke(RMIAdaptorImpl.java:283)
      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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:536)

      Any help much appreciated,
      Theo

        • 1. Re: JBoss 3.0.0 Tomcat 4.1.12 Struts 1.1beta
          Theo Harper Newbie

          I raised a bug for this and am looking at the EmbeddedCatalinaService41 just in case I can spot something obvious.

          Theo

          • 2. Re: JBoss 3.0.0 Tomcat 4.1.12 Struts 1.1beta
            Oleg Vershinin Newbie

            I have found several workarounds:

            1. struts.jar and commons-*.jar can be placed in ${JBOSS_HOME}/server/${CONTEXT}/lib
            but there are troubles with redeploying web-apps
            You have to stop jboss, manually delete work directories and ther start jboss

            2. add false
            into tomcat41-service.xml
            This helps with loading struts without errors but breaks jndi because catalina provide own jndi implementation.
            Probably, using jndi.properties file or something similar could help, but I had no enough patience to test this.

            3. Move to Jetty. Unfortunately ;-)) it works fine. (I prefer tomcat)

            Of course, I think it is bug