DEFECT? BlazeDS 4.7.3 ISSUE: SerializationException: Creation validation for class "<myClass>" failed.

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

DEFECT? BlazeDS 4.7.3 ISSUE: SerializationException: Creation validation for class "<myClass>" failed.

jaabax
This post was updated on .
I am not being able to communicate with the server with  the jars from flex-messaging-core, common, proxy and remoting version 4.7.3. When I change to 4.7.2 things work. Importante: the ONLY thing I change is the version on my pom.xml for it to work. No code changes at all.

I have the following test entity.

package test.package
{
        [Bindable]
        [RemoteClass(alias="test.package.Test")]
        public class Test
        {
                public function Test()
                {
                }
               
                private var _name:String
                private var _price:int;
               
                public function get name():String{
                        return _name;
                }
                public function get price():int{
                        return _price;
                }
                public function set name(name:String):void{
                        _name = name;
                }
                public function set price(price:int):void{
                        _price = price;
                }
               
        }
}

public class Test implements Serializable {
       
        private String name;
    private int price;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getPrice() {
        return price;
    }
    public void setPrice(int price) {
        this.price = price;
    }

}

I checked the source code and on the class ClassDeserializationValidator my Test entity goes into Set<String> disallowClasses.

### 2017/07/14 17:37:39 INFO servlet.MessageBrokerHandlerAdapter: Channel endpoint my-amf received request.
[BlazeDS] Creation validation for class 'test.package.Test' failed.
flex.messaging.io.SerializationException: Creation validation for class 'test.package.Test' failed.
        at flex.messaging.util.ClassUtil.validateCreation(ClassUtil.java:354)
        at flex.messaging.util.ClassUtil.createDefaultInstance(ClassUtil.java:115)
        at flex.messaging.io.amf.AbstractAmfInput.createObjectInstance(AbstractAmfInput.java:165)
        at flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:748)
        at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:156)
        at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:134)
        at flex.messaging.io.amf.Amf3Input.readObjectOneLevelDown(Amf3Input.java:1046)
        at flex.messaging.io.amf.Amf3Input.readArray(Amf3Input.java:698)
        at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:160)
        at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:134)
        at flex.messaging.io.amf.Amf3Input.readObjectOneLevelDown(Amf3Input.java:1046)
        at flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:777)
        at flex.messaging.io.amf.Amf3Input.readObjectValue(Amf3Input.java:156)
        at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:134)
        at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:124)
        at flex.messaging.io.amf.Amf0Input.readObjectValueOneLevelDown(Amf0Input.java:545)
        at flex.messaging.io.amf.Amf0Input.readArrayValue(Amf0Input.java:364)
        at flex.messaging.io.amf.Amf0Input.readObjectValue(Amf0Input.java:128)
        at flex.messaging.io.amf.Amf0Input.readObject(Amf0Input.java:95)
        at flex.messaging.io.amf.AmfMessageDeserializer.readObject(AmfMessageDeserializer.java:199)
        at flex.messaging.io.amf.AmfMessageDeserializer.readBody(AmfMessageDeserializer.java:173)
        at flex.messaging.io.amf.AmfMessageDeserializer.readMessage(AmfMessageDeserializer.java:93)
        at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:169)
        at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:328)
        at flex.messaging.endpoints.AMFEndpoint$$EnhancerBySpringCGLIB$$2bc97534.service(<generated>)
        at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerAdapter.java:109)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)


Reply | Threaded
Open this post in threaded view
|

Re: BlazeDS 4.7.3 ISSUE: SerializationException: Creation validation for class "<myClass>" failed.

Josh Tynjala
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.

- Josh

On Jul 14, 2017 4:46 PM, "jaabax" <[hidden email]> wrote:

I am not being able to communicate with the server with  the jars from
flex-messaging-core, common, proxy and remoting version 4.7.3. When I change
to 4.7.2 things work. Importante: the ONLY thing I change is the version on
my pom.xml for it to work. No code changes at all.

I have the following test entity.

package test.package
{
        [Bindable]
        [RemoteClass(alias="test.package.Test")]
        public class Test
        {
                public function Test()
                {
                }

                private var _name:String
                private var _price:int;

                public function get name():String{
                        return _name;
                }
                public function get price():int{
                        return _price;
                }
                public function set name(name:String):void{
                        _name = name;
                }
                public function set price(price:int):void{
                        _price = price;
                }

        }
}

public class Test implements Serializable {

        private String name;
    private int price;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getPrice() {
        return price;
    }
    public void setPrice(int price) {
        this.price = price;
    }

}

I checked the source code and on the class ClassDeserializationValidator my
Test entity goes into Set<String> disallowClasses.

### 2017/07/14 17:37:39 INFO servlet.MessageBrokerHandlerAdapter: Channel
endpoint my-amf received request.
[BlazeDS] Creation validation for class 'test.package.Test' failed.
flex.messaging.io.SerializationException: Creation validation for class
'test.package.Test' failed.
        at flex.messaging.util.ClassUtil.validateCreation(ClassUtil.
java:354)
        at flex.messaging.util.ClassUtil.createDefaultInstance(
ClassUtil.java:115)
        at
flex.messaging.io.amf.AbstractAmfInput.createObjectInstance(
AbstractAmfInput.java:165)
        at flex.messaging.io.amf.Amf3Input.readScriptObject(
Amf3Input.java:748)
        at flex.messaging.io.amf.Amf3Input.readObjectValue(
Amf3Input.java:156)
        at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:134)
        at
flex.messaging.io.amf.Amf3Input.readObjectOneLevelDown(Amf3Input.java:1046)
        at flex.messaging.io.amf.Amf3Input.readArray(Amf3Input.java:698)
        at flex.messaging.io.amf.Amf3Input.readObjectValue(
Amf3Input.java:160)
        at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:134)
        at
flex.messaging.io.amf.Amf3Input.readObjectOneLevelDown(Amf3Input.java:1046)
        at flex.messaging.io.amf.Amf3Input.readScriptObject(
Amf3Input.java:777)
        at flex.messaging.io.amf.Amf3Input.readObjectValue(
Amf3Input.java:156)
        at flex.messaging.io.amf.Amf3Input.readObject(Amf3Input.java:134)
        at flex.messaging.io.amf.Amf0Input.readObjectValue(
Amf0Input.java:124)
        at
flex.messaging.io.amf.Amf0Input.readObjectValueOneLevelDown(
Amf0Input.java:545)
        at flex.messaging.io.amf.Amf0Input.readArrayValue(
Amf0Input.java:364)
        at flex.messaging.io.amf.Amf0Input.readObjectValue(
Amf0Input.java:128)
        at flex.messaging.io.amf.Amf0Input.readObject(Amf0Input.java:95)
        at
flex.messaging.io.amf.AmfMessageDeserializer.readObject(
AmfMessageDeserializer.java:199)
        at
flex.messaging.io.amf.AmfMessageDeserializer.readBody(
AmfMessageDeserializer.java:173)
        at
flex.messaging.io.amf.AmfMessageDeserializer.readMessage(
AmfMessageDeserializer.java:93)
        at
flex.messaging.endpoints.amf.SerializationFilter.invoke(
SerializationFilter.java:169)
        at
flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:328)
        at
flex.messaging.endpoints.AMFEndpoint$$EnhancerBySpringCGLIB$$
2bc97534.service(<generated>)
        at
org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(
MessageBrokerHandlerAdapter.java:109)
        at
org.springframework.web.servlet.DispatcherServlet.
doDispatch(DispatcherServlet.java:963)
        at
org.springframework.web.servlet.DispatcherServlet.
doService(DispatcherServlet.java:897)
        at
org.springframework.web.servlet.FrameworkServlet.processRequest(
FrameworkServlet.java:970)
        at
org.springframework.web.servlet.FrameworkServlet.
doPost(FrameworkServlet.java:872)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
        at
org.springframework.web.servlet.FrameworkServlet.
service(FrameworkServlet.java:846)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:231)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:166)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(
WsFilter.java:52)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:166)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:198)
        at
org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:96)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(
AuthenticatorBase.java:478)
        at
org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:140)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
        at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(
AbstractAccessLogValve.java:624)
        at
org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:87)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
        at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
        at
org.apache.coyote.AbstractProcessorLight.process(
AbstractProcessorLight.java:66)
        at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(
AbstractProtocol.java:861)
        at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.
doRun(NioEndpoint.java:1455)
        at
org.apache.tomcat.util.net.SocketProcessorBase.run(
SocketProcessorBase.java:49)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1142)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:617)
        at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(
TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)






--
View this message in context: http://apache-flex-
development.2333347.n4.nabble.com/BlazeDS-4-7-3-ISSUE-
SerializationException-Creation-validation-for-class-
myClass-failed-tp63270.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: BlazeDS 4.7.3 ISSUE: SerializationException: Creation validation for class "<myClass>" failed.

jaabax
Thank you very much!
Resolved.
Reply | Threaded
Open this post in threaded view
|

Re: BlazeDS 4.7.3 ISSUE: SerializationException: Creation validation for class "<myClass>" failed.

Solai
Just wondering how you have this fixed.  I have the same issue while
upgrading to 3.



--
Sent from: http://apache-flex-development.2333347.n4.nabble.com/