Hi dear,

from BlazeDS 4.7.1 you must explicit the whitelist about your serialized class, so in your service-config.xml you must add this:

<class name="it.*" /> is the root package

<validators>
<validator
class="flex.messaging.validators.ClassDeserializationValidator">
<properties>
<allow-classes>
<class name="it.*" />
</allow-classes>
</properties>
</validator>
</validators>

Tell me if it's OK

Il 2021-06-10 23:44 [email protected] ha scritto:

Hi,

I just set up my own spring boot blazeds project. I tried to follow the example "SampleAmfWebApp"
project.

I wrote a java client to connect to my amf end point.

http://127.0.0.1:8080/messagebroker/websocket-amf

I get the following error when running the test class.

attempt to connect via amf: http://127.0.0.1:8080/messagebroker/websocket-amf
Jun 10, 2021 10:35:21 PM com.demo.helloblaze.TestAmf test
INFO:  connected !!!
Jun 10, 2021 10:35:22 PM com.demo.helloblaze.TestAmf test
SEVERE: error: flex.messaging.io.SerializationException: Creation validation for class 'com.demo.helloblaze.dto.ContactDTO' failed.
ClientStatusException
message: flex.messaging.io.SerializationException: Creation validation for class 'com.demo.helloblaze.dto.ContactDTO' failed.
code: AMFConnection.Call.Failed
at flex.messaging.io.amf.client.AMFConnection.call(AMFConnection.java:524)
at com.demo.helloblaze.TestAmf.test(TestAmf.java:50)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:542) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210) Caused by: flex.messaging.io.SerializationException: Creation validation for class 'com.demo.helloblaze.dto.ContactDTO' 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.ArrayCollection.readExternal(ArrayCollection.java:120) at flex.messaging.io.amf.Amf3Input.readExternalizable(Amf3Input.java:828)
at flex.messaging.io.amf.Amf3Input.readScriptObject(Amf3Input.java:759)
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.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.io.amf.client.AMFConnection.processHttpResponseBody(AMFConnection.java:708) at flex.messaging.io.amf.client.AMFConnection.processHttpResponse(AMFConnection.java:686) at flex.messaging.io.amf.client.AMFConnection.send(AMFConnection.java:805) at flex.messaging.io.amf.client.AMFConnection.call(AMFConnection.java:514)

In services-config.xml I registered the ContactDTO
as follows

com.demo.helloblaze.dto.ContactDTO

<validator class="flex.messaging.validators.ClassDeserializationValidator">
<properties>
<allow-classes>
<class name="com.demo.helloblaze.dto.*"/>
<class name="flex.messaging.messages.*"/>
<class name="flex.messaging.io.*"/>
<class name="flex.messaging.io.amf.*"/>
</allow-classes>
</properties>
</validator>

Any ideas what is causing this errors ? This is my first blazeds project.

Regards,

--
Assistenza Software

Galeso Software s.r.l.s.
e-mail:  [email protected]

sito:  https://www.galeso-software.it [1]

PEC:  [email protected]

  _____

Questo messaggio di posta elettronica contiene informazioni di carattere confidenziale rivolte esclusivamente al destinatario sopra indicato. E' vietato l'uso, la diffusione, distribuzione o riproduzione da parte di ogni altra persona. Nel caso aveste ricevuto questo messaggio di posta elettronica per errore, siete pregati di segnalarlo immediatamente al mittente e distruggere quanto ricevuto (compresi i file allegati) senza farne copia.

This e-mail transmission may contain legally privileged and/or confidential information. Please do not read it if you are not the intended recipient(S). Any use, distribution, reproduction or disclosure by any other person is strictly prohibited. If you have received this e-mail in error, please notify the sender and destroy the original transmission and its attachments without reading or saving it in any manner.

Links:
------
[1] http://www.galeso-software.it/

Reply via email to