I'm using the Xerces parser within an EJB deployed under jBoss 1.0.

The Xerces DOM parser has a mechanism wherein you can specify your own
org.w3c.dom.Document class to be created when you parse an XML file. This is
done by setting a property in the parser, basically you just give it a
string containing the fully-qualified classname of a class that implements
the appropriate interface (or extends their Document implementation). Then,
when the document is parsed, the class you specify is instantiated in place
of the Xerces DocumentImpl class.

This all works great outside of an EJB.

Inside an EJB, when I parse the document, I'm getting an error in the midst
of parsing that leads me to believe that, for some reason, the EJB's
classloader is not able to find my Document class. Here's the error (which
appears in the jBoss console):

error java.lang.NoClassDefFoundError
java.lang.ClassCastException: java.lang.NoClassDefFoundError

and then the stack trace, which I can reproduce if you think it's valuable.
I've isolated the error as occuring within the Xerces DOMParser.parse
method, and it DOESN'T occur if I let the Xerces parser use its own
DocumentImpl class. So the EJB is definitely NOT finding my DocumentImpl
subclass when the DOMParser is looking for it.

The thing is, not only is that class present in the JAR file which contains
the EJB, it's also (the same exact version) found within the CLASSPATH used
by jBoss.

Any ideas why the classloader might not be able to find it? Are there
security restrictions or other gotcha's with using things like Class.forName
within an EJB?

Or am I just seeing a generic error report that really has little to do with
what ACTUALLY happened?



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to