[jdom-interest] need help with local DTD
jdom-interest at vrolijken.nl
jdom-interest at vrolijken.nl
Sun Nov 13 23:12:27 PST 2005
Hi Paul,
Not quite sure what you mean, but the InputSource is created like this:
build as
follows:
// repositoryFileName = repository.xml
//j2ee compliant lookup of resources
URL url = ClassHelper.getResource(repositoryFileName);
String pathName = url.toString();
...
// pathName is now file:/C:/a/very/long/path/classes/repository.xml
InputSource source = new InputSource(pathName);
Quoting Paul Libbrecht <paul at activemath.org>:
> Can I infer you didn't create your input-source with a system-id URL ?
> Without it, no parser can sensibly resolve relative URLs... and they
> should not consider any such notation of "current directory" unless
> with file://a/b/c.
>
> paul
>
>
> Le 11 nov. 05, à 16:28, jdom-interest at vrolijken.nl a écrit :
>
>> Hi all,
>>
>> I'm working on WebSphere 5.0 on a project that involves Jakarta
>> Slide. For that
>> project I needed to change the classloader policy to PARENT_LAST and WAR
>> classloader policy to APPLICATION so that it would use the JDom
>> provided with
>> Slide, which is newer that the WSAD one. The problem I'm having now
>> is that the
>> OJB configuration (which is also needed) is not properly loaded anymore.
>>
>> The error I'm getting is "no protocol" for the DTD. I would not think the
>> protocol is needed as it is a local file. I can change the
>> specification of the
>> DTD into "file:///path/on/my/local/machine/repository.dtd" and that
>> works. The
>> problem (obviously) is that this won't work in production, as the path is
>> completely different.
>>
>> What am I doing wrong here?
>>
>> --- part of the code where stuff breaks ----
>> in
>> org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(
>> InputSource,
>> Class):
>>
>> DescriptorRepository repository = new DescriptorRepository();
>> ContentHandler handler = new RepositoryXmlHandler(repository);
>> reader.setContentHandler(handler);
>> reader.parse(source); <--- throws a MalformedURLException
>>
>> --- XML file that is fed to 'source' ---
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE descriptor-repository PUBLIC "-//Apache Software
>> Foundation//DTD OJB
>> Repository//EN" "repository.dtd"
>> [
>> <!ENTITY database SYSTEM "repository_database.xml">
>> <!ENTITY internal SYSTEM "repository_internal.xml">
>> <!ENTITY user SYSTEM "intranet_mapping.xml">
>> ]>
>> ...
>> _______________________________________________
>> To control your jdom-interest membership:
>> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>>
>
>
More information about the jdom-interest
mailing list