Hallo, ich mache einige Tests über eine AMF-Verbindung, um die
Performances zu testen eines Dienstes, der in einer application
Server-Instanz von wildfly8 implementiert wird, die einen komplexen
Entitätstyp speichert. Diese Entität enthält ein Feld wie:
private Quantity quantity = null;
Wenn die Menge ein Objekt ist.
public class Quantity implements Serializable
Wenn dieses Feld bewertet wird, wird eine Ausnahme
ausgelöst:
javax.ejb.EJBTransactionRolledbackException: java.lang.Double cannot be cast to java.lang.Float
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:163)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:253)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:342)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
Caused by: java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Float
at org.hibernate.type.descriptor.java.FloatTypeDescriptor.unwrap(FloatTypeDescriptor.java:36)
at org.hibernate.type.descriptor.sql.RealTypeDescriptor$1.doBind(RealTypeDescriptor.java:64)
at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:90)
at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:286)
at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:281)
at org.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:367)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2843)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3121)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3581)`
Wie in diesem Link vorgeschlagen ( http://flexblog.faratasystems.com
/index.php/custom-type-masrhaller-in-blazeds ) Ich habe
versucht, die Methode ASTranslator.convert (Object source, Class
sinedClass) mit einem NumberDecoder zu überschreiben, um ein in
BlazeDS bekanntes Problem zu lösen, aber nichts hat sich
geändert.
Das Problem besteht darin, dass Flex-Java-Wrapperklassen (d. H.
Float, Double, Long, Integer, Short, Byte, BigDecimal und
BigInteger) und einfache Typen (d. H. Float, double, long, int,
short, Byte) in den AS3-Zahlentyp gemarshallt werden.