Hi George, >From the last thread I still believe the issue revolves around the PropertyEditor/registering of the property editor in the controller. Could you post the initBinder() method from your controller?
Mike On 10/17/07, George.Francis <[EMAIL PROTECTED]> wrote: > > > I am using Spring MVC with hibernate. my Application pojo has a Customer > associated with it. The association is made via a 'customer_fk' column on > the Application table of type int8, which stores the id of the associated > Customer. > when I edit an Application what has a Customer assigned, I get the > following exception > > [ismid] ERROR [http-8080-Processor25] OptionsTag.doStartTag(84) | > java.lang.Long cannot be cast to com.ism.ismid.model.Customer > java.lang.ClassCastException: java.lang.Long cannot be cast to > com.ism.ismid.model.Customer > at com.ism.ismid.model.Customer.equals(Customer.java:35) > at > org.springframework.util.ObjectUtils.nullSafeEquals(ObjectUtils.java:170) > at > > org.springframework.web.servlet.tags.form.SelectedValueComparator.isSelected > (SelectedValueComparator.java:90) > at > org.springframework.web.servlet.tags.form.OptionWriter.isSelected( > OptionWriter.java:184) > at > org.springframework.web.servlet.tags.form.OptionWriter.renderOption( > OptionWriter.java:172) > > I already have a CustomerEditor which is working when i _create_ an > Application entity with an assigned Customer. This exception occurs when > I > try to _edit_ the same entity. > It seems like the CustomerEditor works when creating the Application > because > it is being used to deserialise a Customer from customer_id in the form of > a > String , but in the Edit case, the Customer needs to be converted from a > Long. > Any ideas? > > -- > View this message in context: > http://www.nabble.com/equals%28%29-method-throws-ClassCastException-when-editing-tf4643285s2369.html#a13262804 > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
