Hi
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;
@Service("movementService")
@RemotingDestination
public class MovementServiceImpl {
// OK
public String paramDate(Date date){
Calendar cal1 = Calendar.getInstance();
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
cal1.setTime(date);
cal1.add(Calendar.MONTH, 1);
return sdf1.format(cal1.getTime());
}
// NG
public BasicDto paramObject(BasicDto dto) {
dto.id = 100;
dto.name = dto.name + " from Java";
dto.date = new Date();
return dto;
}
}
--- BasicDto.java ---
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="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955"
minHeight="600">
<fx:Declarations>
<s:RemoteObject id="moveService"
destination="movementService"
endpoint="http://localhost:8080/messagebroker/short-polling-amf"
fault="onFault(event)"
result="onResult(event)">
<s:method name="paramObject"/>
<s:method name="paramDate"/>
</s:RemoteObject>
</fx:Declarations>
<fx:Script>
</fx:Script>
<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())"/>
</s:HGroup>
</s:Application>
--- BasicDto.as ---
package example.dto
{
[RemoteClass(alias="example.dto.BasicDto")]
public class BasicDto
{
public var id:Number;
public var name:String;
public var date:Date;
}
}
--
View this message in context:
http://apache-flex-users.2333346.n4.nabble.com/SerializationException-on-blazeds-spring-boot-starter-4-7-3-tp14819.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.