4 Replies Latest reply on Nov 25, 2008 6:22 AM by chausberger

    No connectivity + DTD

    ptemmerman

      Hi All,

      I just had a colleague coming up to me saying that there JBoss application won't start because it has no internet connectivity.
      The JBoss server is unable to retrieve the dtd files from java.sun.com.

      As far as I know, the DOCTYPE specifiers (example below) are only being used to identify which type of document the parser is working with, rather than for validation purposes.

      Quote:
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">
      Thus it seems rather strange to me that JBoss (Tomcat) would be actually trying to fetch those dtd's from the internet.

      However, if somebody could confirm this, then I can rest assured

      Thanks

        • 1. Re: No connectivity + DTD
          jaikiran

          Which version of JBoss and Java is your colleague using? And is this DOCTYPE declaration part of an xml file which belongs to his application? Or is it a application shipped with JBoss? If available, please post the entire exception stacktrace.

          While posting the logs or xml content or code, remember to wrap it in a code block using the Code button in the message editor window and please hit the Preview button to make sure your post is correctly formatted

          • 2. Re: No connectivity + DTD
            ptemmerman

            Hi,

            They are using JBoss 4.2.3GA and JDK 1.5.0_16.
            Unfortunately, I don't have access to their stack trace.
            Actually, I'm not being asked to fixed it, I was just wondering if my assumption was correct. After searching the net for a while I'm in doubt :)

            Some pages say that it's just an URN and it's used as a namespace, while others state that the XML document actually IS being validated with the specified DTD link.
            Although, I must say that most of the things that I found where they stated that you need internet connectivity, were related with struts DTD.

            Maybe the correct assumption would be that the XML parser is first trying to load the DTD based on the name field (i.e. "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" ) and if that is not possible, then it's using the URL.

            Hmm, I don't know :)

            • 3. Re: No connectivity + DTD
              jaikiran

              The XML parsers try to validate against the DTD which can either be available locally in the jar or on the internet at the specified URL. From what i know, the xml parsers first look for the DTD within the jar and if that fails, it tries to connect to the internet.

              • 4. Re: No connectivity + DTD
                chausberger

                 

                "jaikiran" wrote:
                The XML parsers try to validate against the DTD which can either be available locally in the jar or on the internet at the specified URL. From what i know, the xml parsers first look for the DTD within the jar and if that fails, it tries to connect to the internet.


                does this mean that I can put the DTD in the jar files without chaning the DOCTYPE declaration in the XML files?
                where do I put the DTDs for datasources (e.g. jboss-ds_1_5.dtd) which are used by several jars?

                Claus