Steve Meister wrote:
>
> Solved part of the problem. My DocumentImpl subclass used some classes in a
> separate JAR file that I had not put into jBoss's reach. However, the
> interesting thing is that I added those classes to the EJB jar file and
> still got the same error, but when I added the classes to jBoss's classpath,
> I no longer got the error. Shouldn't the EJB be able to find all of the
> classes contained within its own JAR file?
Ok then that makes complete sense and it is probably a cousin of the bug
we were staring at yesterday night...
the VM 1.3 from SUN as a faulty "getLastDefinedUserContext"
implementation that returns the SytemClassLoader and not the COntext
Class Loader... we just filed a new Bug Report on SUN site (#104691 in
the bug parade).
And they have a 3 weeks response time...
Ok the way we fixed it yesterday (was a problem with the PRoxy in
ObjectInputStream) is we hacked the rt.jar source and added the
"getCOntextClassLoader" recompiled and put the whole thing in jre... it
worked... but it is ugly..
PLEASE TRY THE IBM VM, and let's see if this works... we are doing it
this morning and a nasty little machine we will let you know.
regards
marc
>
> -----Original Message-----
> From: Steve Meister [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 10, 2000 10:24 AM
> To: EJBOSS list (E-mail)
> Subject: More on Xerces-in-an-EJB
>
> 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]
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]