4 Replies Latest reply on Aug 21, 2003 9:19 AM by raja05

    JBoss-3.2.1 - How do I edit JBoss DTD's

      Hi,

      I thought that JBoss used the dtd's that come with JBoss distribution in JBOSS_HOME/docs/dtd/, but when I edit these this makes no difference.

      I'va also tried using a private doctype:

      <!DOCTYPE jbosscmp-jdbc SYSTEM "http://localhost/dtd/jbosscmp-jdbc_3_2.dtd">

      (I've created a webapp with the dtd's where the URL points)

      But this results in no validation being performed.

      Is there a way to use custom validation for JBoss deployment files?

      I know it seems an unlikely thing to want to do but I'm trying to create an empty load-group so that calling the abstract getter method for the primary key does not load any unloaded fields.

      This works fine when there's no validation - the app deploys and creates the empty load-group - but I'd rather have the validation there for future additions to the file.

      Thanks,

      kv.

        • 1. Re: JBoss-3.2.1 - How do I edit JBoss DTD's
          raja05

          I think you need to change the DTD in
          jboss.jar file in
          JBOSS_HOME/server//lib/

          There is a localResolver that resolves all the DTDs, so im imagining you could even specify the XML without the DTD and it would still get validated because the LocalREsolver uses DTDs that are built inside the jar file. Try updating that copy and it might take it.
          BTW, how do you turn off validation?

          • 2. Re: JBoss-3.2.1 - How do I edit JBoss DTD's

            Hi Raja,

            If you remove the <!DOCTYPE ..?> tag or just use the one I have above that turns off validation.

            I'm gonna checkout what you've suggested.
            I'll get back with that in a bit.

            kv.

            • 3. Re: JBoss-3.2.1 - How do I edit JBoss DTD's

              OK,

              So that's done it - but at the expense of extracting jboss.jar, editing the dtd and re-jaring the file.

              I must say I think it's a bit strange that the parser doesn't perform any validation when using a private doctype (<!DOCTYPE root SYSTEM "http://host/file.dtd"?>).

              Thanks for that m8.

              kv.

              • 4. Re: JBoss-3.2.1 - How do I edit JBoss DTD's
                raja05

                If you look at the code(org.jboss.metadata.XMLFileLoader), they take care of conditions where the bean developer doesnt give the DTD declaration. So whatever be the DTD, they use a localresolver which points to this version of DTD inside the jar.
                yeah, it is strange to unjar and rejar it but as long as it works, its cool.