XMLCDeferredParsingFactory and classpaths

James Carnegie <[email protected]> Tue, 16 Dec 2003 10:18:13 +0000
Newsgroups gmane.comp.java.enhydra.xmlc
Message-ID <[email protected]>
Hi All,

I have just started looking at using XMLCs deferred parsing capabilities
with Barracuda (very cool, thanks guys), but I'm experiencing a couple
of difficulties with resource paths and classloading.

At http://xmlc.enhydra.org/project/aboutProject/xmlc22release.html it
says that when using the XMLCDeferredParsingFactory, first the resource
path is searched, then the classpath. If the resource is only found on
the classpath, dynamic reloading will not work.

When I place my resources outside of the classpath, dynamic reloading
works great:

xmlcDeferredParsingFactory.addResourceDir("/home/kipz/dev/someproject/resources_outside_classpath/");
xmlcDeferredParsingFactory.setDefaultMetaDataPath("options.xmlc");
Document page = xmlcDeferredParsingFactor.createFromFile("MyML.html");

But when I put them in a directory in the classpath:

xmlcDeferredParsingFactory.addResourceDir("/home/kipz/dev/someproject/com/mycompany/xmlc_on_classpath/");
xmlcDeferredParsingFactory.setDefaultMetaDataPath("options.xmlc");
Document page = xmlcDeferredParsingFactor.createFromFile("MyML.html");

The resource is loaded correctly, but dynamic reloading no longer works,
I suspect because they are being loaded from the classpath by a
classloader.

Any help/suggestions would be much appreciated.

James.