Re: OGNL ClassCastException

2009-02-16 Thread Musachy Barroso
If you can create an xwork ticket and attach a patch it will be appreciated :) musachy On Mon, Feb 16, 2009 at 5:52 AM, Adam Hardy wrote: > I figured out how to get my struts-default.xml to be loaded, in case you > were going tell me how after I asked :O > > Consequently discovered that XWorkCol

Re: OGNL ClassCastException

2009-02-16 Thread Adam Hardy
I figured out how to get my struts-default.xml to be loaded, in case you were going tell me how after I asked :O Consequently discovered that XWorkCollectionPropertyAccessor is actually compiled into Struts2 / XWork to allow work-arounds for OGNL, so it's not configurable. I'll build my own

Re: OGNL ClassCastException

2009-02-16 Thread Adam Hardy
I use Sets too and they're not the problem here. The reason why this bug occurs is because the proxy that is returned by my entity bean is not recognised as an ArrayList by OGNL. Rather OGNL sees it as a Collection. I guess this is just a rare situation and a difficult one to follow. In this c

Re: OGNL ClassCastException

2009-02-15 Thread Musachy Barroso
It could be a bug, but I doubt it, I have used sets before and it works. Just as a test, try returning an empty HashSet from your method, instead of the proxy that it is returning now, and see if that works. musachy On Sun, Feb 15, 2009 at 7:14 PM, Adam Hardy wrote: > Correct me if I'm wrong but

Re: OGNL ClassCastException

2009-02-15 Thread Adam Hardy
Correct me if I'm wrong but this looks like a fundamental class mismatch. I can see in struts-default.xml that both Sets and Collections are configured to be accessed by the same PropertyAccessor. From debugging, I can see OGNL picks the PropertyAccessor for Collections to deal with my target

Re: OGNL ClassCastException

2009-02-14 Thread Adam Hardy
Yes, it is a JPA entity bean proxied by OpenJPA. It has a list property - the bean is a parent in a parent-child relationship and this property is the list of children. This is the incoming HTTP parameter: portfolio.weightings[0]=123 Despite debugging it I am still not sure what has happened

Re: OGNL ClassCastException

2009-02-13 Thread Musachy Barroso
It seems like it is not a list but a proxy to it "org.apache.openjpa.util.java$util$ArrayList$proxy" which could be the root of the problem. musachy On Fri, Feb 13, 2009 at 12:00 PM, Adam Hardy wrote: > I have a situation where OGNL seems to be misinterpreting the class of the > HTTP parameter p

OGNL ClassCastException

2009-02-13 Thread Adam Hardy
I have a situation where OGNL seems to be misinterpreting the class of the HTTP parameter property it is setting during the ParameterInterceptor call. As you can see from the exception message, the object is an ArrayList and certainly not a Set which OGNL thinks it is. I have double, triple and