Problem serializing a String[] over RMI

T

Thomas

Hi,

Ok, it's late in the day and my mind is probably just not up to
working on this stuff anymore :p

Any help is much appreciated:

I have a class called AlignmentData which looks like this (I'm
trimming it down to the important bits):

public class AlignmentData implements java.io.Serializable {

private String[] all;

...

public AlignmentData() {}

public void setAll(String[] all){...}
public String[] getAll(){...}
}

So I have an RMI service that returns an instance of AlignmentData
over the network. The primitive instance member values have been set
(as one would expect), however the *all* string array is not (even
though I know for a fact its being set on the server side because the
log indicates that it is happening, and with non-null data).

Ok, so what am I missing here?

Best,

Thomas
 
M

Matt Humphrey

Thomas said:
Hi,

Ok, it's late in the day and my mind is probably just not up to
working on this stuff anymore :p

Any help is much appreciated:

I have a class called AlignmentData which looks like this (I'm
trimming it down to the important bits):

public class AlignmentData implements java.io.Serializable {

private String[] all;

...

public AlignmentData() {}

public void setAll(String[] all){...}
public String[] getAll(){...}
}

So I have an RMI service that returns an instance of AlignmentData
over the network. The primitive instance member values have been set
(as one would expect), however the *all* string array is not (even
though I know for a fact its being set on the server side because the
log indicates that it is happening, and with non-null data).

Ok, so what am I missing here?

This is just a guess, but since your instance variable "all" matches the
parameter name "all" in the setAll method, is it possible that the values
are actually *not* being assigned and the log just happens to be showing the
parameter values?

Cheers,
Matt Humphrey (e-mail address removed) http://www.iviz.com/
 
T

Thomas

There was a bug in my code that I didn't catch until shortly after
posting this message.

Basically, I observed the all value being set, however I did not see
that it was set again to null; I discovered this when I put a log
message in the setAll method.

X-( !!!

Thanks for your reply,

Thomas

Matt Humphrey said:
Thomas said:
Hi,

Ok, it's late in the day and my mind is probably just not up to
working on this stuff anymore :p

Any help is much appreciated:

I have a class called AlignmentData which looks like this (I'm
trimming it down to the important bits):

public class AlignmentData implements java.io.Serializable {

private String[] all;

...

public AlignmentData() {}

public void setAll(String[] all){...}
public String[] getAll(){...}
}

So I have an RMI service that returns an instance of AlignmentData
over the network. The primitive instance member values have been set
(as one would expect), however the *all* string array is not (even
though I know for a fact its being set on the server side because the
log indicates that it is happening, and with non-null data).

Ok, so what am I missing here?

This is just a guess, but since your instance variable "all" matches the
parameter name "all" in the setAll method, is it possible that the values
are actually *not* being assigned and the log just happens to be showing the
parameter values?

Cheers,
Matt Humphrey (e-mail address removed) http://www.iviz.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top