Announcement Announcement Module
Collapse
No announcement yet.
Cannot convert value of type [java.util.Date] to required type [java.sql.Timestamp] Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot convert value of type [java.util.Date] to required type [java.sql.Timestamp]

    Hi,
    I am using Spring Flex 1.5.2.RELEASE with hibernate 3.6.4.Final .
    when I try to update a Object , sent from flex, I get the below error.

    Code:
    INFO: Channel endpoint my-amf received request.
    [BlazeDS]Error deserializing client message.
    org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'screenCreateTime'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.util.Date] to required type [java.sql.Timestamp] for property 'screenCreateTime': 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:1079)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:880)
    	at org.springframework.flex.core.io.SpringPropertyProxy.setValue(SpringPropertyProxy.java:182)
    	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.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$$f235ce77.service(<generated>)
    	at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerAdapter.java:109)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
    	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:641)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
    	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
    	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    	at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.util.Date] to required type [java.sql.Timestamp] for property 'screenCreateTime': 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)
    	... 69 more
    My Model Class is

    Code:
    @Entity
    @Table(name = "CMSCREEN_TB")
    public class Screen implements Serializable {
        @Id
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ScreenSeq")
        @SequenceGenerator(sequenceName = "CMSCREEN_SEQ", name = "ScreenSeq")
        @Column(name = "screen_id")
        private int screenId;
        @Column(name = "screen_name", unique = true, nullable = false, length = 20)
        private String screenName;
        @Column(name = "screen_create_userid", nullable = false, length = 10)
        private String screenCreateUserid;
        @Column(name = "screen_create_time", nullable = false)
        private Timestamp screenCreateTime;
        @Column(name = "screen_update_userid", nullable = false, length = 10)
        private String screenUpdateUserid;
        @Column(name = "screen_update_time", nullable = false)
        private Timestamp screenUpdateTime;
    
    .....
    In Flex Action Script class I have mentioned the remote class.

    When I Query the Object, the time stamp is available to flex client. the problem happens when the request from Flex is de serialized.
    Any help is appreciated.
Working...
X