I need to send Obj A but not Obj B which is referenced

I'm having a problem with my serialization. Here's the set up:
The server creates an instance of Obj A and Obj B, which contain references to each other. I want to serialize Obj A and send it to the client, but not Obj B.
First I tried setting Obj A's reference of Obj B to null right before I sent it to the client, but I kept getting Null Pointer Exception.
Then I tried adding "transient" to Obj A's reference to Obj B, but now when Obj A appears on the client, the other fields are also blank. I assume this is because Java is ignoring Obj B and all of it's references including Obj A.
Is there some way to void Obj A's reference to Obj B right before it's sent, without nulling Obj B completely?
Thanks!
Matt

Then I tried adding "transient" to Obj A's reference to Obj B, but now when Obj A appears on the client, the other fields are also blank. I assume this is because Java is ignoring Obj B and all of it's references including Obj A.No. Something wrong here. Make objB transient in objA, and send objA. Everything else in objA should appear at the client. That's how I thought it should work, which is why I tried it in the first place...
Is there some way to void Obj A's reference to Obj B right before it's sent, without nulling Obj B completely? Setting objA.objB to null doesn't 'null objB completely'. It does nothing to the object B, only to A's reference to it.
That's what I thought, but it again it didn't work, so I guess I then wrongly assumed that it was nullying Obj B (which doesn't really make sense, and of course it's wrong).
Ok here's the object I serialize and send:
public class Info implements Serializable{
    Client clientInfo;
    String cmd;
    ArrayList<String> handleList = new ArrayList<String>();
    ArrayList<Territory> list = new ArrayList<Territory>();
some methods....Then there's the Client class, which is where the problem is (Obj A from my first post)
public class Client implements Serializable {
    public int ID;
    String handle;
    public ClientThread threadName;
    public int money;
    public ArrayList<Territory> ownTerrList = new ArrayList<Territory>();
    public ArrayList moveList = new ArrayList();
    public ArrayList attackList = new ArrayList();
    public ArrayList buildList = new ArrayList();
some methods....Then the ClientThread class (Obj B from my first post), which is what's causing the problems because I think it cannot be serialized because it's a thread, is that correct?
Notice that the Client class above contains a reference to ClientThread threadName, which is the corresponding instance/thread of the class below, which contains a reference to the Client class above, Client client (so Obj A has a reference to Obj B and Obj B has a reference to Obj A):
public  class ClientThread implements Runnable, Serializable{
        Client client;
        Socket connection;
        String msg;
        ObjectInputStream objIn;
        ObjectOutputStream objOut;
        Info courier = new Info();
        C2Server server = null;
        public ClientThread(Socket connection, C2Server server, int id){
            this.server = server;
            this.client = new Client();
            this.client.ID = id;
            this.connection = connection;
            this.client.threadName = this;
            server.addClient(client);
a run method...
some other methods....
       My normal procedure for sending the information across the network is:
1) Update the Client instance which is inside the Info instance, which is the object sent.
2)Send
Then I started getting errors and problems so I started doing this:
1)Update the Client instance which is inside the Info instance, which is the object sent.
2) Set the Client instance's reference to the ClientThread instance to null (threadName =null)
3) Send
When the Info instance "gets" to the other side and is deserialized, the String cmd and ArrayList handleList are intact, but the ArrayList list and ArrayList ownTerrList (inside the Client instance) are both empty. I know those ArrayLists are full before I send because I do a System.out.println on them and they print out correctly with objects for each of my threads. They are full on the server side, then empty on the client side, and I can't figure out what the problem is. What might cause some of the fields in an object to be deserialized incorrectly while others are fine?
Thanks.
Matt

Similar Messages

  • I need to send a fax, but now apple's modem is incompatible on Lion... how can I do?.. :(

    I need to send a fax, but now apple's modem is incompatible on Lion... how can I do?

    I understand that you bought it 2 years ago, but it has been around for a long time.
    I totally hear about the bugs you were dealing with, I have been lucky enough not to get bit by anything that isn't a minor issue. Losing my VPN connection would drive me NUTS =)
    It just sounded like you were saying that the only reason you dropped  back from Lion was because of the modem. My bad.

  • I can send in hotmail, but not recieve, how do I fix this

    # Question
    I can send in hotmail, but not recieve, how do I fix this
    I send a test to myself, and it doesn't go through,
    also links from searches don't arrive

    Hi there, thanks for your reply, I cannot give you the URL as this is Cloud Based Farming Software which requires a Login and Password. All I can tell you is that it is written in PHP. There are many graphs, all of them print from IE but no not print from Firefox.
    Cheers
    James

  • Why can i send imessage texts but not sms texts ?

    why can i send imessage texts but not sms texts ?
    When i try to send an sms text ..i get a 'not delivered' message...no error code...imessage works fine...

        Very strange, [email protected] Let's get this figured out. Make sure that SMS messages are turned on. Go to Settings>Messages>Send as SMS. Please let me know if this works.
    ChaunceyM_VZW
    Follow us on twitter @VZWSupport

  • How can I force mount a dvd that isn't even seen by Disk Utility? I can see it on the Mac when using my Windows 7 partition via Boot Camp, but not in Lion, which is how I would rather be running.

    How can I force mount a dvd that isn't even seen by Disk Utility? I can see it on the Mac when using my Windows 7 partition via Boot Camp, but not in Lion, which is how I would rather be running.

    Well if there is a EFI block, then running a program in OS X isn't going to do a lick of good.
    After all EFI was designed for Trusted Computing and Digital Rights Management, to act between the OS and hardware, can read drives, contact the Internet and everything.
    Windows doesn't use EFI, will have UEFI in Windows 8 though.

  • On my iPad I can only send I messages but not all my friends have apple products how can I set it up that other messages are send to

    On my iPad I can only send iMessages but not all my friends have an I pad or iPhone how can I send other messages too

    You will need to download a texting App from the App Store. I have seen Text + recommended on the forum.

  • JDBC sender channel running but not picking up the data from sp

    Hi,
    One of the jdbc sender channels in production is running at its schedule time but it is not picking up the data from the sql side, we have checked with the sp side and they are saying that sp is running fine. No changes have been done in its configuration. Last message coming in RWB  is Retry interval started but that is of 1 day and its already been 3 days. I tried by starting and stopping the channel but of no use. The channel was re activated but that also didn't help.
    Please help, what can be the reason for the same.
    thanks.

    Hi,
    The JDBCadapter ( The respective channel) is definitely locked in PI . Ideally for each polling interval a lock is being created and once the processing is over , the lock should be released/deleted automatically to allow further polling interval. If the lock is not released by the system automatically,further polling will not happen as expected. ( This may affect all sender JDBC adapters as well. I would recommend to do a check in all sender JDBC communication channels)
    You can see/delete the locks in Visual admin.
    Go to Server>Services->Locking adapter and click refresh
    The entries for JDBC adapter ( with name $XIDBAD.JDBC2XI) should be deleted by selecting those particilar entries and click delete selected locks.
    If you have more than one node, then same should be done in all server nodes.
    The temprory solution would be creating/copy the existing channel in ID with same properties and assign it into particular sender agreement.
    But, the lock may be created again which potentailly stops all your database interfaces. Hence i would suggest to use Disconnect From Database After processing of Each messages in Advanced tab in the sender JDBC adapter.
    Hope this solves your issue.
    PS: The same bahaviour would expected for all file adapter as well

  • Can send exrernal mail but not able to recieve exrernal mail

    I have a Mac Mini server that I am setting up DNS, Web, Mail, and Directory services on and am having a problem receiving external mail. I am able to send mail to external email addresses just fine. The bounce back email I get on the external email contains the following error...
    +The error that the other server returned was: 554 554 5.7.1 <[email protected]>: Relay access denied (state 14).+
    After setting the SMTP logging level to informational in Server Admin the error that shows up is below...
    +NOQUEUE: reject: RCPT from mail-yi0-f47.google.com[209.85.218.47]: 554 5.7.1 <secretary@REDACTED>: Relay access denied; from=<[email protected]> to=<secretary@REDACTED> proto=ESMTP helo=<mail-yi0-f47.google.com>+
    I have been fighting this for two days and am not sure where to go from here. I am not sure if this is a mail or DNS setting issue.

    Disregard the last post.  I made a few changes and this is where everything currently stands.
    This server is a MacMini Server that is hosted at Macminicolo.net.  I am looking to host several different websites for family and friends along with the mail services for each site.  The server does have two IPs setup on it 66.209.67.87 and 66.209.67.60 if that would help.
    I have changed the hostname of the server to server.minisrvr.com using the following comand
    scutil --set HostName server.minisrvr.com
    The new DNS records are below...
    minisrvr.com. is a primary zone
    A               server.minisrvr.com.          66.209.67.87
    CNAME     mail.minisrvr.com.             server.minisrvr.com.
    CNAME     ns1.minisrvr.com.             server.minisrvr.com.
    CNAME     ns2.minisrvr.com.             server.minisrvr.com.
    ebcwaco.org. is a primary zone (I wasn't sure if ebcwaco needed its own primary zone or not)
    CNAME     ebcwaco.org.             server.minisrvr.com.
    CNAME     www.ebcwaco.org.     server.minisrvr.com.
    The MX record resolves to server.minisrvr.com.
    Now everything except for DNS does not seem to be working for ebcwaco.org causing the website to not function.  If there is any additional information needed please let me know.  I am trying to get this up and running as soon as possible and am very greatful for your help.

  • Just setting up. Can send messages ok - but not receive at all - settings checked and ok

    Just setting up Thunderbird for the first time. Can send emails fine. Can't receive emails. Have confirmed settings with f2s/TalkTalk and they are correct.
    Where to now?

    Thanks folks.
    To gnospen:
    * ''Just a thought. Have you set up this pop-account anywhere else like in your smart-phone? Is that or your old mac running?''
    ?? I don't use my 'phone for emails, so, no.
    * ''"If its set up to download and NOT to keep it on the server, then there isn't anything to download, your smart-phone (whatever) has already downloaded it."''
    I don't understand this bit. I just want to use Thunderbird as I used to use Outlook. That is, when TalkTalk tell me I have exceeded my email quota I can download the emails to my machine (a MacBook Pro).
    '''''* ''''"I don't understand why you don't use IMAP instead as it can sync much better."'''''''
    I don't know the difference. It worked before with Outlook. I was advised by TalkTalk to use POP. (Don't remember being given the option of IMAP.)
    ====
    To zenos:
    ''* "This is going to be messy as talktalk have grown by acquisition of smaller ISPs and has inherited a large number of disparate email services. (I still have a lineone account myself and have also had tiscali, pipex and f2s in the past.) So we may need to know what domain the OP is on."
    We were with f2s - got bought by Opal then TalkTalk.
    ''* "Having said that, I scrolled through the options and they're all plain un-secured pop (110) and imap (143). So I don't understand why the OP has been steered towards an SSL port for POP3. None of them give "inmail.server.com" etc.
    ''* "To the OP: Have you tried just setting up the account as a new one, and letting Thunderbird find the settings for itself?"''
    This is my first time with Thunderbird. I downloaded and installed the programme, then followed the instructions for setting up. Plus inmail.server.com worked before and I was advised that this was correct. (btw, I presume I'm the OP??)
    ''* "Do you specifically want POP instead of IMAP? Why? "
    As noted above, it worked with Outlook; I was advised that POP settings were correct.
    ''* "Try setting your POP port to 110 and no security."
    Tried that. With pop 110 I get "...sending of password did not succeed. mail server responding: syntax error."
    Does this give anybody any further clues?

  • Send Mail from, but Not Include Mailboxes

    Any way to send mail from an account, but not include that account's mailboxes in mail.app

    Depends on the provider of any other accounts. For example, you can add an address to the preferences of another existing account, separated by a comma, and have that additional address available in the list of From addresses. Then if your SMTP will allow, you can send from that address.
    Doesn't work with the Gmail SMTP, as it will change the From to be what is used to Authenticate the SMTP.
    See:
    http://support.apple.com/kb/TA23485
    Another address can be set up similar to a true alias.
    Ernie

  • I can send text messages but not picture texts

    i use to be able to send picture text till the other day,now i can send text messages but when i go and add a picture or just send a picture tex it loads till the very lastpart of the bar at the top and stops, but i can recieve picture and text messages

    tailchasher wrote:
    yes it is on. i have been sendind picture text ever since i had gottin the phone till like 3 days ago and was gonna send a pic text and it said not delevered
    Then as already suggested... Check with your Carrier.

  • Why does my iPad recognise some contact names but not others I can send some messages but not others

    When I try to send messages some names are recognised and some are not

    If you are talking about iMessage... It will send messages to people that are using ios5, and have turned I message on on their device.   For your other contacts, you need to send a good old fashioned e mail.

  • I'm unable to send out mail on my macbook.  I can send on iPhone but not on my macbook pro

    I get a message that says: "cannot send message using the server AOL".  This happens not only with my AOL server but also with my iCloud and gmail servers as well.  I have checked to make sure the password is correct. 

    Try:
    OS X Mail: Troubleshooting sending and receiving email messages - Apple Support

  • The Early Watch report is being send in mail but not in PDF.

    Hi All,
    We ahve recently configured CEN system which is configured for early watch report using mails but it is not being sent in pdf
    it is being send in html.
    Can some one pleas ehelp
    Regards
    Yogesh

    Hello Yogesh,
    Earlywatch reports can only be generated in HTML and Word. Please take a look at below link for more details.
    http://help.sap.com/saphelp_sm32/helpdata/en/87/50cce344ae495bae240add66a28ed7/content.htm
    Thanks,
    Siva Kumar

  • Email sends on one but not the other laptop

    I have both a MBP and a MB with the same work email address set up identically on both. Both have been used to send and receive email with no problem until last night. Suddenly I cannot send email on the MB.
    Here's details:
    I'm using my work email - for here let's call it "[email protected]". This email is set up with it's incoming server as mail.xyz.net and outgoing server as smtp.comcast.net. The selected port is 110.
    So I can send and receive all the emails I like on my MBP using the above settings. The MBP is running Mail 5.1. One the MB, when I send any email using the exact same settings, preferences, everything - I get an error message saying the server - smtp.comcast.net has rejected the sender address of "[email protected]"
    I checked the "Connection Doctor" in Mail 4.5 and it says "[email protected] is connected and logged in" to the server. But soon as I send an email, BAM, the address is rejected?
    I talked with Comcast and they confirm their server is fine, IT IS NOT REJECTING my sender address "[email protected]" and they have no clue what's going on.
    Nor do I and before I pay APPLE $50 for support I thought I'd try here.
    Any ideas???
    Thanks

    Try changing the port to 995. I have no idea why that works but it helped when I had the same problem.

Maybe you are looking for

  • Is there Any way to All Calender?

    Is there any way in Developer 6i that To Insert Or Add a Calender Control in Developer Form If yes then what or how? Thanks.

  • Retrieve image from oracle table to vb front end

    Hi I want to create a table in oracle and want to insert an image to the table using lobs and i am trying to get display of image in visual basic form please help me solution send on [email protected] thanx

  • Export in Full HD Mode not possible ?

    I create my movies by the Canon 5D Mark-II with 1920 x 1080 Full HD Mode. After cutting it with iMovi I create a DVD normally. But for the future I would like to save the movie in best quality- The iMovi export function offer only up to 1280 by 720pi

  • Difference between diff ., P.O.

    Hi guru's Can anybody clarity that is there any difference between raw material procurement, Normal P.O. for traded goods while creating P.O., MIGO & MIRO. Please its urgent. regards tuljasingh,

  • Why the itunes download a update when I try to restore, if my ipad is already updated?

    When I try to restore, the ITunes search for update and ask to download the iOS 6.1.3 update of about 800mb, but my iPad is already 6.1.3. I can't restore because of this problem..