Discussion:
[errai-users] @ExposeEntity and serialization of message parts
Sean Flanigan
2010-02-02 08:01:52 UTC
Permalink
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.)

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?

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


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?

Regards

Sean.
--
Sean Flanigan

Senior Software Engineer
Engineering - Internationalisation
Red Hat

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 552 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/errai-users/attachments/20100202/597d42a1/attachment.bin
Heiko Braun
2010-02-02 10:16:04 UTC
Permalink
Post by Sean Flanigan
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
http://www.errai-framework.org/docs/html/en/#d0e362
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.
Post by Sean Flanigan
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?
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?
Post by Sean Flanigan
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.
Post by Sean Flanigan
Regards
Sean.
--
Sean Flanigan
Senior Software Engineer
Engineering - Internationalisation
Red Hat
_______________________________________________
errai-users mailing list
errai-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/errai-users
Sean Flanigan
2010-02-03 05:34:26 UTC
Permalink
Post by Heiko Braun
Post by Sean Flanigan
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?
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.
That was it, thanks. Unfortunately, the client side is now generating
invalid marshallers (trying to call the null() method), even for classes
which don't use enums. See the attachments.

I'm way, way over my time budget on my ErraiBus investigation - I kept
thinking "I'm almost there" - but I will have to put it aside for now.

I sorry that I don't have time for a proper bug report, or even
retesting, but maybe you can make a test case for the marshaller out of
the attached files, if you like.

Regards

Sean
--
Sean Flanigan

Senior Software Engineer
Engineering - Internationalisation
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ExtensionsLoaderImpl7509171620584034980.java
Type: text/x-java
Size: 13956 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/errai-users/attachments/20100203/c3ad56b3/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TransUnitId.java
Type: text/x-java
Size: 971 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/errai-users/attachments/20100203/c3ad56b3/attachment-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 552 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/errai-users/attachments/20100203/c3ad56b3/attachment-0002.bin
Heiko Braun
2010-02-03 08:23:18 UTC
Permalink
ok, i will try that and see where what's broken.
Post by Sean Flanigan
I sorry that I don't have time for a proper bug report, or even
retesting, but maybe you can make a test case for the marshaller out of
the attached files, if you like.
Heiko Braun
2010-02-03 08:31:06 UTC
Permalink
what version of errai are you using?
Post by Sean Flanigan
That was it, thanks. Unfortunately, the client side is now generating
invalid marshallers (trying to call the null() method), even for classes
which don't use enums. See the attachments.
Sean Flanigan
2010-02-03 23:32:54 UTC
Permalink
1.0-20100114.200325-3
Post by Heiko Braun
what version of errai are you using?
Post by Sean Flanigan
That was it, thanks. Unfortunately, the client side is now generating
invalid marshallers (trying to call the null() method), even for classes
which don't use enums. See the attachments.
--
Sean Flanigan

Senior Software Engineer
Engineering - Internationalisation
Red Hat

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 552 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/errai-users/attachments/20100204/a3bee9bd/attachment.bin
Heiko Braun
2010-02-04 08:05:29 UTC
Permalink
Does that mean you build iy from trunk?
Post by Sean Flanigan
1.0-20100114.200325-3
Post by Heiko Braun
what version of errai are you using?
Post by Sean Flanigan
That was it, thanks. Unfortunately, the client side is now
generating
invalid marshallers (trying to call the null() method), even for classes
which don't use enums. See the attachments.
--
Sean Flanigan
Senior Software Engineer
Engineering - Internationalisation
Red Hat
Sean Flanigan
2010-02-04 08:23:02 UTC
Permalink
No, I just put that version in my pom
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-bus</artifactId>
<version>1.0-20100114.200325-3</version>
</dependency>

and Maven gets it from here:
http://snapshots.jboss.org/maven2/org/jboss/errai/errai-bus/1.0-SNAPSHOT/

I didn't want to be developing against a moving SNAPSHOT target, and it
sounded like the Errai API had changed too much since 1.0 beta, or I
would have used that. But I should have waited for another release,
rather than freezing a dev version like that.
Post by Heiko Braun
Does that mean you build iy from trunk?
Post by Sean Flanigan
1.0-20100114.200325-3
Post by Heiko Braun
what version of errai are you using?
Post by Sean Flanigan
That was it, thanks. Unfortunately, the client side is now
generating
invalid marshallers (trying to call the null() method), even for classes
which don't use enums. See the attachments.
--
Sean Flanigan
Senior Software Engineer
Engineering - Internationalisation
Red Hat
--
Sean Flanigan

Senior Software Engineer
Engineering - Internationalisation
Red Hat

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 552 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/errai-users/attachments/20100204/1dd409f1/attachment.bin
Heiko Braun
2010-02-04 08:40:45 UTC
Permalink
Ok, but in that case you need to switch to 1.0-SNAPSHOT
so that you get the most recent implementation. Which actually is the nightly build.

It's correct that the API changed since the early beta version,
but it's considered pretty much stable yet. And for me going back todo QA on
an early preview version doesn't make sense either.


/Heiko
Post by Sean Flanigan
No, I just put that version in my pom
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-bus</artifactId>
<version>1.0-20100114.200325-3</version>
</dependency>
http://snapshots.jboss.org/maven2/org/jboss/errai/errai-bus/1.0-SNAPSHOT/
I didn't want to be developing against a moving SNAPSHOT target, and it
sounded like the Errai API had changed too much since 1.0 beta, or I
would have used that. But I should have waited for another release,
rather than freezing a dev version like that.
Post by Heiko Braun
Does that mean you build iy from trunk?
Post by Sean Flanigan
1.0-20100114.200325-3
Post by Heiko Braun
what version of errai are you using?
Post by Sean Flanigan
That was it, thanks. Unfortunately, the client side is now generating
invalid marshallers (trying to call the null() method), even for classes
which don't use enums. See the attachments.
--
Sean Flanigan
Senior Software Engineer
Engineering - Internationalisation
Red Hat
--
Sean Flanigan
Senior Software Engineer
Engineering - Internationalisation
Red Hat
_______________________________________________
errai-users mailing list
errai-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/errai-users
Loading...