javaclient and granite long externalizer

87 views
Skip to first unread message

Steve

unread,
Jan 2, 2012, 11:49:01 AM1/2/12
to Granite Data Services Forum
Hello,

I switched towards the graniteds org.granite.math.Long as3
implementation.

Since I configured the graniteds LongExternalizer, the graniteds java
client fails at requests with Longs inside the response object.

Had no success in figuring out how to get it to work...


Here is the error from graniteds-javaclient

org.granite.messaging.engine.EngineException: Could not deserialize
AMF0 message
at org.granite.messaging.engine.ApacheAsyncEngine
$1.completed(ApacheAsyncEngine.java:104)
at org.granite.messaging.engine.ApacheAsyncEngine
$1.completed(ApacheAsyncEngine.java:1)
at
org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:104)
at
org.apache.http.impl.nio.client.DefaultResultCallback.completed(DefaultResultCallback.java:
47)
at
org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.responseCompleted(DefaultAsyncRequestDirector.java:
410)
at
org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.processResponse(HttpAsyncClientProtocolHandler.java:
331)
at
org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:
229)
at
org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:
98)
at
org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:
175)
at
org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:
118)
at
org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:
49)
at
org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:
113)
at
org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:
160)
at
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:
342)
at
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:
320)
at
org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:
280)
at
org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:
106)
at
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor
$Worker.run(AbstractMultiworkerIOReactor.java:599)
at java.lang.Thread.run(Thread.java:636)
Caused by: org.granite.messaging.amf.io.AMF3SerializationException
at
org.granite.messaging.amf.io.AMF3Deserializer.readObject(AMF3Deserializer.java:
97)
at
org.granite.messaging.amf.io.AMF0Deserializer.readAMF3Data(AMF0Deserializer.java:
310)
at
org.granite.messaging.amf.io.AMF0Deserializer.readData(AMF0Deserializer.java:
362)
at
org.granite.messaging.amf.io.AMF0Deserializer.readBodies(AMF0Deserializer.java:
141)
at
org.granite.messaging.amf.io.AMF0Deserializer.<init>(AMF0Deserializer.java:
79)
at
org.granite.messaging.engine.AbstractEngine.deserialize(AbstractEngine.java:
105)
at org.granite.messaging.engine.ApacheAsyncEngine
$1.completed(ApacheAsyncEngine.java:100)
... 18 more
Caused by: java.lang.RuntimeException: The ActionScript3 class bound
to java.lang.Long (ie: [RemoteClass(alias="java.lang.Long")])
implements flash.utils.IExternalizable but this Java class neither
implements java.io.Externalizable nor is in the scope of a configured
externalizer (please fix your granite-config.xml)
at
org.granite.messaging.amf.io.AMF3Deserializer.readAMF3Object(AMF3Deserializer.java:
498)
at
org.granite.messaging.amf.io.AMF3Deserializer.readObject(AMF3Deserializer.java:
129)
at
org.granite.messaging.amf.io.AMF3Deserializer.readAMF3Object(AMF3Deserializer.java:
521)
at
org.granite.messaging.amf.io.AMF3Deserializer.readObject(AMF3Deserializer.java:
129)
at
org.granite.messaging.amf.io.AMF3Deserializer.readObject(AMF3Deserializer.java:
91)
... 24 more



Thanks for your help!
Steve

Steve

unread,
Jan 3, 2012, 9:40:41 AM1/3/12
to Granite Data Services Forum
Seems that my granite-config.xml is not used from the javaclient...

"You should configure a deserializer securizer in your granite-
config.xml file in order to prevent potential security exploits!"

will move it around...^^

Steve

unread,
Jan 3, 2012, 12:31:00 PM1/3/12
to Granite Data Services Forum
Seems I am unable to solve this issue.

"You should configure a deserializer securizer in your granite-
config.xml file in order to prevent potential security exploits!"

I think this is indicating, that no granite-config.xml is read
(according to documentation, this is only printed when nothing is
configured).

I tried several locations ( root, META-INF, META-INF/granite) for the
config file with externalizer set up.


Anyone already passed the granite long implemenatation to a java
client? This works fine with flex and the service is used from flex
and java...

Many thanks

wdrai

unread,
Jan 3, 2012, 1:00:15 PM1/3/12
to gran...@googlegroups.com
The Java client is currently quite limited and does not support custom granite-config.xml configurations.

As a hacky workaround, you can try to put your granite-config.xml in the folder org/granite/messaging/engine/granite-config.xml and ensure it is before granite-java-client.jar in the classpath.


Steve

unread,
Jan 4, 2012, 1:24:05 PM1/4/12
to Granite Data Services Forum
William, :*
Just fyi, the proposed workaround is doing the job!
Keep up the good work!
Reply all
Reply to author
Forward
0 new messages