5 Replies Latest reply on Nov 20, 2002 4:15 PM by Christopher Weiss

    Got exception for tiles with JBoss+Tomcat

    Jian ren Newbie

      Hi,
      I have a web application using struts and tiles, which run well on Tomcat(without JBoss). When I tried to deploy it under JBoss-3.0.4_tomcat-4.1.12. I always got an exception for the tiles configure file as below:
      javax.servlet.ServletExceptions: Error whiel parsing file '/WEB-INF/tiles-def.xml'. Error at (9. -1: No ClassLoaders found for: org.apache.struts.tiles.xmlDefinition.XmlDefinition

      But the same WAR file works fine under JBoss-3.0.4 with Jetty.
      Anyone here got the same exception? Please help me if you have any suggestions.
      Thanks a lot!

      Ridge

        • 1. Re: Got exception for tiles with JBoss+Tomcat
          David Shubert Newbie

          Yep, I have the same problem. Plus I am using the Validator plugin which has a similar problem. For some reason JBoss is not finding the plugins.

          I assume you have struts.jar (with the Tiles stuff) in WEB-INF/lib, right?

          • 2. Re: Got exception for tiles with JBoss+Tomcat
            Jian ren Newbie

            Yes, I do. So how to fix that? Move the struts.jar and tiles.jar to the lib directory of the default server? Why it works fine on JBoss+Jetty?
            Thanks!

            • 3. Re: Got exception for tiles with JBoss+Tomcat
              Anthony Law Newbie

              I had the same prob & found a temp solution. Simply copy 2 JARs to the JBoss deploy dir:

              1) struts.jar
              2) commons-validator.jar

              So it seems like the ones in WEB-INF/lib aren't being read properly.

              Cheers,

              Anthony.

              • 4. Re: Got exception for tiles with JBoss+Tomcat
                Christopher Weiss Newbie

                I had the same problem, and here is the solution, although it aint much fun.

                You'll see the same problem kicking around these forums a couple different ways, but they all revolve around using Digester without setting it to use the context class loader.

                In the case of tiles, you can fix your problem by downloading the source version (Im here assuming you're using the Struts 1.1b, not the seperate tiles lib, which would be similar) and looking in the directory:
                contrib/tiles/src/share/org/apache/struts/tiles/xmlDefinition
                and find the file XMLParser. In it, uncomment line #66, which is:
                digester.setUseContextClassLoader(true);

                Then recompile the whole struts jar and use it instead.

                Alternatively, Im attaching the compiled XMLParser.class file, which with some creative WinZipping (or whatever zip tool you prefer) can put this one in over the top of the existing one. I redeployed after this and all my woes were solved.

                Hope this helps!

                Chris

                • 5. Re: Got exception for tiles with JBoss+Tomcat
                  Christopher Weiss Newbie

                  I had the same problem, and here is the solution, although it aint much fun.

                  You'll see the same problem kicking around these forums a couple different ways, but they all revolve around using Digester without setting it to use the context class loader.

                  In the case of tiles, you can fix your problem by downloading the source version (Im here assuming you're using the Struts 1.1b, not the seperate tiles lib, which would be similar) and looking in the directory:
                  contrib/tiles/src/share/org/apache/struts/tiles/xmlDefinition
                  and find the file XMLParser. In it, uncomment line #66, which is:
                  digester.setUseContextClassLoader(true);

                  Then recompile the whole struts jar and use it instead.

                  Alternatively, Im attaching the re-compiled XMLParser.class, and the recomplied struts.jar.

                  Hope this helps!

                  Chris