[jdom-interest] Base vs. Relative URI?
Laurent Bihanic
laurent.bihanic at atosorigin.com
Mon Mar 11 02:07:08 PST 2002
Hi Steve,
The parser understands it as relative because you do not define the protocol
to use.
Try adding a protocol prefix ("file://"): "file:///c:/User_Manager/UM_config.dtd"
Laurent
Steve Beech wrote:
> Dear All,
>
> I'm running a server app and using JDOM to parse my configuration file. This
> works fine from inside my IDE but when I try to run from the command line I
> get the following error:
>
> Exception in thread "main" java.io.IOException: Error on line 2: Relative
> URI "C:\User_Manager\UM_config.dtd"; can not be resolved without a base URI.
> at
> User_Manager.UM_configuration.parseConfiguration(UM_configuration.java:104)
> at User_Manager.UM_configuration.<init>(UM_configuration.java:49)
> at User_Manager.UM_configuration.<init>(UM_configuration.java:40)
> at User_Manager.UM_multiServer.main(UM_multiServer.java:35)
>
> My xml config file contains the following dtd reference:
>
> <?xml version="1.0"?>
> <!DOCTYPE angel:um_config SYSTEM "c:\User_Manager\UM_config.dtd">
>
> In my code I create a validating SAXBuilder using:
>
> SAXBuilder builder = new SAXBuilder(true);
> System.out.println("SAXBuilder created ok");
> Document doc = builder.build(in);
>
> I get the 'SAXBuilder created ok' message but the doc never gets built.
>
> The URI given appears to me to be a base URI and not relative - so does
> anyone know why I might be getting this error?
>
> Thanks in advance,
>
> Steve Beech
More information about the jdom-interest
mailing list