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