Results 1 to 6 of 6

Thread: DTD reference for Spring beans XML file

  1. #1
    Join Date
    Nov 2004
    Posts
    18

    Default DTD reference for Spring beans XML file

    My Spring application context configuration file contains a reference to the DTD at "http://www.springframework.org/dtd/spring-beans.dtd". This means that my application system has runtime dependency on the reachability of the particular web site. In other words, my system fails to start if the dtd file/web site is not reachable.

    This dependency is fine for sample applications but not for my production system. What is the recommended way of working around this issue? Is there a way to turn off DTD validation as Spring framework reads them in?

    Thanks for help.
    /Jong

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    Use <!DOCTYPE beans SYSTEM "spring-beans.dtd">. If you get a parsing error check out http://forum.springframework.org/showthread.php?t=12022
    Last edited by robyn; May 14th, 2006 at 11:57 AM.

  3. #3
    Join Date
    Nov 2004
    Posts
    18

    Default it works

    I didn't know that Spring uses its own entity resolver so that I could use system id for locating DTD file.

    Thanks
    /Jong

  4. #4
    Join Date
    Aug 2004
    Posts
    123

    Default

    This is very close to the problem I just reported (telling me 'abstract' needs to be declared for a bean), but the solution doesn't help with that either. That is, changing the DOCTYPE to SYSTEM with an absolute path of the latest DTD downloaded from www.springframework.org doesn't solve the problem, so could it be a cacheing issue?

  5. #5
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    Quote Originally Posted by jonmor
    This is very close to the problem I just reported (telling me 'abstract' needs to be declared for a bean), but the solution doesn't help with that either. That is, changing the DOCTYPE to SYSTEM with an absolute path of the latest DTD downloaded from www.springframework.org doesn't solve the problem, so could it be a cacheing issue?
    You should never need to switch to ssytem from public for Spring itself, as it has the entity resolver and will always find the dtd from the classpath. Are you sure that in fact you are running 1.1.1 (note that 1.1.2 is out now), and not 1.1, which didn't have that attribute? Perhaps the older version is on your classpath somewhere...
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

  6. #6
    Join Date
    Nov 2004
    Posts
    18

    Default You are correct

    thanks.

Similar Threads

  1. Saving large files to a db using hibernate?
    By Dan Washusen in forum Data
    Replies: 10
    Last Post: Sep 20th, 2006, 12:18 PM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. Replies: 1
    Last Post: Jun 13th, 2005, 06:36 AM
  4. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM
  5. Converting bean types in a beans definition file
    By davidcnoel in forum Container
    Replies: 5
    Last Post: Oct 11th, 2004, 10:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •