Announcement Announcement Module
Collapse
No announcement yet.
1.5.0 snapshot - converter error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 1.5.0 snapshot - converter error

    Getting following error when call remoteObject method with POJO entity which have java.util.Calendar field:

    java POJO:

    Code:
    public class CompanyPrice implements Serializable {
    
            private Long id;
            ....
    	private Date priceActualFrom;
    	private Date priceActualTill;
            ....
            private Calendar lastEdited;
    AS3 class:

    Code:
    [Bindable]
    [RemoteClass(alias="blah.blah.model.entities.company.CompanyPrice")]
        public class CompanyPriceBase {
    
            private var _id:Number;
            ....
            private var _priceActualFrom:Date;
            private var _priceActualTill:Date;
            ....
            private var _lastEdited:Date;
    Code:
    15:00:38,765 TRACE GenericConversionService:139 - Checking if I can convert [TypeDescriptor java.util.Date] to [TypeDescriptor java.util.Calendar]
    15:00:38,765 TRACE GenericConversionService:357 - Searching for converters indexed by sourceType [java.util.Date]
    15:00:38,765 TRACE GenericConversionService:427 - and indexed by targetType [java.util.Calendar]
    15:00:38,765 TRACE GenericConversionService:427 - and indexed by targetType [java.io.Serializable]
    15:00:38,766 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Cloneable]
    15:00:38,766 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Comparable]
    15:00:38,766 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Object]
    15:00:38,766 TRACE GenericConversionService:357 - Searching for converters indexed by sourceType [java.io.Serializable]
    15:00:38,767 TRACE GenericConversionService:427 - and indexed by targetType [java.util.Calendar]
    15:00:38,767 TRACE GenericConversionService:427 - and indexed by targetType [java.io.Serializable]
    15:00:38,767 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Cloneable]
    15:00:38,767 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Comparable]
    15:00:38,768 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Object]
    15:00:38,768 TRACE GenericConversionService:357 - Searching for converters indexed by sourceType [java.lang.Cloneable]
    15:00:38,768 TRACE GenericConversionService:427 - and indexed by targetType [java.util.Calendar]
    15:00:38,768 TRACE GenericConversionService:427 - and indexed by targetType [java.io.Serializable]
    15:00:38,768 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Cloneable]
    15:00:38,769 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Comparable]
    15:00:38,769 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Object]
    15:00:38,769 TRACE GenericConversionService:357 - Searching for converters indexed by sourceType [java.lang.Comparable]
    15:00:38,769 TRACE GenericConversionService:427 - and indexed by targetType [java.util.Calendar]
    15:00:38,770 TRACE GenericConversionService:427 - and indexed by targetType [java.io.Serializable]
    15:00:38,770 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Cloneable]
    15:00:38,770 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Comparable]
    15:00:38,770 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Object]
    15:00:38,771 TRACE GenericConversionService:357 - Searching for converters indexed by sourceType [java.lang.Object]
    15:00:38,771 TRACE GenericConversionService:427 - and indexed by targetType [java.util.Calendar]
    15:00:38,771 TRACE GenericConversionService:427 - and indexed by targetType [java.io.Serializable]
    15:00:38,772 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Cloneable]
    15:00:38,772 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Comparable]
    15:00:38,772 TRACE GenericConversionService:427 - and indexed by targetType [java.lang.Object]
    15:00:38,772 TRACE GenericConversionService:267 - Caching NO_MATCH under ConverterCacheKey [sourceType = [TypeDescriptor java.util.Date], targetType = [TypeDescriptor java.util.Calendar]]
    15:00:38,773 TRACE GenericConversionService:151 - No, I cannot convert
    Error deserializing client message.
    org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.util.Calendar' for property 'created'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.util.Date] to required type [java.util.Calendar] for property 'created': no matching editors or conversion strategy found
    	at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:462)
    	at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:499)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1071)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:876)
    	at org.springframework.flex.core.io.SpringPropertyProxy.setValue(SpringPropertyProxy.java:98)
    	at flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:438)
    	at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:152)
    	at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:130)
    	at flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:437)
    	at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:152)
    	at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:130)
    	at flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:437)
    	at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:152)
    	at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:130)
    	at flex.messaging.io.amf.Amf3Input.readArray(Amf3Input.java:358)
    	at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:156)
    	at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:130)
    	at flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:437)
    	at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:152)
    	at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:130)
    	at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:123)
    	at flex.messaging.io.amf.Amf0Input.readArrayValue(Amf0Input.java:359)
    	at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:127)
    	at flex.messaging.io.amf.Amf0Input.readObject(Amf0Input.java:94)
    	at flex.messaging.io.amf.AmfMessageDeserializer.readObject(AmfMessageDeserializer.java:227)
    	at flex.messaging.io.amf.AmfMessageDeserializer.readBody(AmfMessageDeserializer.java:206)
    	at flex.messaging.io.amf.AmfMessageDeserializer.readMessage(AmfMessageDeserializer.java:126)
    	at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:145)
    	at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
    	at flex.messaging.endpoints.AMFEndpoint$$EnhancerByCGLIB$$c4211602.service(<generated>)
    	at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerAdapter.java:108)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:774)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
    	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at blah.blah.persistence.HibernateSessionFilter.doFilter(HibernateSessionFilter.java:30)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.util.Date] to required type [java.util.Calendar] for property 'created': no matching editors or conversion strategy found
    	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
    	at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:447)
    	... 51 more
    Trying to inject simple spring converter

    Code:
    final class DateToCalendarConverter implements Converter<Date, Calendar> {
    
    	public Calendar convert(Date source) {
    		Calendar ret = Calendar.getInstance();
            ret.setTime(source);
            return ret;
    	}
    }
    Code:
        <bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean">
    	    <property name="converters">
    	        <list>
                    <bean class="blah.blah.flex.springframework.core.convert.support.DateToCalendarConverter"/>
    	        </list>
    		</property>
    	</bean>
    has no success.

    SOS!
    Last edited by hubamujba; Oct 27th, 2010, 03:43 PM.

  • #2
    Are you injecting the ConversionService into the config processor as shown here?

    http://static.springsource.org/sprin...nate-io-config

    Comment


    • #3
      Is there any update on this issue? We are facing the same issue with java.util.Date to java.util.Calendar. We have tried to use a converter with no success. TIA, Shinan

      Comment

      Working...
      X