Arraylist Improperly transfered through ObjectStreams

code from client:
public void listen()
       String readtext;
       field.setText("");
       System.out.println("Starting to Listen");
       while(!socket.isClosed()){
                 try{
                dataType obj = (dataType)(in.readObject());
                switch(obj)
                     case String:
                     readtext = in.readUTF();
                     field.append(readtext);
                     System.out.println("Text recieved: " + readtext);
                     break;
                     case Userlist:
                     System.out.println("USERLIST UPDATE");
                     setUserList((Userlist)(in.readObject()));
                     break;
                        } catch (IOException e){}
                        catch(ClassNotFoundException cnfe){cnfe.printStackTrace();}
  private void setUserList(Userlist ul)
       System.out.println((ul.size()) + " Users");
       userlist.removeAll();
       for(int i = 0; i < ul.size(); i++)
       userlist.add(((User)(ul.get(i))).getName());
  }code from server's client threads:ClientWorker(Socket client, Server s) {
   this.client = client;
   this.server = s;
public void run(){
    String line;
    try{
      in = new ObjectInputStream(client.getInputStream());
      out = new ObjectOutputStream(client.getOutputStream());
    } catch (IOException e) {
      System.out.println("in or out failed");
      System.exit(-1);
    try{
     String userName = in.readUTF();
     This = new User(userName);
     server.UserNames.add(This);
     server.updateList();
     userset = true;
     } catch(IOException ieo){}
  ...code from server:  public void updateList()
       System.out.println((UserNames.size()) + " Users");
       for(int i = 0; i < Users.size(); i++)
       try{((ClientWorker)Users.get(i)).getOutputStream().writeObject(dataType.Userlist);
            ((ClientWorker)Users.get(i)).getOutputStream().writeObject(UserNames);
            catch(IOException e){e.printStackTrace();}
  }this code improperly prints the userlist (extends Arraylist) usernames object from the server to the clients
for one client, userlist usernames.size() = 1, works for both server and client...
for two clients:
client one:
userlist usernames.size() = 1 <- incorrect
client two:
userlist usernames.size() = 2 <- correct
it seems that after the first time the server sends the client the list that the list doesnt change on the client even though it is sending the same userlist object to all the clients

Your posted code is too fragmented to get clear understanding but if you are sending a same object repeatedly, try using writeUnshared() method instead of writeObject().

Similar Messages

  • How to create a positve pay file for ACH and Wire transfers through F110

    Hi All,
    I need to create a positive pay file for ACH and Wire transfers to the bank for auto clearing. For checks we have a standard program (RFCHKE00) to create the positive pay file which creates the output lists after the F110 payment process. Is there any standard SAP program available which creates the Positive pay file (Output list) for ACH and wire transfers through F110.
    Thanks
    Sridhar

    Please let your abaper create a 'Z' program using RFCHKE00. For example 'ZRFCHKE00' and use it in the same way as you currently use RFCHKE00 for checks.
    After the program is created, use SE38 and save it as a variant using your own specifications. Thereafter, in F110, when carrying out a payment run, under 'Printout/data medium', enter the program name under "Lists" with the variant. Then click on 'Maintain Variants' and make the necessay specifications there as well.
    Instruct your end-users to enter this program when running ACH and wire transactions through F110.
    Please let us know if this information was helpful.
    Thanks,
    Elias

  • Issues transfering through hdmi to tv

    Issues transfering through hdmi to tv. Is there a way to troubleshoot adapter?

    Hi,
    Please look at "Sounds" on your machine:
    Right click speaker ion,
    Select "Playback devices",
    Enable HDMI sound.
    If it's not there what do you have ?
    Regards,
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • HT201302 how to delete a album or photo transfered through itune?

    how to delete a album or photo transfered through itune?

    This must be done on the computer. The phone holds your pictures/albums hostage until you uncheck/unsync them from iTunes itself. You cannot delete them via the iPhone at all.

  • HR Report for viewing data transferred through CO1P transaction

    Hi,
    I have query here about HR data transfer which we do through CO1P transaction. How we can view these data transferred through CO1P in HR module i.e. any transaction or report is available from HR side which can give fair idea values which are passed through PP are visible in HR report / table.
    Your precious reply in this matter will be highly appreciated.
    Thanks in advance.
    Regards,
    Tejas Pujara

    Hi Friends,
    I gone through EVHR and another table LSHR as well which is saving entries confirmation timings i.e. time events and time tickets. But to my surprise, respective time fields entries are shown with 0 values in both tables. I cross checked with AUFNR that AFRU entries contain values for standard values i.e. set up , machine etc confirmed properly and updated in AFRU.
    But same AUFNR values transferred through CO1P are not updated with those values in HR tables.
    Any body can through light on this,
    Alternately, let me know in case I need to post this in HCM forum. Kindly suggest me exact where I need to post this since I found so many sub-categories under HCM section of SCN.
    Thanks & Regards,
    Tejas Pujara

  • How to measure data transferred through XI in a day (XI 7.0)

    Is there any transaction or T code which will help me determine data transferred through XI in a day or any period of time?
    Similarly how can I determine  the uptime for XI?

    Hi,
    The amount you see in RWB Performance Monitoring is in bytes, so just divide by 1,000,000 (1024 x 1024 to be exact) to get its MB equivalent or 1,000,000,000 (1024 x 1024 x 1024) for its GB equivalent.
    Hope this helps,
    Edited by: Mark Dihiansan on Jul 31, 2009 8:09 AM

  • HT201269 What type of data/information can be transferred through iCloud?

    Hi there,
    I just received my new iPhone 5, & I still have my old iPhone 3GS, which have all of my ringtones & songs that i used to listen to, & I would like to have them on my new iPhone 5.
    But the problem is that I no longer use my old PC, which used to have the data that my iPhone 3GS currently carry, such as Ringtones, Music...etc.
    So my concern is, Do Ringtones & Songs can be transferred via iCloud as well from my old iPhone to the new one? & what other type of data/information can be transferred through iCloud?
    & if my Ringtones have been successfully transferred to my new iPhone 5, would the ringtones be assigned to the same people that had their unique ringtones when they call me? Or shall I assign them manually by myself again?
    Waiting for your reply,
    Hosam

    Hi,
    You can Bind the Boolean type of webdynpro to the CheckBox in Adobe Interactive Form.
    Just define the value Attribute in the Context of type Boolean and bind the Checkbox in Aif with this attribute.
    Sample Code:
    if (wdContext.currentContextelement.reason == true)
    ur validations.....
    Regards
    Mustafa

  • I have just got an iPad and I want the music to be transferred through my iPod touch using iCloud but I didn't get the music from iTunes so I don't think it will let me do it. Do you have any tips that could help me?

    I have just got an iPad and I want the music to be transferred through my iPod touch using iCloud but I didn't get the music from iTunes so I don't think it will let me do it. Do you have any tips that could help me?

    Only photos taken with the iPad, copied onto it via the camera connection kit, or saved from emails/websites etc can be deleted directly on the iPad - either via the trashcan icon in the top right corner if viewing the photo in full screen, or via the icon of the box with the arrow coming out of it in thumbnail view.
    Photos that were synced from a computer are deleted by moving/removing/de-selecting them from where they were synced from and then re-syncing. If you want to remove them all then normally you could just sync an empty folder (in terms of photos) to the iPad, but as you don't want to sync at the moment you can't do that.
    You can reset the iPad back to factory settings and start from scratch with it : Settings > General > Reset > Erase All Content And Settings

  • 'QM value transferring through process messages'

    Hi,
    What exactly 'QM value transferring through process messages' means ?
    Regards,
    Samir

    Hi wadajkar ,
                   When you are using the  PI sheets for the Process mangaement Functionality. Some Of QM realated values can be tranfered through the Process messages. e.g . when process order is confirmed , inspection lot can be sent through the process messages. Some of the below QM related can be processed through process messages
    inspection char
    inspection lot
    inspection result
    inspection short text
    Thanks,
    Rajanikanth

  • My Ipad got switched off while file transfering through bluetooth and not switching on

    My Ipad got switched off while file transfering through bluetooth and not switching on

    If your iPad is not switching on then try a reset : press and hold both the home and sleep buttons for about 10 seconds when the Apple logo should appear (you won't lose any content, it's the iPad equivalent of a reboot).

  • File not found in shared folder when transferred through Open Dataset

    Dear Experts,
    I am transferring a file to a shared folder using open dataset .
    The sy-subrc value returns as 0 . But i am not able to find the file in the destined path.
    But when i try to retrieve the file from the same path through CG3Y to my local PC ,  i am able to retrieve the file.
    Could you please throw some light into this as to why this is happening.
    With Regards,
    Syed Ibrahim G

    Hi venkat,
    Sorry for the delayed response . The Authority check FM also returns the sy-subrc value 0 .
    But still not able to find the File . I am Trying to paste the data through FTP_R3_To_SERVER . But it is not supporting Non-English Characters. Is there any way to paste the file through FTP ( with Non English Characters ).
    {code}
    call function 'FTP_CONNECT'
       exporting
         user            = user
         password        = pwd
         host            = host
         rfc_destination = dest
       importing
         handle          = hdl.
    if sy-subrc = 0.
       CALL FUNCTION 'FTP_R3_TO_SERVER'
         EXPORTING
           handle               = hdl
           fname                = FNAME
    *      BLOB_LENGTH          =
          character_mode       = 'X'
    TABLES
    *  BLOB                 =
          text                 = it_data1
        EXCEPTIONS
          tcpip_error          = 1
          command_error        = 2
          data_error           = 3
          OTHERS               = 4.
    endif.
    {code}
    With Regards,
    Syed Ibrahim G

  • Text not transfered through Interface...

    Hi Experts:
    We have created an interface between two SAP installations. The PO Created in one system should be converted and posted as an SO in the other server.
    Here we have two scenarions;
    1. In Outbound server, an SO will be created, it will be converted to PR and PO will be genetared automatically and will be sent to second server as SO through Idoc. This is working fine, and SO is posted in second server with all the data incuding Text.
    2. In Outbound server,We create a PO manually and send it to another Server.  Here all the data is getting posted in SO instead of the Text.
        Here basically the customised PO text Id (F07)in Outbound Server is 3 characters. The same is being passed on to the other server, (The recieving  
        Side Idoc is having all the data including the text, text object and text type). But it is not getting posted to the the sales Order.
       The sales Order Text ID is 4 char(ZITP) ( The Po text Id being passed is different to the SO text Id ).
    Thanks,

    Hi Simi,
    The mapping of Text ID of PO to Text ID of SO can be acheived in many ways.
    You have a couple of user exits in IDOC_INPUT_ORDERS where you can write code to manipulate the correct segment field.
    Or you can do it by creating mapping rules in  transaction SALE and assignng the rule to a SENDER and RECEIVER. See Below
    <b>Converting Data Between Sender and Receiver
    The tool can convert and map field contents from a sender field to a receiver field. Organizational units, units of measurements and customer-defined field contents can be transferred from one system to another.
    A standard tool can be used to define and maintain conversion rules in ALE.
    These rules are defined in this section by carrying out the following steps:
    1. Define rules:
    Rules are always defined for each segment.
    2. Maintain rule:
    Conversion is carried out at field level following the defined rules.
    3. Assign rule to IDoc:
    The assignment defines when the rule is to be used. This is defined for the sender/receiver and message type.</b>
    The path is SALE -> Modelling & Imp... -> Convert Data between sender and receiver .
    Cheers

  • File dissapears after transfering through finder...

    This is starting to get to me. I have two finder windows open, im transfering a file from one finder window to another finder window(on our internal network at work, this also is occuring when uploading to our FTP through the finder) and after appearing to have succesfully transfered the file goes poof! dissapears. It is not cosmetic because i've checked on another comp as a different user and it is not there. Pleeeeaassee help.

    Try cutting and pasting the file/s.

  • Regarding an error when an idoc is transferred through ALE

    hi guys,
    i have designed a custom message type and sent an idoc from server 1 to server 2 ( receiver system ) <b>using ALE</b>, idoc is transferred fine but data in idoc is not sent to receiver system i mean, there is no data in idoc.
    i received an error saying: idoc transferred with errors at inbound system.
    <b> it displays status 56 i.e EDI: partner profile not defined.</b>
    but partner profile and model view for both outbound and inbound system have been absolutely configered.
    can you plss help me with this.
    thanks very much
       pavan

    hi appana,
    thx for ur suggestion, actually outbound idoc is populated but problem is with inbound idoc - there is no data in it.
    what exactly do u mean by partner profile maintained for this idoc at inbound, actually i have created partner profile at inbound using we20 and assinged custom message type and process code ( functin module developed by me) to msgtype.
    can u be elaborative.
    thanks
    pavan.

  • Accessing ArrayList of Bean through c:forEach

    I have created a bean type array list. Now I wanna show the values in a jsp page, for which I wanna use <c:forEach> tag.
    From a servlet I hv sent the arraylist thru session by
    request.setAttribute("BeanVal",list);
            rd= request.getRequestDispatcher("myPage.jsp");Then in jsp page its collected as
    ArrayList <ReportBean>list= (ArrayList)request.getAttribute("BeanVal");Then to show the data I used the code
    <c:forEach var="i" items="${list}" >
                                        <c:out value="<tr><td>${i}</td></tr>"/>
                            </c:forEach>The list is perfectly displayed by scriptlets.Some body please help me.

    Java_Subhadip_P wrote:
    Then in jsp page its collected as
    ArrayList <ReportBean>list= (ArrayList)request.getAttribute("BeanVal");
    No need to do it.
    Just get it in the c:forEach items:
    <c:forEach var="i" items="${BeanVal}" >

Maybe you are looking for

  • Field Selection for MIRO

    Hello We want to Open the Currency field in MIRO, For the Import PO we want to change the currency field in MIRO, to Local currency How can we do the same, as of now the field is coming gray Regards Niti Narayan

  • A sticky problem updating fields on a tabular form

    I have an application where I'm trying to match skillset supply to skillset demand. We have resources and we have work for resources to do. Resources possess a set of skills. Work requires a set of skills. Skillsets are described by three fields: Dom

  • Viewing pdf error

    For some reason I can no longer view pdf's properly on my macbook pro. I can open and download them, but there is no text--only squares with question marks in them. Help!

  • Server Admin runs very slow on Server 10.6.2

    After what only could be called a power disaster that brought our XServe down hard, when I run Server Admin on the XServe, it's dog slow...it works, but it takes forever to do anything. However, Server Tools installed on my Macbook runs it just as fa

  • OBIEE Admin tool fails to start

    Hi, We have installed OBIEE 10.3.3.2 and app 7.9.4 in windows 2003 server. We will not start anything on this windows box, but will open the Administration and change rpd file in offline mode. But when I am going to Start->All Programs->OBI->Administ