On Jan 16, 2008 7:50 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I ran into a classloading issue with embedded Tomcat. In the
> helloworld-ws-reference test case, we use SCATestCaseRunner to run the
> service with binding.ws in a new classloader (CL2) derived from the
> client-side classloader (CL1). When the embedded tomcat is started, it
> creates a WebAppClassLoader (CL3) and uses it as the Thread context
> classloader. The WebAppClassLoader first tries to find a class in the
> system
> classloader (which is CL1) before it delegates to its parent (which is set
> to be CL2). As a result, the JAXBContextImpl is loaded by CL1 instead of
> CL2
> and it causes a ClassCastException against the JAXBContext interface
> loaded
> by CL2.
>
> In our usage of embedded tomcat, the application is not really a web
> application. We mostly use the tomcat as an HTTP server. I propose that we
> replace the heavy WebAppLoader (which handles dynamic reloading too) with
> an
> internal implementation which provides CL2 as the classloader. I have
> tested
> the code locally. If there is no objection, I'll commit it.
>
> Thanks,
> Raymond
>

I may have some concerns but i'm not sure I completely understand the
sequence of events described above but its probably easier to just see the
code than ask a lot of questions so I'd say just go ahead and commit as
you've already done it locally.

   ...ant

Reply via email to