users@jaxb.java.net

SAXParseException: Why?

From: Irv Thomae <ithomae_at_ists.dartmouth.edu>
Date: Wed, 30 Apr 2003 12:00:03 -0400

   First I should explain that my JAXB application has been working very
well since January, using the JAXB-1.0 beta package. But at last it
became necessary to convert it to use the 1.0 release.

     The application itself retrieves xml data files from a server,
validates and parses them, and updates a graphical display. Because the
files are fetched across a network using http-Get, incomplete files do
sometimes happen, so we depend on validation to reject them.
    After revising the CLASSPATH, re-compiling of the schema, the
jaxb-generated classes, and the Java classes that interact directly with
them all proceeded very smoothly. However, the updated (i.e.,
Jaxb-1.0) app throws a SAXParseException for every file it tries to
read. Apparently this occurs because, as an artifact of older in-house
applications, the xml files we deal with still begin by citing a dtd file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bgpstats SYSTEM "bgpstats.dtd">


The exact error message looks like this (one for every filename):

DefaultValidationEventHandler: [FATAL_ERROR]: Relative URL
"bgpstats.dtd:; can not be resolved without a base URI.
JAXBException on file " filename "
org.xml.sax.SAXParseException: Relative URI "bgpstats.dtd"; can not be
resolved without a base URI.


The message itself is clear enough, but if JAXB doesn't use dtd files,
why is failure to find one treated as a fatal error?

Thanks,
  Irv Thomae
  ISTS/Dartmouth College