SerializationException on blazeds-spring-boot-starter.4.7.3

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view

SerializationException on blazeds-spring-boot-starter.4.7.3

I am using blazeds-spring-boot-starter.4.7.3 snapshot.
I got an error
"Creation validation for class 'example.dto.BasicDto' failed."
at the time sending object data from flex to java.

Any pointers to the cause and the solution will be a great help.

error message:
Deserializing AMF/HTTP request
Version: 3
  (Message #0 targetURI=null, responseURI=/4)
    (Array #0)
      [0] = (Typed Object #0 'flex.messaging.messages.RemotingMessage')
        source = null
        operation = "paramObject"
        messageId = "4251E583-6ECC-0999-7C77-D56D4D77044E"
        body = (Array #1)
          [0] =
Serializing AMF/HTTP response
Version: 3
  (Message #0 targetURI=/4/onStatus, responseURI=)
    (Typed Object #0 'flex.messaging.messages.ErrorMessage')
      headers = (Object #1)
      clientId = null
      destination = null
      messageId = "C3102DF1-0C0F-701D-8503-DF6B335245A7"
      faultDetail = null
      body = null
      timeToLive = 0.0
      faultCode = "Client.Message.Encoding"
      faultString = "Creation validation for class 'example.dto.BasicDto' failed."
      rootCause = null
      correlationId = null
      timestamp = 1.489639403468E12
      extendedData = null

sample code:
--- MovementServiceImpl .java ---
package example;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.stereotype.Service;
import example.dto.BasicDto;
public class MovementServiceImpl {
        // OK
        public String paramDate(Date date){
        Calendar cal1 = Calendar.getInstance();
        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
        cal1.add(Calendar.MONTH, 1);
                return sdf1.format(cal1.getTime());
    // NG
    public BasicDto paramObject(BasicDto dto) { = 100; = + " from Java"; = new Date();
        return dto;

--- ---
package example.dto;
import java.util.Date;
public class BasicDto {
        public Integer id;
        public String name;
        public Date date;

--- Main.mxml ---
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="" 
                           xmlns:mx="library://" minWidth="955" minHeight="600">
                <s:RemoteObject id="moveService"
                                                fault="onFault(event)" result="onResult(event)">
                        <s:method name="paramObject"/>
                        <s:method name="paramDate"/>
			import mx.utils.ObjectUtil;
			import example.dto.BasicDto;

			private function onFault(event:FaultEvent):void{
			private function onResult(event:ResultEvent):void{
			protected function param1_clickHandler(event:MouseEvent):void
				var dto:BasicDto = new BasicDto(); = 700; = "from Flex"; = new Date();


        <s:HGroup width="100%" height="100%">
                <s:Button label="Object Param" click="param1_clickHandler(event)"/>
                <s:Button label="Date Param" click="moveService.paramDate(new Date())"/>

--- ---
package example.dto
        public class BasicDto
                public var id:Number;
                public var name:String;
                public var date:Date;
Reply | Threaded
Open this post in threaded view

Re: SerializationException on blazeds-spring-boot-starter.4.7.3

did you fix this?

I fixed it rolling back the version to 4.7.2
Reply | Threaded
Open this post in threaded view

Re: SerializationException on blazeds-spring-boot-starter.4.7.3

as Josh Tynjala says:

According to the release notes for BlazeDS 4.7.3, classes must be
whitelisted in order to be deserialized by ClassDeserializationValidator.
Perhaps that is what you are encountering.