Send file with RMI

Hi,
I tried to send a file from client to server with RMI as follow:
upload(String filename, InputStream in);
however the InputStream is not a Serializable.
1. Is it a correct method to send the file in RMI ? if not, what should be used?
2. How to "Serialize" the InputStream, I have tried to pass the "SerailInputStream" extends from InupStream object implements Serializable as a byte array by the ObjectOutputStream and retrieve it in server successfully, but the inputstream seems cannot be used.
Many thanks
George

PipedIn/OutStreams used to commnicate inter-thread transfer. I guess bschauwe are guiding the way how to smoothly handle the file transfer inside the server. The communication to server seems not through the java streams classes.
if what you want to do is to copy a file in whole. You may send a byte array in a serializable wrapper class. You can create a byte array of a file by using ByteArrayOutputStream and call toByteArray(). Finally in the server side, with the raw byte array, you can create a new ByteArrayInputStream(byte[]). You know the rest of story.
Or you can create a serializable class that extends InputStream and similary behaves like ByteArrayIn/OutStream. In this case, you have to know how to make a sub-class of non-serializable super class serializable. There is tutorial in the SUN site covering this subject. If you also look at the source codes of both InputStream and ByteArrayInputStream, there is no rocket-science there.
Frankly, I have not tried myself yet. I am also looking forward to hearing the better suggestion.
Hope it helped.

Similar Messages

  • How can I send Files in RMI

    I'd like to know how can I send files from one computer to another, because I'm making a Client-Server application and I need to send files, in my program de client needs to send a file to the server and the server has to save the file in the computer where the server is running, and I'd like to know if there's some way to sends files with sockets.

    Cleint
    1. reads the name of the file sent by the server
    2. get the file from sec memory
    3. put it into a byte stream(read the file as byte)
    4. typecast to inputstream of the rmi server
    server
    read the inputstream and write to the file

  • How to send file with original name through Mail adapter

    I have to send file with original name as attachment through Mail Adapter. I am picking the file from FTP server through File Adapter. I am not using message mapping because files do not have any standard format.

    Hi,
    Have you solve your problem ?...
    I have exactly the same scenario : pik up a file (file adapter) and send it in attachment by mail adapter without mapping (no IR)...
    I activated Adapter specific paramters properties in the File adapter sender and i can see the FileName tag in DynamicConfiguration section of SoapHeader in SXMB_MONI...
    I want to use MessageTransformationBean... BUT, how can i 'access' to FileName tag ???...
    Thanks...
    I setup modules like this :
    AF_Modules/DynamicConfigurationBean 1
    AF_Modules/MessageTransformBean rename
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean mail
    1 key.0 write http://sap.com/xi/XI/System/File FileName
    1 value.0 message.FileName
    rename Transform.ContentDisposition attachment;filename=message.FileName
    rename Transform.ContentDescription message.FileName
    rename Transform.ContentType application/csv-tab-delimited-table;name=message.FileName
    But my file name attachment is message.FileName....
    Edited by: Emmanuel JORAND on Sep 29, 2008 9:23 PM
    Edited by: Emmanuel JORAND on Sep 29, 2008 10:25 PM

  • System error when send file with Sender File Adapter

    Hi all,
    I have configured a "File To ABAP Proxy" scenario. After configuring, i executed a "Test Configuration" in Integration Directory and it's all OK. But this file unable to reach into ABAP Proxy Target. In the Runtime WorkBench\Message Monitoring,  I get an error message in below:
    Engine: Adapter Engine     
    Status: *System Error     *
    Start: 15.08.2008 14:04:01     
    End: 15.08.2008 14:19:01           
    Sender Service: BS_XI_SERVER     
    Interface Servic: urn://FILE_TO_PROXY
    MI_EMPLOYEE_OB
    In this case, I don't know why my Sender File Adapter is error and why status is "System Error" and why it can't reach into Target System. Can it concern a role user?
    ( For more clearly: I configured the source file and the path correctly. And i used the xml file with the content and the document name correctly. In general, the Sender Adapter File don't convert the sender file and its content is same as the Payload in the "Test Configuration", i think it is all OK.)
    Could anyone please help me to resolve this problem, anyone can explain this error, how can i resolve this error?
    Thanks a lot in advance,
    Vinh Vo

    Hi Chirag,
    1.I source structure is very simple as below:
    <ns0:MT_MATERIAL xmlns:ns0="urn://FILE_TO_PROXY">
       <MATERIAL>
          <WERKS>1000</WERKS>
          <MATNR>MAT00001</MATNR>
          <MAKTX>Chemical Material</MAKTX>
       </MATERIAL>
    </ns0:MT_MATERIAL>
    2. the Communication Channel Monitoring in Runtim WorkBench\Adapter Engine is OK for my Sender File Communication Channel, it's in Blue Light.
    However, i don't know what's FCC?
    Thanks and best regards,
    Vinh Vo

  • Send file with TCP/IP

    I would like to transfer a complete file with TCP/IP form a client to a server. I have a working example of using the TCP protocol to transmit data (as a string). I attached this Client-VI to this posting. The server program does nothing more than send the received data back to the client. Is it possible to send complete files with TCP/IP instead of sending strings? If so, would you be so kind and change my VI into a new one and send it back to me?
    If somebody has another idea to solve this problem, feel free to contact me!
    I use LabVIEW 7.0Express and WindowsXP.
    Thnaks, Dennis
    Attachments:
    ipc@chip_1.vi ‏38 KB

    Hi,
    I have a set of Vis that do the job. It's a LV5 Vi and I haven't translated it yet to LV7. It's two SubVis and two Vis that show you how to run the SubVis. The client asks a file that is in the server and the server sends it back. I'm attaching the two libraries llb, the client library and the server library. Please contact me if you have questions.
    Marce
    Attachments:
    TestTCPServerGetFile.llb ‏205 KB

  • Is there a contextual menu plug-in to send files with Mail?

    Anyone have any ideas if there exists a contextual menu plug-in that works between the Finder and Apple Mail which would allow you to email a file with a simple right-click.
    Unfortunately to make a comparison with a PC, in the same way that you can select +Send To+ > +Mail Receipient+ via the contextual menu.

    You can also make one yourself with Automator.
    With Automator (/Applications/Automator):
    Select "Files & Folders" and set 'Get content from' to "Use files and folders selected in the Finder when workflow runs"
    From the far-left panel, under Library, select "Mail".
    Drag "New Mail Message" and drop it under "Get Selected Finder Items" shown on the far right panel
    Select "Save as Plug-in" from the File menu. Give it a meaningful name.. "Send with Mail" should be OK. The plug-in type you want is "Finder"
    The action is now available from the contextual menu: More -> Automator -> Send with Mail
    Have a nice day

  • How to block send file with skype on windows store...

     Hi all,
     In domain environment, we can prevent users send file through skype by GPO with adm.
     (Link: http://community.skype.com/t5/Windows-archive/Blocking-file-transfer/td-p/1758460)
     But with skype on windows store (Like: Windows 8 ), this way isn't useful.
     So Is there anyway to we block send file on skype windows store?
     Thanks.

    Sorry, that isn't a Firefox support issue. Try AOL support for help with that.

  • Can't send files with OS X 10.9 Messages.app

    Hi,
    I upgraded from Lion to ML, and I was using Messages BETA in Lion before the update. Back in 10.7, I was able to send files (pictures mostly) with Messages to any other iMessage available contact.
    After the update to Mountain Lion, I can't send files any more, and have a lot of log entries about it:
    20-08-12 21:49:21,447 Messages[252]: [Warning] -[ChatTranscriptViewController _increaseResourceLoadCountForURL:] url called for url: ichat-resource://coreui/exclamation-pressed with nil _loadingIdentifiers
    20-08-12 21:49:23,337 com.apple.imfoundation.IMRemoteURLConnectionAgent[293]: [Warning] Denying xpc connection, task does not have entitlement: com.apple.private.imcore.imremoteurlconnection  (IMTransferAgent:292)
    20-08-12 21:49:23,337 com.apple.imfoundation.IMRemoteURLConnectionAgent[293]: [Warning] Denying xpc connection, task does not have entitlement: com.apple.private.imcore.imremoteurlconnection  (IMTransferAgent:292)
    20-08-12 21:49:23,338 com.apple.imfoundation.IMRemoteURLConnectionAgent[293]: [Warning] Denying xpc connection, task does not have entitlement: com.apple.private.imcore.imremoteurlconnection  (IMTransferAgent:292)
    20-08-12 21:49:23,339 com.apple.imfoundation.IMRemoteURLConnectionAgent[293]: [Warning] Denying xpc connection, task does not have entitlement: com.apple.private.imcore.imremoteurlconnection  (IMTransferAgent:292)
    20-08-12 21:49:23,339 com.apple.imtransferservices.IMTransferAgent[292]: [Warning] Remote loader crashed for request: <NSMutableURLRequest http://init.ess.apple.com/WebObjects/VCInit.woa/wa/getBag?ix=1>
    20-08-12 21:49:23,340 com.apple.imtransferservices.IMTransferAgent[292]: [Warning] Bag loading failed! Error (__kIMRemoteURLConnectionErrorDomain:-1): No se ha podido completar la operación (error __kIMRemoteURLConnectionErrorDomain -1). (null)
    20-08-12 21:49:23,341 com.apple.imtransferservices.IMTransferAgent[292]: [Warning] Remote loader crashed for request: <NSMutableURLRequest http://init-p01md.apple.com/bag>
    20-08-12 21:49:23,341 com.apple.imtransferservices.IMTransferAgent[292]: [Warning] Bag loading failed! Error (__kIMRemoteURLConnectionErrorDomain:-1): No se ha podido completar la operación (error __kIMRemoteURLConnectionErrorDomain -1). (null)
    The file transfer window in Messages shows "0 of XX KB sent" for all the files that I send, but at least I can recieve files from other iMessages available contacts.
    I also followed this hint without any luck so far: https://discussions.apple.com/message/19224592#19224592
    Does anyone knows how to solve this?
    Regards,

    Hi,
    Open Activity Monitor  and see if that IMTransferAgent is listed as running (it should launch and quit so fast that you can't read it)
    If it is listed then use Activity Monitor to Quit it.
    10:50 PM      Thursday; November 1, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Sending files with 4.3.0.37 is "duplicating" trans...

    Hello everyone.
    I've been using Skype on Linux ( Ubuntu currently ) for some time now, and never ran into this issue previously.
    I couldn't get more than two attachments to go through, so I had to upload the images online.
    When sending any file via Skype. The file transfer initially shows a dialog as I expect with the single file ( s30.postimg.org/w17yx5vdt/skype_issue_step_1_of_3.​png ). Then, once the user accepts the transfer ( doesn't matter their Skype version ), a "duplicate" entry shows up (
    s30.postimg.org/vpqikeext/skype_issue_step_2_of_3.​png ) . The transfer then completes as it normally would but when it's complete, I'm still left with the duplicate ( s30.postimg.org/wtamwczkx/skype_issue_step_3_of_3.​png ) .
    Besides the obvious issue, this has grown to become a pain, as I send several files throughout the day, and I can't auto-clear them out with this issue.
    Does anyone know of a workaround for this, or is there a way I can submit a more formal bug submission somewhere?

    Yes, sorry for not being more clear in my original post. This happens now on the latest Skype for Linux ( 4.3.0.37 ) regardless of the recipient, for which I've confirmed none of them are running second instances ( as SørenHolm has confirmed ).
    To clarify, I've confirmed with every contact I've sent files to that they are only running a single instance, but yet for every client I send files to with the new client, I'm experiencing the issues outlined in my first message.

  • I cannot send files with Adobe Send as no button on screen

    There is no "send" button on my screen when trying to send files by Adobe Send. I had no problems with SendNow and am a subscriber. How do I get it to work?

    PeterHelp
    Files
    Send
    Fill & Sign
    Export PDF
    Create PDF
    Combine Files
    Organise Pages
    Acrobat
    Selected Files+ Add Files
    80004721.tif
    80004751.tif
    80004871.tif
    80004901.tif
    80004971.tif
    80004991.tif
    Recipient Page
      Add Your Logo & Colour  (Edit) <>
      Create Anonymous Link  (with basic usage information)
      Send Personalised Invitations  (with detailed tracking)
    Send To
    [email protected]
    Subject & Message
    Cancel
    [email protected]
    Peter Marsh Photography
    11 Duck Lane
    Laverstock
    Salisbury
    SP1 1RS
    UK
    Tel:     01722 337903
    Mob:  07831 484604
    Email: [email protected]

  • Cant send file with outlook in preview

    Hello,
    I'm a new Mac user and must say very happy with my change.
    However I have one problem I can't seem to solve.
    My work forces me to use Microsoft Outlook on my Mac.
    But I can't seem to figure out how to send files from the preview program.
    When selecting "send e-mail" in preview. It always opens the Mail program, even though I set Outlook as the standard mailing program.
    Anyone has an idea on how to fix this?
    Thank You!

    Hi Sig,
    I also used your advice to add outlook to convert to pdf...Thanks
    I now sit with the problem that when I click on the Outlook tab, it opens up the window in the background of my desktop, and I have to "minimise panels" in order to get to it? Any advice, on how to just get the window to pop up when clicking on Outlook PDF?
    Hpe this makes sense?
    Cheers
    N

  • Sender File with FCC coming with empty file

    Hi Experts,
    Scenario: File(FCC) to Proxy
    Error: CSV file picking up from source directory but its showing empty in sender CC (Actual file contains data in source directory) and find below attached Conversion parameters. Please let me know if any changes in the configuration.
    Document Name: MT_Legacy
    Document Name space: http://retails.com/pi/LEGACY/Purchasing/TECHNICAL_DATA
    Recordset structure: Header,,Items,
    Recordset sequence: Ascending
    Keyfiled names: NumFacture,Constant
    ignoreRecordsetName----
    true
    Header.fieldNames----
    a,s,d,f,g,e
    Header.keyFieldInStructure----
    ignore
    Header.keyFieldValue----
    05
    Header.endSeparator----
    nl
    Header.fieldSeparator----
    Similar to Items also
    Query: is this error related to source file (unexpected format) or Sender File CC configuration.
    Regards,
    FHM

    Hi HK,
    I see that there are two keyfield names in your content conversion. Are they for different nodes?
    " Keyfiled names: NumFacture,Constant "
    Yes...those are coming from two different nodes like one from Header and another one from Items.
    And also the you have provided key field value as 05 and what about the other key field?
    Another key field value have given 43
    one more thing Key filed value must be always constant right?
    Thanks,

  • Send File with Bluetooth

    I am attempting to send/beam a file to another friend using Bluetooth and my Bluetooth is enabled, but when I click the "Send File" tab under my Bluetooth icon nothing happens.
    Suggestions?

    for what it is worth, i have never been able to get the dropdown menus from the bluetooth icon to function in Tiger, UNLESS i open and keep open in the background 'Bluetooth File Exchange' located in the utilities folder. the behaviour is odd and i am surprised no one else has noticed this 'bug'.

  • Sending file with bluetooth from laptop to phone

    I am having great difficulty sending file from laptop to phone using bluetooth. I can send files from phone to laptop.
    I have followed the instructions from this link: http://wiki.archlinux.org/index.php/Bluetooth .
    also i am using xfce4 as my Desktop Environment.
    any other help would be greatly appreciated.

    The thing is, this is not the topic you started, so it is solved . The OP used Xfce, and I linked him to a solution on how to do so - on Xfce. So yes, it is solved. He's the only one to say so. As you say, your problem is different, so you might want to bump your own topic instead .

  • Sending files with and without BPM in one Interface.

    Hi All,
    I have to send three files to my receiver system. 2 files of same structure after little mapping need to be merged into single file (Using BPM) and once this is successful the third file needs to be posted without any mapping.
    I have thought of
    1. using two communication channels activated using a UNIX script externally
    2. using two comm channels with a activation time difference, i.e the 3rd file should be polled after some time when the first two files polled, but this is not helpful as if the two files doesnt process properly then 3rd file is not desired.
    Now my question is can we do this scenario using 1 comm. channel with EOIO , masking or anyother option.
    <b>Note: the third file should always be send after the processing of the first two files completes successfully.</b>
    Thanks & Regards.

    1. put two file in source folder and make synch scenario using BPM ,
    2. put third file in some other folder than source folder.
    3. after getting successful synch file responce, in the synch receiver file channel run OS command to put third file from other folder to source folder.
    hows that ???

Maybe you are looking for

  • Problem transfer TFTP through ASA 5505

    Hello, I have a problem with my ASA 5505, I am not able to transfer files bigger than 100ko using TFTP. Below my archiecture: CME<->ASA5505<->SW3650 Here is what I get when I try to download a file located on the 3650 on my CME: CME#copy tftp flash A

  • New PC, New iTunes, how do I put Music/Video from my iPhone onto new PC?

    Hi, My dad's old PC crashed (for the final time) and he went and ordered yet another PC (Dell) anyway, he's looking to know how to get all his music and video's off his iPhone and saved into the new iTunes? I though i'd ask first before I go and have

  • Inactive Items Report

    I would like help writing a query similiar to the inactive items report except i need to show components that have not had any transactions in the past 24 months. i figured i can query the oinm table but not sure how to write this query. thanks, Rich

  • Transferring from laptop to laptop?

    I'm upgrading to a desktop (imac) and want to give my laptop to my spouse (whose laptop is on the fritz).  After I run migration assistant (or whatever they are calling it now) on the new iMac to get my stuff from Laptop 'A'  onto the desktop, what's

  • One problem about ECL Viewer

    We marked the checkbox - Greyscale 24bit(for TIFF) to get a better picture quality in EDS setting(options->colors), but seems the EDS-Viewer cannot “memorize” this setting – when closing the document and reopening, the viewer still has bad quality ag