« Return to Thread:
Problems with multiple
XMaNIaC wrote:Let me guess...you're not implementing an interface?
On Thu, May 29, 2008 at 1:26 AM, krause wrote:
>
> I'm getting an "object is not an instance of declaring class" error from
> DWR... but not always:
> This problem presents depending on the actual order in which the spring's
> xml file is listed in the web.xml file (using the contextConfigLocation
> param). If I put my springDwr.xml file at the very end, everything works
> ok.
> If I put it somewhere in between I'm getting the described error.
>
> The exception is being thrown at ExecuteAjaxFilter class, which recieves as
> parameters an Object obj, and a Method method (among others).
> I set a breakpoint in ExecuteAjaxFilter and found out the following:
>
> When everything works ok, the debugger shows the following:
>
> obj $Proxy63 (id=138)
> h JdkDynamicAopProxy (id=165)
>
> method Method (id=147)
> clazz Class<T> ($Proxy63) (id=139)
> name "getClientDetails"
> returnType Class<T> (com.xxx.ClientDetails) (id=185)
>
> But when the problem presents itself, I get the following:
>
> obj $Proxy54 (id=105)
> h JdkDynamicAopProxy (id=153)
>
> method Method (id=111)
> clazz Class<T> (mx.xxx.RetrieveAccountInfoImpl) (id=68)
> name "getClientDetails"
> returnType Class<T> (com.xxx.ClientDetails) (id=201)
>
> As you can see (see bold text) the problem is that the class of the method
> object does not match the class of the actual object. In the first case
> both classes are $Proxy, while in the second case the object is a $Proxy
> but
> the method points to mx.xxx.RetrieveAccountInfoImpl (which is the proxied
> class).
>
> I have tried to replicate this problem in a small sample so that I can
> attach it, but haven't been able to reproduce this in a small scale.
>
> I don't understand why the position of the file in the web.xml file can
> affect this behaviour since Spring is supposed to load the complete context
> formed by all listed files, and once this is done it then processes the
> whole context resolving dependencies, creating proxies, injecting stuff,
> etc. Why not put the file at the end and stop complaining?... well
> actually, that is what we are doing but gets a little more complex since we
> have multiple dwr files for the different modules of the system.
>
> I would appreciate any pointers you can give regarding this issue.
> --
> View this message in context:
> http://www.nabble.com/Spring-%2B-dwr-file-order-%3D-object-is-not-instance-of-declared-type-%28sometimes%29-tp17524227p17524227.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>
« Return to Thread:
Problems with multiple
| Free Forum Powered by Nabble | Forum Help |