Null fields from Remote EJB

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Null fields from Remote EJB

John Arevalo
Hi list,

some days ago I was working with @Local EJB and use it from same ear without problems.

Creating a @Remote EJB interface and invoking myFacade Methods entity is created in "find"[1] method, but in return value all its attributes has null values. My Entity class is serializable, what can I do to solve this issue?

this is my piece of code.
[1]http://pastebin.com/m27dc24d2

Thanks for your replies.


--
John Arévalo
GNU/Linux User #443701
http://counter.li.org/

_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
Reply | Threaded
Open this post in threaded view
|

Re: Null fields from Remote EJB

Michael Bar-Sinai
Hi John,

Off the top of my head, when data come from @Remote ejbs it is serialized and de-serialized, thus loosing its persistence context. So if you had anything lazy-loaded, it will work with @Local but would fail with @Remote.

--Michael

On Tue, Sep 15, 2009 at 12:56 AM, John Arevalo <[hidden email]> wrote:
Hi list,

some days ago I was working with @Local EJB and use it from same ear without problems.

Creating a @Remote EJB interface and invoking myFacade Methods entity is created in "find"[1] method, but in return value all its attributes has null values. My Entity class is serializable, what can I do to solve this issue?

this is my piece of code.
[1]http://pastebin.com/m27dc24d2

Thanks for your replies.


--
John Arévalo
GNU/Linux User #443701
http://counter.li.org/

_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
Reply | Threaded
Open this post in threaded view
|

Re: Null fields from Remote EJB

John Arevalo


Hi Michael,

My Entity class has @ManyToOne(fetch = FetchType.LAZY) Fields, also has simple @Column String fields, all attributes in entity after return are null, just before return object has correct values.

--
John Arévalo
GNU/Linux User #443701
http://counter.li.org/

_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
Reply | Threaded
Open this post in threaded view
|

Re: Null fields from Remote EJB

Michael Bar-Sinai
Try some logging: Dump the object you about to return to the log in the @Remote, just before returning it.

-Michael

On Tue, Sep 15, 2009 at 4:20 PM, John Arevalo <[hidden email]> wrote:


Hi Michael,

My Entity class has @ManyToOne(fetch = FetchType.LAZY) Fields, also has simple @Column String fields, all attributes in entity after return are null, just before return object has correct values.


--
John Arévalo
GNU/Linux User #443701
http://counter.li.org/

_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
Reply | Threaded
Open this post in threaded view
|

Re: Null fields from Remote EJB

John Arevalo
Hi again,

Sorry, i don't undersatand "Dump an Object"

Maybe this info can be useful:
all my Entity clases has same field: private static final long serialVersionUID = 1L;
Unit entity has @Transient Field.



On Tue, Sep 15, 2009 at 11:39 PM, Michael Bar-sinai <[hidden email]> wrote:
Try some logging: Dump the object you about to return to the log in the @Remote, just before returning it.

-Michael

On Tue, Sep 15, 2009 at 4:20 PM, John Arevalo <[hidden email]> wrote:


Hi Michael,

My Entity class has @ManyToOne(fetch = FetchType.LAZY) Fields, also has simple @Column String fields, all attributes in entity after return are null, just before return object has correct values.


--
John Arévalo
GNU/Linux User #443701
http://counter.li.org/

_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users




--
John Arévalo
GNU/Linux User #443701
http://counter.li.org/

_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
Reply | Threaded
Open this post in threaded view
|

Re: Null fields from Remote EJB

Michael Bar-Sinai
"Dump an object" means printing its field to the log. This way you'll know whether the fields were null before the object left the @Remote.

@Transient fields don't get persisted, and transient class members (e.g. private transient int myInt;) won't get serialized. Both will be null after you get the @Remote object.

Michael

On Thu, Sep 17, 2009 at 6:18 AM, John Arevalo <[hidden email]> wrote:
Hi again,

Sorry, i don't undersatand "Dump an Object"

Maybe this info can be useful:
all my Entity clases has same field: private static final long serialVersionUID = 1L;
Unit entity has @Transient Field.




On Tue, Sep 15, 2009 at 11:39 PM, Michael Bar-sinai <[hidden email]> wrote:
Try some logging: Dump the object you about to return to the log in the @Remote, just before returning it.

-Michael

On Tue, Sep 15, 2009 at 4:20 PM, John Arevalo <[hidden email]> wrote:


Hi Michael,

My Entity class has @ManyToOne(fetch = FetchType.LAZY) Fields, also has simple @Column String fields, all attributes in entity after return are null, just before return object has correct values.


--
John Arévalo
GNU/Linux User #443701
http://counter.li.org/

_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users




--
John Arévalo
GNU/Linux User #443701
http://counter.li.org/

_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



_______________________________________________
eclipselink-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/eclipselink-users