Announcement Announcement Module
Collapse
No announcement yet.
Conversion fails for generic typed class Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Conversion fails for generic typed class

    I have a class implementing a generic Entity<T extends Serializable>. The interface is defining a setId(T):void and a getId():T method. On the implementing class I define T as being a Long (giving setId(Long):void and getId():Long). I have an error whenever there's a binding to the id field.

    Stacktrace:
    org.springframework.core.convert.ConverterNotFound Exception: No converter found capable of converting from 'java.io.Serializable' to 'java.lang.String'
    at org.springframework.core.convert.support.GenericCo nversionService.convert(GenericConversionService.j ava:180)
    at org.springframework.expression.spel.support.Standa rdTypeConverter.convertValue(StandardTypeConverter .java:70)
    at org.springframework.expression.common.ExpressionUt ils.convertTypedValue(ExpressionUtils.java:67)
    at org.springframework.expression.spel.standard.SpelE xpression.getValue(SpelExpression.java:98)
    at org.springframework.binding.expression.spel.Spring ELExpression.getValue(SpringELExpression.java:78)
    at org.springframework.webflow.mvc.view.BindingModel. getFormattedValue(BindingModel.java:228)
    at org.springframework.webflow.mvc.view.BindingModel. getFieldValue(BindingModel.java:142)
    at org.springframework.web.servlet.support.BindStatus .<init>(BindStatus.java:120)

    The problem happens on windows machines (both xp and win7) while all works well on linux (ubuntu 10.10).

    This problem is almost identical to the one of issue https://jira.springframework.org/browse/SWF-881, that is closed as resolve in Web Flow 2.1.0.M1. I've also added a comment to it.

    Any idea. Thx.

    Environment:
    Spring 3.0.4, Web Flow 2.2.0, Java6, Tomcat 6
Working...
X