Problems de-serializing Comet payload

23 views
Skip to first unread message

RCh

unread,
Aug 3, 2012, 3:33:11 AM8/3/12
to rocke...@googlegroups.com
Hi all,

I'm trying to implement the Comet mechanism on my GWT application using rocket-gwt. I could make it work till the point where the comet client needs to de-serialize the serialized data pushed by the server. I cannot get the serialization factory created, because of a compilation problem IncompatibleClassChangeError.

My payload test class:
--------------------------------------------------------------------

package com.test.shared;
public class CometPayload implements Serializable
{
private int counter;

public CometPayload( int counter ) { this.counter = counter; }
public int getCounter() { return this.counter; }
};


My Comet test servlet:
--------------------------------------------------------------------
package com.test.server;
public class TestCometServlet extends CometServerServlet
{
private int counter = 0;

protected void poll( CometConnection conn )
{
[sleep for 1 sec]
conn.push( new CometPayload( this.counter++ ) );
}
}


My serialization interface:
--------------------------------------------------------------------
package com.test.shared;
/**
* @serialization-readableTypes com.test.shared.CometPayload
* @serialization-writableTypes com.test.shared.CometPayload
*/
public class CometSerialization implements SerializationFactoryComposer {};


My Comet client:
--------------------------------------------------------------------
package com.test.client;
public class TestCometClient extends CometClient
{
public void dispatch( String serialized )
{
final SerializationFactory factory = (SerializationFactory) GWT.create( CometSerialization.class ); // THIS DOES NOT COMPILE!
}
}


In my gwt.xml file I'm including "inherits" clauses for "rocket.remoting.Remoting" and "rocket.serialization.Serialization".

The source paths "client" and "shared" are also declared in the xml.

When I try to compile the application, I get a compiler error:

java.lang.IncompatibleClassChangeError: Found interface com.google.gwt.core.ext.typeinfo.JArrayType, but class was expected at
rocket.generator.rebind.gwt.JArrayTypeTypeAdapter,getName(JArrayTypeTypeAdapter.java:82)
....
....

If I comment out the line where the serialization factory is created, it compiles well. What am I doing wrong? Should I import something else in the GWT xml? I believe the serialization class is well declared (I also tried declaring CometSerialization as an interface instead of a class as I saw it in some docs, but did not work either)

Thanks in advance for the help!

Regards,
Rafael

Miroslav Pokorny

unread,
Aug 4, 2012, 11:24:43 PM8/4/12
to rocke...@googlegroups.com
Hi

At a guess, i am assuming that given Rocket is based on an out of date GWT 1.4, lots of stuff have changed, which is why your getting an IncompatableCE. I have been busy and dont have time to update, i would humbly suggest perhaps if your not willing to make the fixes to look for other solutions.

David Hoffer

unread,
Aug 6, 2012, 2:37:19 PM8/6/12
to rocke...@googlegroups.com

FYI, on a new GWT app I use the new Atmosphere library for comet as it has a GWT client (and could also use CometD as 3rd party created a GWT client).

 

-Dave

--
You received this message because you are subscribed to the Google Groups "rocket-gwt" group.
To post to this group, send an email to rocke...@googlegroups.com.
To unsubscribe from this group, send email to rocket-gwt+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rocket-gwt?hl=en-GB.

Reply all
Reply to author
Forward
0 new messages