Exposing Subclasses as RemoteProxy

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Exposing Subclasses as RemoteProxy

Jamie Johnson
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

david@butterdev.com
It would be helpful if you could send us your complete configuration and code.  For example is the method you are calling overridden?

On 02/21/2014 03:13 PM, Jamie Johnson wrote:
I'm having some issues exposing a Subclass as a RemoteProxy and was curious if this was something related to my setup or if this was not supported in DWR?  My setup has several methods exposed by the super class and several overriden by the sub class.  When accessing a method that is in the super class I get an exception saying the following:

cause:null,javaClassName:"java.lang.ClassCastException",localizedMessage:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",message:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",stackTrace:

I also see this:

Missing type info for (method=updateUserAuthority(class java.lang.String, interface java.util.List), parameter: 1). Assuming this is a map with String keys. Please add to <signatures> in dwr.xml

I'd expect this if I was running JDK 1.4 and DWR 2.x, but we're running JDK 1.6 DWR 3RC2.  The method on the super class is defined as follows:

public List<UserAuthority> updateUserAuthority(String login, List<UserAuthority> list)

          
Should this work or am I trying to accomplish something that can't be done?

          
As a work around we've decided to create a facade class that delegates to the specific implementation that is injected into the facade, while not ideal this appears to solve the issue.

          
Thanks in advance

          
-Jamie

Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

Jamie Johnson
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

david@butterdev.com
Thanks for investigating this in more detail.  Can you send me your Spring/DWR configuration as well as the class and the super class you are trying to expose so that I have the complete picture before I start looking into it?

On 02/21/2014 07:29 PM, Jamie Johnson wrote:
Hi David,

So I think I may have stumbled across the issue, and I apologize for over simplifying my example.  So the full story.  My beans are being created by spring and as such are spring proxies.  I see that you have code to handle spring proxies, but when a proxy is created for a class that has methods exposed on the super class it appears that the method is not found and thus not exposed.  Specifically looking at org.directwebremoting.impl.CreatorModule.checkProxiedMethod when attempting to get the realMethod getDeclaredMethod is called, unfortunately in my case the method of interest is declared in the super class, which getDeclaredClass does not get, I believe that if this was instead getMethod that it would work as I intend and would return the parents method.  I hope this makes sense, it took me and a colleague a while to find this.



On Fri, Feb 21, 2014 at 7:01 PM, David Marginian <[hidden email]> wrote:
It would be helpful if you could send us your complete configuration and code.  For example is the method you are calling overridden?


On 02/21/2014 03:13 PM, Jamie Johnson wrote:
I'm having some issues exposing a Subclass as a RemoteProxy and was curious if this was something related to my setup or if this was not supported in DWR?  My setup has several methods exposed by the super class and several overriden by the sub class.  When accessing a method that is in the super class I get an exception saying the following:

cause:null,javaClassName:"java.lang.ClassCastException",localizedMessage:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",message:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",stackTrace:

I also see this:

Missing type info for (method=updateUserAuthority(class java.lang.String, interface java.util.List), parameter: 1). Assuming this is a map with String keys. Please add to <signatures> in dwr.xml

I'd expect this if I was running JDK 1.4 and DWR 2.x, but we're running JDK 1.6 DWR 3RC2.  The method on the super class is defined as follows:

public List<UserAuthority> updateUserAuthority(String login, List<UserAuthority> list)
Should this work or am I trying to accomplish something that can't be done?
As a work around we've decided to create a facade class that delegates to the specific implementation that is injected into the facade, while not ideal this appears to solve the issue.
Thanks in advance
-Jamie



Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

Jamie Johnson
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

Jamie Johnson
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

Mike Wilson
Administrator
In reply to this post by Jamie Johnson
Hi Jamie,
 
You found a tricky detail in a tricky workaround ;-)
I looked through the code and I think your suggestion makes total sense. As we are calling getDeclaredMethod() we are currently only looking at the class "closest" to the proxy.
 
David: I think we are totally safe (and correct) in switching to getMethod() instead, but it'd be great if you'd like to look it through as well :)
 
Best regards
Mike Wilson
 
Jamie Johnson wrote:
Hi David,

So I think I may have stumbled across the issue, and I apologize for over simplifying my example.  So the full story.  My beans are being created by spring and as such are spring proxies.  I see that you have code to handle spring proxies, but when a proxy is created for a class that has methods exposed on the super class it appears that the method is not found and thus not exposed.  Specifically looking at org.directwebremoting.impl.CreatorModule.checkProxiedMethod when attempting to get the realMethod getDeclaredMethod is called, unfortunately in my case the method of interest is declared in the super class, which getDeclaredClass does not get, I believe that if this was instead getMethod that it would work as I intend and would return the parents method.  I hope this makes sense, it took me and a colleague a while to find this.



On Fri, Feb 21, 2014 at 7:01 PM, David Marginian <[hidden email]> wrote:
It would be helpful if you could send us your complete configuration and code.  For example is the method you are calling overridden?


On 02/21/2014 03:13 PM, Jamie Johnson wrote:
I'm having some issues exposing a Subclass as a RemoteProxy and was curious if this was something related to my setup or if this was not supported in DWR?  My setup has several methods exposed by the super class and several overriden by the sub class.  When accessing a method that is in the super class I get an exception saying the following:

cause:null,javaClassName:"java.lang.ClassCastException",localizedMessage:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",message:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",stackTrace:

I also see this:

Missing type info for (method=updateUserAuthority(class java.lang.String, interface java.util.List), parameter: 1). Assuming this is a map with String keys. Please add to <signatures> in dwr.xml

I'd expect this if I was running JDK 1.4 and DWR 2.x, but we're running JDK 1.6 DWR 3RC2.  The method on the super class is defined as follows:

public List<UserAuthority> updateUserAuthority(String login, List<UserAuthority> list)
Should this work or am I trying to accomplish something that can't be done?
As a work around we've decided to create a facade class that delegates to the specific implementation that is injected into the facade, while not ideal this appears to solve the issue.
Thanks in advance
-Jamie


Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

Jamie Johnson
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

david@butterdev.com
In reply to this post by Mike Wilson
I looked it through and I agree.  I went ahead and committed the fix to trunk. 

On 02/22/2014 04:57 AM, Mike Wilson wrote:
Hi Jamie,
 
You found a tricky detail in a tricky workaround ;-)
I looked through the code and I think your suggestion makes total sense. As we are calling getDeclaredMethod() we are currently only looking at the class "closest" to the proxy.
 
David: I think we are totally safe (and correct) in switching to getMethod() instead, but it'd be great if you'd like to look it through as well :)
 
Best regards
Mike Wilson
 
Jamie Johnson wrote:
Hi David,

So I think I may have stumbled across the issue, and I apologize for over simplifying my example.  So the full story.  My beans are being created by spring and as such are spring proxies.  I see that you have code to handle spring proxies, but when a proxy is created for a class that has methods exposed on the super class it appears that the method is not found and thus not exposed.  Specifically looking at org.directwebremoting.impl.CreatorModule.checkProxiedMethod when attempting to get the realMethod getDeclaredMethod is called, unfortunately in my case the method of interest is declared in the super class, which getDeclaredClass does not get, I believe that if this was instead getMethod that it would work as I intend and would return the parents method.  I hope this makes sense, it took me and a colleague a while to find this.



On Fri, Feb 21, 2014 at 7:01 PM, David Marginian <[hidden email]> wrote:
It would be helpful if you could send us your complete configuration and code.  For example is the method you are calling overridden?


On 02/21/2014 03:13 PM, Jamie Johnson wrote:
I'm having some issues exposing a Subclass as a RemoteProxy and was curious if this was something related to my setup or if this was not supported in DWR?  My setup has several methods exposed by the super class and several overriden by the sub class.  When accessing a method that is in the super class I get an exception saying the following:

cause:null,javaClassName:"java.lang.ClassCastException",localizedMessage:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",message:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",stackTrace:

I also see this:

Missing type info for (method=updateUserAuthority(class java.lang.String, interface java.util.List), parameter: 1). Assuming this is a map with String keys. Please add to <signatures> in dwr.xml

I'd expect this if I was running JDK 1.4 and DWR 2.x, but we're running JDK 1.6 DWR 3RC2.  The method on the super class is defined as follows:

public List<UserAuthority> updateUserAuthority(String login, List<UserAuthority> list)
Should this work or am I trying to accomplish something that can't be done?
As a work around we've decided to create a facade class that delegates to the specific implementation that is injected into the facade, while not ideal this appears to solve the issue.
Thanks in advance
-Jamie



Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

Jamie Johnson
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

Vojtěch Knyttl
In reply to this post by david@butterdev.com
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

david@butterdev.com
1) We have a link on our support page to the java.net site which shows you exactly how to unsubscribe.  It is not difficult at all:
https://java.net/projects/help/pages/MailingLists#Using_Mailing_Lists

2) See the notice in red on our home-page - http://directwebremoting.org/dwr/index.html.  Or, take a look at the mailing list as there have been several discussions about this.

On 02/22/2014 12:16 PM, Vojtěch Knyttl wrote:
these links are broken:


also, unsubscribing from this list is pain.

Vojtěch Knyttl | GoOut

+420 607 008 510

On Saturday, February 22, 2014 at 8:03 PM, David Marginian wrote:

I looked it through and I agree.  I went ahead and committed the fix to trunk. 

On 02/22/2014 04:57 AM, Mike Wilson wrote:
Hi Jamie,
 
You found a tricky detail in a tricky workaround ;-)
I looked through the code and I think your suggestion makes total sense. As we are calling getDeclaredMethod() we are currently only looking at the class "closest" to the proxy.
 
David: I think we are totally safe (and correct) in switching to getMethod() instead, but it'd be great if you'd like to look it through as well :)
 
Best regards
Mike Wilson
 
Jamie Johnson wrote:
Hi David,

So I think I may have stumbled across the issue, and I apologize for over simplifying my example.  So the full story.  My beans are being created by spring and as such are spring proxies.  I see that you have code to handle spring proxies, but when a proxy is created for a class that has methods exposed on the super class it appears that the method is not found and thus not exposed.  Specifically looking at org.directwebremoting.impl.CreatorModule.checkProxiedMethod when attempting to get the realMethod getDeclaredMethod is called, unfortunately in my case the method of interest is declared in the super class, which getDeclaredClass does not get, I believe that if this was instead getMethod that it would work as I intend and would return the parents method.  I hope this makes sense, it took me and a colleague a while to find this.



On Fri, Feb 21, 2014 at 7:01 PM, David Marginian <[hidden email]> wrote:
It would be helpful if you could send us your complete configuration and code.  For example is the method you are calling overridden?


On 02/21/2014 03:13 PM, Jamie Johnson wrote:
I'm having some issues exposing a Subclass as a RemoteProxy and was curious if this was something related to my setup or if this was not supported in DWR?  My setup has several methods exposed by the super class and several overriden by the sub class.  When accessing a method that is in the super class I get an exception saying the following:

cause:null,javaClassName:"java.lang.ClassCastException",localizedMessage:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",message:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",stackTrace:

I also see this:

Missing type info for (method=updateUserAuthority(class java.lang.String, interface java.util.List), parameter: 1). Assuming this is a map with String keys. Please add to <signatures> in dwr.xml

I'd expect this if I was running JDK 1.4 and DWR 2.x, but we're running JDK 1.6 DWR 3RC2.  The method on the super class is defined as follows:

public List<UserAuthority> updateUserAuthority(String login, List<UserAuthority> list)
Should this work or am I trying to accomplish something that can't be done?
As a work around we've decided to create a facade class that delegates to the specific implementation that is injected into the facade, while not ideal this appears to solve the issue.
Thanks in advance
-Jamie





Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

david@butterdev.com
In reply to this post by Jamie Johnson
Jamie, there is no solid plan, but we would like to.  Mainly we are waiting on a reverse AJAX fix.  Right now our CI (Bamboo) server and Jira are down which is making things difficult to assess.  I am working on this but for anyone that has administered these, you know how painful it is to recover from a complete crash.  The major changes were bug fixes that should not negatively impact you.  I would do some regression tests on your application and if everything looks good I would feel comfortable using trunk.

On 02/22/2014 12:15 PM, Jamie Johnson wrote:
Thanks David.  Quick question.  With the latest official release being 3.0RC2 is there a plan to make a release off of trunk anytime in the near future?  Also what differences exist between the trunk and RC2 that I should be concerned about if I wanted to use latest development build?


On Sat, Feb 22, 2014 at 2:03 PM, David Marginian <[hidden email]> wrote:
I looked it through and I agree.  I went ahead and committed the fix to trunk. 

On 02/22/2014 04:57 AM, Mike Wilson wrote:
Hi Jamie,
 
You found a tricky detail in a tricky workaround ;-)
I looked through the code and I think your suggestion makes total sense. As we are calling getDeclaredMethod() we are currently only looking at the class "closest" to the proxy.
 
David: I think we are totally safe (and correct) in switching to getMethod() instead, but it'd be great if you'd like to look it through as well :)
 
Best regards
Mike Wilson
 
Jamie Johnson wrote:
Hi David,

So I think I may have stumbled across the issue, and I apologize for over simplifying my example.  So the full story.  My beans are being created by spring and as such are spring proxies.  I see that you have code to handle spring proxies, but when a proxy is created for a class that has methods exposed on the super class it appears that the method is not found and thus not exposed.  Specifically looking at org.directwebremoting.impl.CreatorModule.checkProxiedMethod when attempting to get the realMethod getDeclaredMethod is called, unfortunately in my case the method of interest is declared in the super class, which getDeclaredClass does not get, I believe that if this was instead getMethod that it would work as I intend and would return the parents method.  I hope this makes sense, it took me and a colleague a while to find this.



On Fri, Feb 21, 2014 at 7:01 PM, David Marginian <[hidden email]> wrote:
It would be helpful if you could send us your complete configuration and code.  For example is the method you are calling overridden?


On 02/21/2014 03:13 PM, Jamie Johnson wrote:
I'm having some issues exposing a Subclass as a RemoteProxy and was curious if this was something related to my setup or if this was not supported in DWR?  My setup has several methods exposed by the super class and several overriden by the sub class.  When accessing a method that is in the super class I get an exception saying the following:

cause:null,javaClassName:"java.lang.ClassCastException",localizedMessage:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",message:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",stackTrace:

I also see this:

Missing type info for (method=updateUserAuthority(class java.lang.String, interface java.util.List), parameter: 1). Assuming this is a map with String keys. Please add to <signatures> in dwr.xml

I'd expect this if I was running JDK 1.4 and DWR 2.x, but we're running JDK 1.6 DWR 3RC2.  The method on the super class is defined as follows:

public List<UserAuthority> updateUserAuthority(String login, List<UserAuthority> list)
Should this work or am I trying to accomplish something that can't be done?
As a work around we've decided to create a facade class that delegates to the specific implementation that is injected into the facade, while not ideal this appears to solve the issue.
Thanks in advance
-Jamie





Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

Jamie Johnson
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

david@butterdev.com
Generally, we don't make announcements like that.  We are a very small team, we have full-time jobs and other obligations and it is extremely difficult to make estimates. 

On 02/22/2014 03:20 PM, Jamie Johnson wrote:
Thanks David.  When things settle down will an announcement be made indicating a release time frame?


On Sat, Feb 22, 2014 at 4:22 PM, David Marginian <[hidden email]> wrote:
Jamie, there is no solid plan, but we would like to.  Mainly we are waiting on a reverse AJAX fix.  Right now our CI (Bamboo) server and Jira are down which is making things difficult to assess.  I am working on this but for anyone that has administered these, you know how painful it is to recover from a complete crash.  The major changes were bug fixes that should not negatively impact you.  I would do some regression tests on your application and if everything looks good I would feel comfortable using trunk.


On 02/22/2014 12:15 PM, Jamie Johnson wrote:
Thanks David.  Quick question.  With the latest official release being 3.0RC2 is there a plan to make a release off of trunk anytime in the near future?  Also what differences exist between the trunk and RC2 that I should be concerned about if I wanted to use latest development build?


On Sat, Feb 22, 2014 at 2:03 PM, David Marginian <[hidden email]> wrote:
I looked it through and I agree.  I went ahead and committed the fix to trunk. 

On 02/22/2014 04:57 AM, Mike Wilson wrote:
Hi Jamie,
 
You found a tricky detail in a tricky workaround ;-)
I looked through the code and I think your suggestion makes total sense. As we are calling getDeclaredMethod() we are currently only looking at the class "closest" to the proxy.
 
David: I think we are totally safe (and correct) in switching to getMethod() instead, but it'd be great if you'd like to look it through as well :)
 
Best regards
Mike Wilson
 
Jamie Johnson wrote:
Hi David,

So I think I may have stumbled across the issue, and I apologize for over simplifying my example.  So the full story.  My beans are being created by spring and as such are spring proxies.  I see that you have code to handle spring proxies, but when a proxy is created for a class that has methods exposed on the super class it appears that the method is not found and thus not exposed.  Specifically looking at org.directwebremoting.impl.CreatorModule.checkProxiedMethod when attempting to get the realMethod getDeclaredMethod is called, unfortunately in my case the method of interest is declared in the super class, which getDeclaredClass does not get, I believe that if this was instead getMethod that it would work as I intend and would return the parents method.  I hope this makes sense, it took me and a colleague a while to find this.



On Fri, Feb 21, 2014 at 7:01 PM, David Marginian <[hidden email]> wrote:
It would be helpful if you could send us your complete configuration and code.  For example is the method you are calling overridden?


On 02/21/2014 03:13 PM, Jamie Johnson wrote:
I'm having some issues exposing a Subclass as a RemoteProxy and was curious if this was something related to my setup or if this was not supported in DWR?  My setup has several methods exposed by the super class and several overriden by the sub class.  When accessing a method that is in the super class I get an exception saying the following:

cause:null,javaClassName:"java.lang.ClassCastException",localizedMessage:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",message:"java.lang.String cannot be cast to com.foo.bar.UserAuthority",stackTrace:

I also see this:

Missing type info for (method=updateUserAuthority(class java.lang.String, interface java.util.List), parameter: 1). Assuming this is a map with String keys. Please add to <signatures> in dwr.xml

I'd expect this if I was running JDK 1.4 and DWR 2.x, but we're running JDK 1.6 DWR 3RC2.  The method on the super class is defined as follows:

public List<UserAuthority> updateUserAuthority(String login, List<UserAuthority> list)
Should this work or am I trying to accomplish something that can't be done?
As a work around we've decided to create a facade class that delegates to the specific implementation that is injected into the facade, while not ideal this appears to solve the issue.
Thanks in advance
-Jamie







Reply | Threaded
Open this post in threaded view
|

Re: Exposing Subclasses as RemoteProxy

Jamie Johnson
CONTENTS DELETED
The author has deleted this message.