Hi Jake,

Jacob Kjome <[EMAIL PROTECTED]> wrote on 04/15/2007 07:08:01 PM:

> I've got a parser extending DOMParser and call 
> parser.setDocumentClassName(MetaDataDocument.class.getName()) .

This method gets called during reset. Your own code probably shouldn't be 
calling it. Setting the "document-class-name" property [1] is the 
supported way to override the default Document implementation.

> The problem is, the class MetaDataDocument is in a child classloader and 

> Xerces reports that it can't find it.....
> 
>       [xmlc] Error: java.lang.IllegalArgumentException: 
> MissingDocumentClassName:
>   The class name of the document factory 
> "org.enhydra.xml.xmlc.metadata.MetaDataDocument" used to construct 
> the DOM tree could not be found.
>       [xmlc] java.lang.IllegalArgumentException: 
> MissingDocumentClassName: The class name of the document factory 
> "org.enhydra.xml.xmlc.metadata.MetaDataDocument" used to construct 
> the DOM tree could not be found.
> 
> As you may recognize, this is in the context of an Ant 
> task.  Specifically, the XMLC Ant task.  Ant includes XercesImpl.jar 
> in ANT_HOME/lib.  My library is added to the taskdef via a 
> <classpath> element.  I know Xerces runs through some fancy routines 
> to find classloaders, but it doesn't seem to be doing the job 
> here.  I'm wondering if you have any suggestions to resolve this issue?

Is the child ClassLoader which knows how to load MetaDataDocument the 
current thread's context ClassLoader? That's where Xerces looks.

> Up to now, I've wrapped Xerces in my own namespace and added it to 
> the <classpath> declaration in the build file.  Now I'm trying to 
> utilize XercesImpl.jar already included on the classpath (such as in 
> Ant and most J2EE containers).  This is keeping me from being able to 
> utilize the global instance and resort to using my own version 
> packaged with my library.  I hope there is a way to resolve this!
> 
> 
> Jake
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

[1] 
http://xerces.apache.org/xerces2-j/properties.html#dom.document-class-name

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to