Announcement Announcement Module
No announcement yet.
Can't register my Converter Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can't register my Converter

    I'm following the example <a href="">here</a>.

    My applicationContext has the following:

    <bean id="conversionService"
    class=" ionServiceFactoryBean">
    <property name="converters">
    <bean class="org.mypackage.MyFilterConverter"/>

    My converter looks like this:

    public class MyFilterConverter implements Converter<String, HashMap<String, List<MyClass>>> { ...

    The converter does not get registered. I tested MyFilterConverter independently and it works.

    I followed the stack trace down to GenericConversionService.getMatchableConverters(Cl ass<?> sourceType, Class<?> targetType). It seems to me that the bug is that the matchable is not added to anything. Anyway, I wasn't able to follow the code through, but it looks like there's where the thing gets lost.

    When I come back from this call, my converter is not added.

    Any ideas?



  • #2

    1) Next time use code tags
    2) Post the complete error stack trace to analyze it


    • #3
      First of all I can see the space between "Convers" and "ionServiceFactoryBean" . is that ok?
      Second what us your Converter interface? better to use "org.springframework.core.convert.converter.Generi cConverter" interface

      There are Two method signature in CustomConverter Class
      1) Set<ConvertiblePair> getConvertibleTypes()

      this method will get involved once at initialroading
      and make decision pair of conversion type for calling back later

      2)Object convert(Object source, TypeDescriptor sourceType,
      TypeDescriptor targetType)

      This method will calling back every time for proper matching