Perhaps this thread will help you?
http://forum.springframework.org/archive/index.php/t-29565.html
On Fri, May 30, 2008 at 3:20 PM, David Nedrow <[EMAIL PROTECTED]> wrote:
>
> On May 30, 2008, at 2:26 PM, James Carman wrote:
>
>> Take a look at what classloaders loaded each of the classes. If the
>> class names are the same, then that means that they were loaded by two
>> different classloaders. How are you setting up your application? Are
>> all jars in your WEB-INF/lib directory?
>
> I added the following to just before line that causes the cast failure...
>
> java.lang.ClassLoader ctxCl =
> Thread.currentThread().getContextClassLoader();
> java.lang.ClassLoader tcCl =
> Protocol.class.getClassLoader();
> java.lang.ClassLoader soCl =
> item.getModelObject().getClass().getClassLoader();
>
> System.out.println("ctxCl=" + ((ctxCl == null)
> ? "null"
> : ctxCl.toString()));
> System.out.println("tcCl=" + ((tcCl == null)
> ? "null"
> : tcCl.toString()));
> System.out.println("soCl=" + ((soCl == null)
> ? "null"
> : soCl.toString()));
>
> Below is the run output, which would appear to show WebAppClassloader for
> the target, and a Spring loader for the source. Isn't the whole point of
> Spring to do exactly that? Load classes dynamically? In any case, any
> suggestions, or should I hit the Spring forum now that it appear to be
> Spring specific?
>
> -David
>
> [TopLink Info]: 2008.05.30
> 03:07:21.737--ServerSession(878231)--file:/Users/dnedrow/Developer/NetBeansProjects/FilterRequest/build/web/WEB-INF/classes/-NetConfPU
> login successful
> finding all Protocol instances
> ctxCl=WebappClassLoader
> delegate: true
> repositories:
> /WEB-INF/classes/
> ----------> Parent Classloader:
> EJBClassLoader :
> urlSet = []
> doneCalled = false
> Parent -> [EMAIL PROTECTED]
> tcCl=WebappClassLoader
> delegate: true
> repositories:
> /WEB-INF/classes/
> ----------> Parent Classloader:
> EJBClassLoader :
> urlSet = []
> doneCalled = false
> Parent -> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]