6 Replies Latest reply on Dec 31, 2003 10:41 AM by sudsy

    Tomcat Class Loading Problems

    Klaus Kaal Newbie

      Hi,

      I downloaded JB 3.2.3 and installed it. Before I modified anything, I started JB and got the following line several times:

      ------------------------------------------------------------------------------
      20:39:12,031 WARN [EmbeddedTomcatService] Unable to invoke setDelegate on class loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@d22ddb
      ------------------------------------------------------------------------------

      The trouble is that I loose my context in my application.

      Thanx for your help

      Klaus

        • 1. Re: Tomcat Class Loading Problems
          Chad La Joie Newbie

          Thats an error that JBoss gets starting out of the box. It probably isn't causing the problem you're seeing. Can you give us more info on the behaviour you're seeing and what version of JBoss you are using?

          • 2. Re: Tomcat Class Loading Problems
            Klaus Kaal Newbie

            Hi Chad,

            I am deploying a "mytest.war" file. In this, I have the "index.jsp" and a subdirectory "sub" with several files, say "sub/second.jsp" and "sub/third.jsp"

            Any page has a link to one of the other pages.

            I can call successfully "http://localhost:8080/mytest/index.jsp".

            The link to "sub/second.jsp" shows "http://localhost:8080/mytest/sub/second.jsp" in the statusbar of the browser. And it works.

            But from the pages in the subDir it does not work anymore. When I hover over the link in page "second.jsp" to "third.jsp", the statusbar shows "http://localhost:8080/sub/third.jsp" (without the "mytest")

            Clicking on this link cannot be successful.

            I have checkt the link with several types of absolut and relative notations. I.e. "third.jsp", "/third.jsp", "../sub/third.jsp", "/sub/third.jsp"

            Maybe, I am sitting on a simple misunderstanding.

            Thanx for your help

            Klaus

            • 3. Re: Tomcat Class Loading Problems
              Klaus Kaal Newbie

              Ahh, I forgot to mention that I use the latest Version of JB (3.2.3 with Tomcat) on WinXP

              Klaus

              • 4. Re: Tomcat Class Loading Problems
                Klaus Kaal Newbie

                Hi Chad,

                I am still waiting for a new shot from you. If that specified error is one "out of the box", it has something to do with my problem, because it appears with all my *.war deployments and my JSP loose the ability to reference to the context-root:

                A link to "/index.jsp" does not map to "http://localhost:8080/myapp/index.jsp" but to "http://localhost:8080/index.jsp"

                As I am using Dreamweaver and there I use libraries, which reference to the context-root automatically, I cannot drop this feature without reworking a lot of code...

                Thanks for your help

                Klaus

                • 5. Re: Tomcat Class Loading Problems
                  Chad La Joie Newbie

                  The error you see starting up is due to JBoss's unique class loading mechanisms and, as I said, it's an out of the box error that JBoss exhibits (which in my opinion should be fixed cause it just looks bad).

                  Now, as far as your error goes, I've experienced that behavior as well. For example, I have an application which is mounted under the context /dat, and all the links within the application look something like this /dat/some/path/page.jsp or /dat/ServletName.

                  Having reviewed the Servlet 2.3/JSP 1.2 spec, it would appear that the behaviour you're looking for is not explicitly specified within the spec, let alone specified as manditory behaviour. Instead in all the examples provided in the specification all the links contains the context mount point of the application in thier URLs. That said I believe that Tomcat, by itself, does allow you to do exactly what you're trying to do, and the specification infers that such a thing should be possible with the correct request mapping (assuming I'm reading that part of the spec correctly).

                  I think, however, JBoss is doing exactly what it should in this case. Now it may be possible to set up your request mappings in such a way as to get the bahviour you're looking for, but I'm not sure how to do that. I would suggest posting another question here with some sort of subject dealing with JSPs and request mappings. Also, I'll look a bit more into this, and if I find anything I'll post it either to this thread or the new one that you start.

                  • 6. Re: Tomcat Class Loading Problems
                    sudsy Newbie

                    It might sound odd, but have you considered repackaging in an ear? Here's my application.xml file (edited) from the META-INF subdirectory:

                    <?xml version="1.0" encoding="UTF-8"?>
                    <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
                    <application>
                     <display-name>Some Application</display-name>
                     <module>
                     <web>
                     <web-uri>mytest.war</web-uri>
                     <context-root>/mytest</context-root>
                     </web>
                     </module>
                    </application>

                    This should maintain your context within JBoss. I know that it works properly for those applications I've deployed.