On Feb 2, 2010, at 9:01 AM, Sean Flanigan wrote:
G'day,
I finally got my client and server talking on the same MessageBus, but I
discovered that my message parts were coming through (server->client) as
null. This was a silent failure - what happened to the "glorious
runtime exception"?. Anyway, I eventually found the post on errai-dev
about @ExposeEntity, and the new section in the documentation.
http://www.errai-framework.org/docs/html/en/#d0e362
The documentation says that classes annotated with @ExposeEntity will
have stubs generated for them, but this doesn't seem to be happening.
(NB: The docs & example should mention the need for Serializable; my
objects were originally designed for GWT-RPC, and implemented
IsSerializable.)
right, that's missing from the docs.
Good catch.
I've annotated both the concrete classes and the interface they
implement, but it doesn't look like the stub generator is even being
called. If it were, I think I would see the INFO logging in the JBoss
console at startup. Is there something else I need to do for these
stubs to be generated?
Do the stubs even work on the server, or are they client-side only?
No, @ExposedEntities should work on both sides.
Tracing the code, it seems like the ServerMessageBus calls
JSONEncoder,
and I can't see where the stubs could come into it, even if they were
generated. (But perhaps I just don't understand the code well enough.)
JSONEncoder seems to be fairly happy as long as my objects implement
Serializable *and* provide getter methods for everything, but it doesn't
seem to handle Enums...
It doesn't? I'll have to verify this. Mike?
Hmm. I don't suppose anyone knows a way I can just ask GWT-RPC
to
serialize my objects its way, and then just stick the result into a
message part?
No, it should be working like charm.
If the deferred binding doesn't kick in to generate the boilerplate then
it's very likely some classloading problem.
You have to have ErraiApp.properties in the classpath the entities otherwise
the discovery fails.
Regards
Sean.
--
Sean Flanigan
Senior Software Engineer
Engineering - Internationalisation
Red Hat
_______________________________________________
errai-users mailing list
errai-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/errai-users