5 Replies Latest reply on Sep 29, 2011 10:42 AM by Wolfgang Knauf

    Migrating Applications from Tomcat 6 to Jboss AS 5.1

    Bruce Klein Newbie

      Hi,

        I have been assigned the task of migrating some applications that have been successfully running in Tomcat 6 to run inside the Jboss AS 5.1 container. I have had some success but I am not sure if I am going about it in the right way. The first challenge was with the classloaders which I was able to solve using the jboss-classloading.xml file in my application's war file under the WEB_INF dir. The contents of this file is discussed in the article by Joel Tosi(4/4/2011) entitled "Classloaders and You" which I have attached. The next challenge has been updating the tag library definitions. I keep running into errors like this:

       

      ERROR [cmmobile] Servlet.service() for servlet cmmobile threw exception

      org.apache.jasper.JasperException: The absolute uri: http://tiles.apache.org/tags-tiles cannot be resolved in either web.xml or the jar files deployed with this application.

       

      I was albe to resolve this for the jstl libs by includign this in my web.xml file:

       

      <taglib>

             <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>

             <taglib-location>/WEB-INF/tld/c.tld</taglib-location>

          </taglib>

       

      and by downloading a c.tld file. None of this was neccessary for the the application to run under Tomcat 6. I am now running into the error described above. I manually changed web.xml to refrerence  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd where in the previous Tomcat version it was pointing to  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd. Similarly I manually changed the references in the tld files to "http://java.sun.com/xml/ns/javaee web-jsptaglibrary_2_1.xsd from  "http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd.

      Jboss seemed to complain about any references to j2ee.

       

      So that leads me to my question of should I have to be manually edittting these references?

       

      How can I resolve the above issue?

       

      All neccessary .jar files are present in the WEB-INF/lib dir however Jboss seems to ignore them in some cases.

       

      Any help in moving this forward would be greatly appreciated.

       

      Regards,

      Bruce Klein

        • 1. Re: Migrating Applications from Tomcat 6 to Jboss AS 5.1
          Wolfgang Knauf Master

          Hi,

           

          you should not have to change the web.xml or TLD versions, it should also work with older versions.

           

          Seems that JBoss does not like "Tiles.tld". What Tiles related JARs do you bundle? Does any of them contain "tiles.tld"?

           

          Best regards

           

          Wolfgang

          • 2. Re: Migrating Applications from Tomcat 6 to Jboss AS 5.1
            Bruce Klein Newbie

            Hi Wolfgang,

              Thank you for your reply.

             

            Tile related jars are:

            tiles-api-2.2.2.jar

            tiles-core-2.2.2.jar

            tiles-jsp-2.2.2.jar

            tiles-servlet-2.2.2.jar

            tiles-template-2.2.2.jar

             

            No tiles.tld in any of these jars.

             

            Cheers,

            Bruce

            • 3. Re: Migrating Applications from Tomcat 6 to Jboss AS 5.1
              Wolfgang Knauf Master

              Hi,

               

              I just downloaded Tiles 2.2.2, and I find "tiles-jsp.tld" in "tiles-jsp-2.2.2.jar\META-INF\tld". Could you check this? Maybe your project uses a modified version of this file where the TLD was removed.

               

              Best regards

               

              Wolfgang

              • 4. Re: Migrating Applications from Tomcat 6 to Jboss AS 5.1
                Bruce Klein Newbie

                Hi Wolfgang,

                 

                Yes. I found that file and inserted a taglib to my web.xml and moved the file into my WEB_INF/tld directory

                 

                <taglib>

                       <taglib-uri>http://tiles.apache.org/tags-tiles</taglib-uri>

                       <taglib-location>/WEB-INF/tld/tiles-jsp.tld</taglib-location>

                    </taglib>

                 

                That solved the immediate issue but then jboss produced the following error:

                 

                org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/functions cannot be resolved in either web.xml or the jar files deployed with this application

                 

                So there seems to be a pattern here. None of these tld issues exist when I run my apps in a pure Tomcat environment so I am curious as to why they are showing up by dropping these wars into jboss. What I've done so far after dropping my war file into my servers deploy dir is created a WEB-INF/jboss-classloading.xml file with the following contents to isolate my war's classes.

                 

                <?xml version="1.0" encoding="UTF-8"?>

                <classloading xmlns="urn:jboss:classloading:1.0"

                              name="mobile.war"

                              domain="mobile.com"

                              export-all="NON_EMPTY"

                              import-all="true">

                </classloading>

                 

                Whats happening in jboss to cause these issues?

                 

                Is there a more global solution to fix this or do I have to go through one by one and find the tld files and create a taglib for each one that comes up in error?

                 

                Thanks!
                Bruce

                • 5. Re: Migrating Applications from Tomcat 6 to Jboss AS 5.1
                  Wolfgang Knauf Master

                  Hi,

                   

                  you should bundle "jstl.jar" in your app. This file contains "fn.tld". If you have this JAR, but without the TLD, then maybe someone else did some cleanup and removed all TLD files from all JARs. In this case, you will have to undo this change :-(

                   

                  Each JBoss version became more strict when parsing config files, and thus JBoss 6 performs more parsing than JBoss 5.

                   

                  Best regards

                   

                  Wolfgang