File writing using telnet

hi
Am login to a remote system using telnet.
After executing some commands like...ls,onstat -l etc.,
When i try to write the output into file some junk chars getting added.
How can I avoid the junk chars.???
thanks in advance

You will need to, the TELNET server will be sending you commands, and asking questions (like "what are you" and "ECHO OFF"), you need to be able to atlest ignore them.
I Commons Net has Telnet implementation.
Also the applications might send control chars to your application ("Red font please", and "clear the screen"), you need to be able to ignore these commands as well. Look up ASCI.

Similar Messages

  • How to open a text file without using dialog box

    I can open a file using dialog box but I want to open a file without using any dialog box for writing.
    With the following commands a new file is created.
    File outputFile = new File("outagain.txt");
    FileWriter out = new FileWriter(outputFile);
    I want to open an existing file and put some more text in it using FileWriter or any other object
    rgds,
    Arsalan

    import java.io.*;
    class UReader
        BufferedReader in;
        BufferedReader input;
        String fileName;
        public UReader(String fileName)
            this.fileName = null;
            this.fileName = fileName;
            try
                in = new BufferedReader(new FileReader(fileName));
                input = new BufferedReader(new FileReader("A.b"));
            catch(IOException _ex) { }
        public final String getContent()
            String txt = "";
            try
                while(in.ready())
                    txt = txt + in.readLine();
                    txt = txt + "\n";
                in.close();
                txt.trim();
            catch(IOException _ex) { }
            return txt;
        public final String getLine(int row)
            try
                input = new BufferedReader(new FileReader(fileName));
            catch(IOException _ex) { }
            String txt = null;
            if(row <= getRows()) {
                try
                    for(int i = 0; i < row; i++)
                        txt = input.readLine();
                    input.close();
                catch(IOException _ex) { }
            } else {
                txt = "Index out of Bounds";
            return txt;
        public final int getRows()
            try
                input = new BufferedReader(new FileReader(fileName));
            catch(IOException _ex) { }
            String txt = null;
            int rows = 0;
            try
                while(input.ready())
                    txt = input.readLine();
                    rows++;
                input.close();
            catch(IOException _ex) { }
            return rows;
    import java.io.*;
    import java.util.*;
    class UWriter
        PrintWriter out;
        String fileName;
        String[] txt;
        static int NEW_LINE = 1;
        static int APPEND = 0;
        public UWriter(String s)
            fileName = null;
            txt = null;
            fileName = s;
            try
                out = new PrintWriter(new BufferedWriter(new FileWriter(s, true)));
            catch(IOException ioexception) { }
        public final void addContent(String s, int i)
            int l = 0;
            StringBuffer sb = new StringBuffer(s);
            s.replaceAll("\n\n", "\n###\n");
            StringTokenizer str = new StringTokenizer(s, "\n");
            String token = null;
            while (str.hasMoreTokens()) {
                ++l;
                token = str.nextToken();
            str = new StringTokenizer(s, "\n");
            txt = new String[l];
            int k = 0;
            String test;
            while (str.hasMoreTokens()) {
                test = str.nextToken();
                if (test.equals("###")) test = "";
                txt[k++] = test;
            if(i == 0) {
                try
                    for (int j = 0; j < txt.length; ++j) {
                        out.println(txt[j]);
                    out.close();
                catch(Exception ioexception) { }
            } else {
                try
                    out.println();
                    for (int j = 0; j < txt.length; ++j) {
                        out.println(txt[j]);
                    out.close();
                catch(Exception ioexception1) { }
        public final void writeContent(String s)
            int l = 0;
            s.replaceAll("\n\n", "###");
            StringTokenizer str = new StringTokenizer(s, "\n");
            String token = null;
            while (str.hasMoreTokens()) {
                ++l;
                token = str.nextToken();
            str = new StringTokenizer(s, "\n");
            txt = new String[l];
            int k = 0;
            String test;
            while (str.hasMoreTokens()) {
                test = str.nextToken();
                if (test.equals("###")) test = "";
                txt[k++] = test;
            try
                PrintWriter bufferedwriter = new PrintWriter(new BufferedWriter(new FileWriter(fileName, false)));
                for (int j = 0; j < txt.length; ++j) {
                    bufferedwriter.println(txt[j]);
                bufferedwriter.close();
            catch(IOException ioexception) { }
    }Maybe they are not the best codes, i wrote them a long time ago, so dont ask why i did anything wierd. :D
    But anyway it works.

  • Save the files of my HDD, please. (Extremely slow: 0,05 Mb/s and "file in use").

    Hi all,
    This is probably the first time ever that I have to ask a question myself. Usually when I have any problems I can find a solution in other people's solved threads. But not this time and I'm really frustrated. If any of you can help me with this I will be eternally grateful.
    I have a 1TB WD external hard drive with 500Gb of millions of files, really important data that is not copied anywhere else right now.
    Around the time I upgraded to Maverick's I think (not 100% sure) I started having problems when I wanted to copy files from the HDD. Some files would randomly give the error "The operation can’t be completed because the item X is in use". Some not, but since I have millions of files, I would try to copy folders, and whenever one of these files gave an error, the whole operation would be canceled and all the copied files deleted. Copying one by one is not an option, especially because there are some that don't even work individually, maybe 1/3 of them, I don't know.
    I started looking on the internet about the problem and I found many people having the same one. However, they circumstances were usually different, not wanting to copy from an external HDD, but maybe they just wanted to delete some file or talking about some network thing saying some terms that I don't understand like NAS, SMB shares, AFP, so I thought that that wasn't my case. For the ones whose circumstances were similar, I tried every single option that I found. Here is what I tried so far:
    -Copying not the files but the "mother/s folder/s (in many different ways and it definitely didn't solve anything).
    -Killing some process called "Unmount blabla" I don't remember.
    -Disabling the icon preview in finder. I thought it would solve it because everyone said it did, but not for me : (
    Note that so far, while I couldn't copy the files, the speed at which it tried or it copied some was a normal one.
    Then I went to disk utility and tried to repair the disk, thinking something was wrong with it. The first time I could verify, but not repair. It didn't solve anything obviously. The second time I couldn't even verify it.
    Then I decided to upgrade to Yosemite thinking this might solve a possible Maverick's problem.
    My God, it didn't. Now, not only it keeps saying that the files are in use. Now every time I plug the HDD, it takes around 15 minutes without recognising it, until finally a message pops up "This disk can't be repaired. You can still copy files from it, but backup as many as you can and then erase the volume". (It seems it automatically tries to repair it now?)
    As if that wasn't enough, once the device is recognised. It seems that the speed at which it reads the files inside has been dramatically decreased. If I try now to copy some files. Like an iPhoto Library of 4 Gb, it copies at approximately 0,05 Mb per second, with an estimated time of 24 hours for 4 mere Gb. It would take a whole year to transfer 500Gb. But of course, not even that since after waiting one hour, it gives the same problem "file in use".
    It seems to be more the reading than the writing since when I copy big files that are not in populated folders (and that are not the "evil / in use" files) it does it faster.
    Erasing is not an option, there are just too many important things. I know, I should have had 2 copies, but this is the situation now...
    I tried downloading a recovery software and I tried with some Stellar Phoenix Data Recovery or something like that. The first times I tried recovering files from it, it would do it at the same ultra slow speed. One of the times, randomly it copied all the files at a normal USB 3.0 speed (I had forgotten how fast that was), but all the files were completely unreadable. When I tried to open them it said they were damaged.
    However, it's not that the files are damaged because when I try to copy them manually they can be opened normally. But of course, at the slowest speed in the world and only a fraction of them.
    If you can help me solve this issue, I really would be in debt forever. I haven't end up in a dead end like now and I really need to recover the data.
    Thank you so much in advance.
    Jose

    Get rid of Trusteer. It doesn’t work well under Mac OS.
    Trusteer Rapport Uninstall
    Activity Monitor - Mavericks  also Yosemite
    Activity Monitor in Mavericks has significant changes
    Performance Guide
    Why is my computer slow
    Why your Mac runs slower than it should
    Slow Mac After Mavericks
    Things you can do to resolve slowdowns  see post by Kappy

  • Not Able to use telnet and Rlogin

    Hi, since two of my system had unclean shutdown i am not been able to use Telnet and Rlogin or even SSh from my both of my system. the file in "/etc/default/login" is commented and there are system's entry in /etc/hosts file also. but still am not able to login i can ping both the system with each other. i am not even able to telnet localhost..!
    "sunshine# telnet localhost
    Trying 127.0.0.1...
    telnet: Unable to connect to remote host: Connection refused"
    Thanks
    atif

    are you sure your services are UP ?
    you can try :
    netstat -an | grep 23
    in order to see if port 23 is in LISTEN.
    or ps -ef | grep inetd
    to see if (x)inetd is running (inetd is the daemon who launches telnet/rlogin)
    and if you're under solaris 10, just do something like :
    svcs -a | grep telnet
    to see if the daemon is online (if he's in maintenance, do a svcs -l telnet, and check the logfile associated to the service to see what happened)

  • FTP and "File-in-use"

    Dear all,
    We have a scenario in which a file is written to the SAP application server which should be picked up by XI using the FTP adapter. The polling interval of the adapter is set to 60 seconds.
    We running into a strange problem: it may occur that the program on the SAP application server is still busy writing the dataset to the server, however the file already exists (as soon as the OPEN DATASET statement is passed the file is created on the application server but with no content yet). If just at this time the interval of 60 seconds is passed the FTP-adapter picks up the empty file, does no processing because the file is empty, but still archives the file to an archive directory.
    Obviously the OPEN DATASET does not put an exclusive lock to the file? Does anyone know a solution to this?
    Kind regards,
    John.

    Hi,
    use .tmp extension to the file untill it completes writing the data, then change it to original extension.
    for eg: if it is a .txt file then use .tmp untill the file is written and then change it to .txt this is not a big logic at SAP, just renaming the file after completing the write.
    Regards,
    Karan.

  • I can't compile forms using telnet ....

    i have an application server with linux redhat 4 software.
    i have a shell that is named ' cpfdry.sh ' which is found on the path '\\192.9.200.2\apps\forms_to_compile'.
    the contents of the shell is
    for i in `ls *.fmb`
    do
    echo compiling form $i
    /home/apps/as/bin/frmcmp.sh userid=dry/dry@dq Module=$i batch=YES compile_all=YES
    done
    when i want to complie a form i put it in that path beside the shell and just run the shell by double clicking it , and i get my form compiled and generating an FMX file.
    but every time i have to go to the server which is located in another room. with every modification i have to recompile and have to go to the other room .
    i tried to do the compilation process by using telnet , and then run the shell file from my machine , i did like the following
    [oracle@apps forms_to_compile]$ sh cpfdry.sh
    compiling form PA_SPECIAL_PAY_COST.fmb
    FRM-91500: █و╤ ▐╟╧╤ ┌طه ╚╧┴/┼▀ع╟ط ╟ط╚غ╟┴
    compiling form sal_arseda_balance.fmb
    FRM-91500: █و╤ ▐╟╧╤ ┌طه ╚╧┴/┼▀ع╟ط ╟ط╚غ╟┴
    compiling form sal_order_reserve.fmb
    FRM-91500: █و╤ ▐╟╧╤ ┌طه ╚╧┴/┼▀ع╟ط ╟ط╚غ╟┴
    as you can see i got an error and the forms aren't compiled.
    and still now i have the same problem, and unfortunatly i still have to go to the room that have the server many times at the day ..
    what is the problem, i need some help plz ..
    thanks....
    sabry...
    Edited by: user635392 on Jan 8, 2011 5:24 AM

    thanks for interest..
    yes , it is the same user
    my server ip is 192.9.200.2, so i write in the command line ' telnet 192.9.200.2.
    Red Hat Enterprise Linux ES release 4 (Nahant Update 4)
    Kernel 2.6.9-42.ELsmp on an i686
    login: oracle
    Password:
    in the login and password i use the same user ' oracle ' and the same password
    thanks ..
    sabry ..

  • File Upload using Flex/ColdFusion.  2044 error

    I am looking for a little more clarity around the file upload using Flex and Cold Fusion.  When I run this using my server I get Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.
    I did create a regular cfform and had it use my ColdFusion upload form and that worked fine, so I feel good about the upload form. I am starting to think there is a permission error with the Flash Player writing to the folder.  When this is ran, it will show the file being 100% loaded but the complete event is never triggered.  I put alerts to see where it hits and 100 does show at the same time as my error message.  The complete alert never shows.  I also put an alert in my cfm page and it never reaches that page to hit it.  Whether I use an absolute URL or relative path. I have also tried the urlrequestmethod.post and nothing changed.  Thanks in advance.  BTW.  I am using Flex 3.
    This is my mxml file
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:example="com.example.*" horizontalAlign="center" viewSourceURL="srcview/index.html">
    <mx:Script>
    <![CDATA[
    import com.example.FileDownload 
    import mx.controls.Label 
    import com.example.FileUpload]]>
    </mx:Script>
    <mx:Label id="title" text="File I/O Example" fontSize="24" fontStyle="bold" />
    <mx:Text id="subtitle" text="From Programming ActionScript 3.0, Chapter 22: Networking and communication" width="100%" textAlign="center" fontSize="12" /><example:FileDownload 
    id="fileDownload" creationComplete="fileDownload.init(downloadProgress, cancelDownload);" />
    <example:FileUpload id="fileUpload" creationComplete="fileUpload.init(uploadProgress, cancelUpload);" />
    <mx:HBox>
    <mx:Panel title="Upload File" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
    <mx:ProgressBar id="uploadProgress" label="" mode="manual" />
    <mx:ControlBar horizontalAlign="right">
    <mx:Button id="startUpload" label="Upload..." click="fileUpload.startUpload();" />
    <mx:Button id="cancelUpload" label="Cancel" click="fileUpload.cancelUpload();" enabled="false" />
    </mx:ControlBar>
    </mx:Panel>
    <mx:Panel title="Download File" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
    <mx:ProgressBar id="downloadProgress" label="" mode="manual" />
    <mx:ControlBar horizontalAlign="right">
    <mx:Button id="startDownload" label="Download..." click="fileDownload.startDownload();" />
    <mx:Button id="cancelDownload" label="Cancel" click="fileDownload.cancelDownload();" enabled="false" />
    </mx:ControlBar>
    </mx:Panel>
    </mx:HBox></mx:Application>
    here is my coldfusion upload script
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <script>alert('hello')</script>
    <cfset currentPath = getCurrentTemplatePath()>
    <cfset currentDirectory = getDirectoryFromPath(currentPath)>
    <cfoutput>This directory is #currentDirectory#</cfoutput>
    <cffile action="UPLOAD" filefield="Filefield" destination="#currentDirectory#" nameconflict="OVERWRITE"/>
    </body>
    </html>
    here is the package
    package  
    com.example { import flash.events.*; 
    import flash.net.FileReference; 
    import flash.net.URLRequest; 
    import flash.net.URLRequestMethod; 
    import mx.controls.Button; 
    import mx.controls.ProgressBar; 
    import mx.core.UIComponent; 
    import mx.controls.Alert; 
    public class FileUpload extends UIComponent { 
    // Hard-code the URL of the remote upload script. 
    private const UPLOAD_URL:String = "upload_script.cfm"; 
    private var fr:FileReference; 
    // Define reference to the upload ProgressBar component. 
    private var pb:ProgressBar; 
    // Define reference to the "Cancel" button which will immediately stop the upload in progress. 
    private var btn:Button; 
    public function FileUpload() {}
    /*** Set references to the components, and add listeners for the SELECT,
    * OPEN, PROGRESS, and COMPLETE events.
     public function init(pb:ProgressBar, btn:Button):void { 
    // Set up the references to the progress bar and cancel button, which are passed from the calling script. 
    this.pb = pb; 
    this.btn = btn; 
    fr =
    new FileReference();fr.addEventListener(Event.SELECT, selectHandler);
    fr.addEventListener(Event.OPEN, openHandler);
    fr.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    // fr.addEventListener(Event.COMPLETE, completeHandler); 
    /*** Immediately cancel the upload in progress and disable the cancel button.
     public function cancelUpload():void {fr.cancel();
    pb.label =
    "UPLOAD CANCELLED";btn.enabled =
    false;}
    /*** Launch the browse dialog box which allows the user to select a file to upload to the server.
     public function startUpload():void {fr.browse();
    /*** Begin uploading the file specified in the UPLOAD_URL constant.
     private function selectHandler(event:Event):void { 
    var request:URLRequest = new URLRequest(UPLOAD_URL); 
    /* request.url = UPLOAD_URL*/request.method = URLRequestMethod.POST;
     try  
    {fr.upload(request);
    }catch (error:Error){
    trace  
    ("error uploading")}
     /*** When the OPEN event has dispatched, change the progress bar's label
    * and enable the "Cancel" button, which allows the user to abort the
    * upload operation.
     private function openHandler(event:Event):void {pb.label =
    "UPLOADING";btn.enabled =
    true;}
    /*** While the file is uploading, update the progress bar's status and label.
     private function progressHandler(event:ProgressEvent):void {pb.label =
    "UPLOADING %3%%";pb.setProgress(event.bytesLoaded, event.bytesTotal);
    if(event.bytesLoaded==event.bytesTotal){ 
    trace(Event.COMPLETE)Alert.show(
    "100")}
    /*** Once the upload has completed, change the progress bar's label and
    * disable the "Cancel" button since the upload is already completed.
     private function completeHandler(event:Event):void {Alert.show(
    "in function")pb.label =
    "UPLOADING COMPLETE";pb.setProgress(0, 100);
    btn.enabled =
    false;}

    Presumably you need to add a result handler to your request.

  • Synchronized File Writing

    Hi,
    I have a written a Java Program which Splits any File into two Parts. These parts can again later be rejoined to restore the Original File.
    This is how Splitting Operation is performed
    1. Read the SourceFile into Array of Bytes
    2. Open two FileOutputStreams and Write these Bytes, half of it in each stream. This is Done using a Thread for Each stream, Obviously to save time.
    3. Now i have two Files which contain Bytes for Original File.
    Now in Restoring Operation:
    1. Read the two Files(split using above technique) and store in Byte Arrays.
    2. Open the FileOutputStream to a File and write the Above byte Arrays ONE BY ONE into this Stream.
    Please note that i had to write Bytes from two byte arrays in the Order i had read it.
    Which means to say that i first have to write From First Byte Array, wait for it to finish it and than write from Second Byte Array. I cannot start Threads for Writing Bcoz the Target File is Same. Also, i wouldn't know where to start writing the bytes from Second Byte Array in the target File since, the First Thread may still be performing the Write Operation from the First Byte Array
    If i had been writing a C program, this would be fairly easy since i have File Pointers. I can use two programs and use fseek() operation to Know exactly where to start writing from second set of Byte Array.
    Please give ur suggestion to above problem. How can i simulate File Pointer operations of C in Java.
    I hope i am Clear in describing the Problem. If not, then please let me know......and Thnx for u Patience

    try not to cross post.
    http://forum.java.sun.com/thread.jsp?forum=4&thread=165965&start=0&range=30#501577

  • WEB Diagtool - how to install in PI7.1 using Telnet

    Hi all,
    PI7.1 does not have the SDM tool for deployment. How does one deploy the web diagtool in a PI7.1 environment using Telnet administration?  I have downloaded the zip file from note 1045019.
    The following is the output of telnet:
    What is the command to deploy the ZIP file? Thanks!
    Regards, Neeta
    telnet localhost 50108
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
       Telnet Administration
       SAP Java EE Application Server v7.10
    User name: j2ee_admin
    Password:
    Welcome to server node 15731950.
    >LSC
        NAME         ID       GROUP          HOST       PORT     TYPE      STATE
    Server 00 01_157319
                  15731950    157319   161.134.133.192  50120   server    RUNNING
    J2EE15731920
                  15731920    157319   161.134.133.192   N/A     ICM      RUNNING
    >MAN
    ADMIN *****
    GC              INFO            LISTMP          LISTSP          LISTTEMPLATES
    LL              LLR             LSC             LSI             LSL
    LSM             LSS             LSTOL           SETMP           SETSP
    SHUTDOWN        STARTSERVICE    STOPSERVICE     VERSION
    DEPLOY *****
    APP_REFS_GRAPH  CHANGE_REF      CONTAINER_INFO  DEPLOY          DEPLOY_INFO
    EXPLORE         GET_RESULT      GET_STARTUP     GET_STATUS      JAVA_VERSION
    LIST_APP        LIST_APP_RES    LIST_EL         LIST_REFS       MIG_STAT
    PARAM           REMOVE_APP      START_APP       STOP_APP        UNDEPLOY

    Hi,
    Deploy the sda files given by SAP for WEB Diagtool using the JSPM.
    For instructions that how to deploy a file in PI 7.1, Read the below SAP note
    "Note 1138877 - PI 7.1 : How to Deploy External Drivers JDBC/JMS Adapters"
    With Regards,
    Saurabh
    Edited by: Saurabh.Arora on Jun 22, 2009 11:42 AM

  • Does we need to Create a file Before using Open dataSet

    Hi Guys,
                Can  any body tell me whether we have to create a File before using Open dataset  for writing files in Application Server.
               Can anybody write a program for EKPO table to store it in application Server using OpendatasSet ?Is there any specific care we have to take for Executing   pgm in Background?
    I wrote the pgm for Foreground using GUI- Download.
    PGM.
          select * into table it_ekpo  from  ekpo .
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename ='c:\EKPO.xls'
    filetype = 'ASC'
    WRITE_FIELD_SEPARATOR = 'X'
    TABLES
    data_tab = it_ekpo
    *fieldnames = l_heading
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3 .
                       Plzzzzzzzzz Make the changes for existing Pgm.any help is awarded with points.Its Urgent.
    Thanks,
    Gopi.

    Hi Guys,
                 Thanks for ur immediate response.I am sending the code just confirm me whether is correct r not?
    DATA : wa_EKPO_file   TYPE file_table-filename.
    select * into table it_ekpo  from  ekpo .
      OPEN DATASET wa_EKPO_file FOR OUTPUT         "Write to appl. server
                                          IN TEXT MODE
                                          ENCODING DEFAULT.  "Open dataset Return code
    IF sy-subrc = 0.
    LOOP at IT_EKPO into WA_EKPO.
    TRANSFER wa_ekpo to wa_ekpo_file.
    ENDLOOP.
    ENDIF.
                                             I want write the data into SPREAD Sheet .Can u guys  tell me how to write into Spread Sheet using Open data Set.
    Thanks,
    Gopi.

  • Failed to authenticate with the device at ip.ip.ip.ip using TELNET

    Hi!
    I can no longer use CCA :-)
    I tried everything, but when I enter user and password after waiting a few tens of seconds I get the following error window: "Failed to authenticate with the device at ip.ip.ip.ip using TELNET. TELNET access is required for access to voice configuration. Cannot continue. Exiting CCA."
    Given that I do not understand the need to use the 'telnet', I verified that UC500 was reachable from the PC via telnet. But CCA 2.2.5 don't work and I find no reason, even logging on to see go console error messages or anything else that turn me to the solution. Before removing CCA and back to 2.2.4, I see if I could solve the problem somehow.
    I tried to see what was going on the network with wireshark:
    Time          Source          Destination     Protocol     Info
    722.508214     pc.pc.pc.128     uc.uc.uc.1     TELNET     Telnet Data ... (the password in clear text!!!!)
    722.713551     uc.uc.uc.1     pc.pc.pc.128     TCP     telnet > xs-openstorage [ACK] Seq=80 Ack=37 Win=4092 Len=0
    722.713606     pc.pc.pc.128     uc.uc.uc.1     TELNET     Telnet Data ... (a '/r/n' after send user pwd on previus pkt)
    722.911528     uc.uc.uc.1     pc.pc.pc.128     TCP     telnet > xs-openstorage [ACK] Seq=80 Ack=39 Win=4090 Len=0
    724.608892     pc.pc.pc.128     uc.uc.uc.1     TCP     xs-openstorage > telnet [FIN, ACK] Seq=39 Ack=80 Win=65456 Len=0
    724.611192     uc.uc.uc.1     pc.pc.pc.128     TCP     telnet > xs-openstorage [ACK] Seq=80 Ack=40 Win=4090 Len=0
    724.721538     uc.uc.uc.1     pc.pc.pc.128     TELNET     Telnet Data ... (a '/r/n')
    724.721589     pc.pc.pc.128     uc.uc.uc.1     TCP     xs-openstorage > telnet [RST, ACK] Seq=40 Ack=82 Win=0 Len=0
    ...but do not understand why the PC ends the connection!
    NB: Obviously the username and password are correct and the UC does not report login errors.
    Can anyone give me a hint? 1k thanks
    73,
    Arturo

    Most files are 0 bytes long, only Application_Log report some output:
    ++: DEBUG:  : User Preference Settings App Version=2.2 (5)
    ++: DEBUG:  : Current App Version=2.2 (5)
    ++: DEBUG:  : *** Site name: DIM - Lab
    ++: DEBUG:  : *** Remove site from history list: DIM - Lab
    ++: DEBUG:  : Last used connection string: http://DIM+-+Lab:80/
    ++: DEBUG:  : Filtered connection string: DIM+-+Lab
    ++: DEBUG:  : SiteName : DIM+-+Lab DecodedName: DIM - Lab
    ++: DEBUG:  : DIM - Lab is customer site name: true
    ++: DEBUG:  : Set connection string to: ---.---.---.---
    ++: DEBUG:  : Filtered connection string: DIM+-+Lab
    ++: DEBUG:  : Duration for [upd Mirror<--Device() @ com.cisco.cpnm.features.defn.connect.ConnectDialogTask] = [1265] msec.
    ++: DEBUG:  : *** Site name: DIM - Lab
    ++: DEBUG:  : *** Remove site from history list: DIM - Lab
    ++: DEBUG:  : Last used connection string: http://DIM+-+Lab:80/
    ++: DEBUG:  : Filtered connection string: DIM+-+Lab
    ++: DEBUG:  : SiteName : DIM+-+Lab DecodedName: DIM - Lab
    ++: DEBUG:  : DIM - Lab is customer site name: true
    ++: DEBUG:  : Set connection string to: ---.---.---.---
    ++: DEBUG:  : Filtered connection string: DIM+-+Lab
    ++: DEBUG:  : Filtered connection string: DIM+-+Lab
    ++: DEBUG:  : Filtered connection string: DIM+-+Lab
    ++: DEBUG:  : WDTask::setHierarchy .TroubleshootingLogsTask
    ++: DEBUG:  : Duration for [create() @ com.cisco.cpnm.features.defn.logs.TroubleshootingLogsTask] = [78] msec.
    NB: I understand that the program tries to connect using something invented name of the site?
    I create another site with a valid DNS name and I try to connect... Last log lines are:
    ++: DEBUG:  : conn string: HTTP://valid.name.tld:80/
    ++: DEBUG:  : ConnectionMediator:connect() : http://valid.name.tld:80/
    ++: DEBUG:  : URL After Decoding :http://valid.name.tld:80/
    ++: DEBUG:  : ConnectionMediator:isFederation() : http://valid.name.tld:80/
    ++: DEBUG:  : initAppMode():http://valid.name.tld:80/
    ++: DEBUG:  : ConnectionMediator:isFederation() : http://valid.name.tld:80/
    ++: DEBUG:  : initAppWithConnection():http://valid.name.tld:80/
    ++: DEBUG:  : Found Module For device type : UC540W-BRI-K9
    ++: DEBUG:  : *** RouterInfo.ShVer.Fields=[UC540W-BRI-K9, cme, 1 day  23 hours  49 minutes, flash:uc500-advipservicesk9-mz.150-1.XA2, , 15.0(1)XA2, N, N, , UC500-ADVIPSERVICESK9-M, , 1 ]
    ++: DEBUG:  : AuthGrp@1978622: getAuthCreds() called for: telnet://uc.uc.uc.1:23; realm: null
    ++: DEBUG:  : AuthGrp@1978622: getAuthCreds() called for: telnet://uc.uc.uc.1:23; realm: null
    ++: DEBUG:  : AuthGrp@1978622: getAuthCreds() called for: telnet://uc.uc.uc.1:23; realm: null
    73

  • Unable to deploy single SERVERCORE component using telnet?

    Hi,
       As continued to the discussion of  "
    Undeploying .SCA/ .SDA / .EAR / .WAR files on J2EE servers on Netweaver release 7.1 and higher"
    I am trying to deploy one of the CORE component "SERVERCORE" using "TELNET" on my SAP NW7.3 EHP1 System but getting error that " SCA's aborted"
    and unable to deploy the component. Please help me to get out of this.

    Hi Chandra,
    Sorry i did not understand your last reply. When you load all the core SCAs (put them into and folder) and then trigger the telnet option, the tool itself will take care of the dependencies and deploy the SCAs in the correct manner.
    What was the error you were getting when you tried this?
    You mentioned:
    Did same using telnet as mentioned you and didn't update SPS to latest.
    still they showing same as previous.
    Does that mean that the deployment went fine, but still system info etc. shows old values? This is VERY strange. You can get the latest list from the configtool. Just check the attached screenshot for an example.
    If this still shows old version, please run the force bootstrap once:
    1)
    Stop the j2ee server. Under cluster directory (/usr/sap/<SID>/J<nr>/cluster) rename server0 and subsequent nodes to ".old" respectively. The intention here is to create a backup of the existing files. Do not rename  the bootstrap folder as this is needed for the sync process.
    2)
    Change bootstrap.properties file to ensure it has element.resynch=force as per SAP note 710663.
    3)
    Restart the J2EE Engine. The new server folders should be created during the bootstrapping and this is a time consuming process as all the contents of the server nodes will be syched with the DB content.
    4)
    Remove the element.resynch=force property or change it to element.resynch=detect which is the default setting.
    Regards,
    Hemanth

  • File writing serialization

    I have to build a web application using servlet and jsp. The user should edit some
    text file (maybe displaying the file fields in a HTML form).
    I need some suggestions about implementing the synchronization on file writing (since different
    users should try to save the same file simultaneously).
    Do some standard pattern exist about this feature ?
    I suppose to do that using a java bean whith application scope shared by the jsp pages. In this bean
    I will implement all write methods using synchronized.
    Any suggestions ?
    Thanks in advance,
    Mauro.

    well, if you have a single method which does the actual file writing, then you make that method synchronized and you'll have no problems. You can build up the data to write in some object at any time and pass that to that method.
    However, that's still going to present problems when users actually modify the file at the same time. Why does every user have to share 1 file?

  • File Writing with JSP

    Hi all,
    I'm creating a simple app that gets form data and populates it to a file. I want to make sure that each instance (thread?) is able to write to the file and not throw an exception since the file may be currently open by another instance of the jsp. Now I did basic thread programming in C++ a long time ago, so I'm aware of thread waiting conceptually, but I'm not familiar with the java implementation. Can someone show me some basic syntax on how I would go in essentially putting a lock on the file writing portion of the code.
    Thanx much

    I disagree that you should override anything in Threa, especiially the sleep method.
    What you should do is handle the file writing in a producer/consumer fashion. Have a single class that extends Runnable be the consumer. It handles all the file writing issues. You will run this in its own thread.
    Your JSPs (or other threads) fill in a collection, or some other holder, which informs the consumer to write to the file.
    As a brief example, this is a mini logger type of program. I use a class (LogCenter) to log data put in it from other sources (client1 and client2). For the sake of using newer API, I make use of the java.util.concurrent.BlockingQueue (and java.util.concurrent.LinkedBlockingQueue) to make a thread-safe collection and reporting system for text to come in and out of the logger.
    Note, this is far from production. Just something I whipped up when playing with blocking queues a while ago...
    package net.thelukes.steven.thread.test;
    import java.io.PrintWriter;
    import java.util.concurrent.BlockingQueue;
    import java.util.concurrent.LinkedBlockingQueue;
    public class LoggingCenter implements Runnable {
      private PrintWriter output;
      private BlockingQueue<String> toPrint;
      public LoggingCenter() {
        toPrint = new LinkedBlockingQueue<String>(10);
      public void setOutput(PrintWriter pw) {
        if (pw == null)  {
          if (output != null)
            return; //do not replace output with null
          else //pw is null and output is null
            throw new IllegalArgumentException("Ouput PrintWriter must not be NULL");
        else {
          if (output != null) closeOutput(); //if output exists already, close it.
          output = pw;
      public void log(String text) {
        boolean added = false;
        while (!added)
          try {
            toPrint.put(text);
            added=true;
          } catch (InterruptedException ie) {
            ie.printStackTrace();
            try { Thread.sleep(300L); }
            catch (InterruptedException ie2) { ie2.printStackTrace();}
      public void run() {
        try {
          while (true) {
            printLn(toPrint.take());
        } catch (InterruptedException ie) {ie.printStackTrace();}
      private void closeOutput() {
        output.flush();
        output.close();
      private void printLn(String text) {
        if (output == null)
          throw new IllegalStateException
            ("The Output PrintWriter must be set before any output can occur.");
        output.println(text);
        output.flush();
    package net.thelukes.steven.thread.test;
    import java.io.File;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.PrintWriter;
    public class LoggingTest {
      public static void main(String[] args) throws IOException {
        PrintWriter output = new PrintWriter(
          new FileWriter(new File("log.txt")));
        //PrintWriter output = new PrintWriter(System.out, true);
        final LoggingCenter logger = new LoggingCenter();
        logger.setOutput(output);
        Thread t = new Thread(logger);
        t.start();
        Thread client1 = new Thread(
            new Runnable() {
              public void run() {
                while (true) {
                  logger.log("Client 1: "+System.currentTimeMillis());
                  try {
                    Thread.sleep(1250L);
                  } catch (InterruptedException e) {}
        Thread client2 = new Thread(
            new Runnable() {
              public void run() {
                while (true) {
                  logger.log("Client 2: "+System.currentTimeMillis());
                  try {
                    Thread.sleep(2500L);
                  } catch (InterruptedException e) {}
        client1.start();
        client2.start();
    }

  • Does UTL_FIL utility supports file writing in to remote Host ??

    Hi,
    I am checking the possibility with UTL_FIL utility whether supports file writing in to remote Host. My database is on different server from UNIX server but i want to make use of Oracle directory objects or UTL_FILES functions to be able to write files directly from Oracle to remote UNIX server.
    Is this possible ?
    Thanks
    Anand

    UTL_FILE, and any other PL/SQL package running on the database server, can only access objects that the database server has access to. Unless the remote Unix server's file system is mounted from the Oracle server's file system, UTL_FILE would be unable to create a file there.
    Now, there may well be alternateives. For example, you could generate the file locally and FTP the file to the remote Unix server, assuming the remote Unix server is running a FTP server.
    Justin

Maybe you are looking for

  • Alert or Notification for Client Open and Close

    Hi All, How to configure an Alert or Notification, if the Client (SCC4 and SE06) is open and in modifiable state, we have spoken to our solman team and got the confirmation that there is no MT Class for SCC4 and SE06. If this is possible through any

  • Style sheets no longer working

    Style sheets created and used previously are no longer working (properly). What's up with that?

  • Urgent: Flat file load issue

    Hi Guru's, Doing loading in data target ODS via flat file, problem is that flat files shows date field values correct of 8 characters but when we do preview it shows 7 characters and loading is not going through. Anyone knows where the problem is why

  • Group By function inside a PL/sql Block

    Hi, I have a select statement which looks like this - select Region, count(region) from QUOTE_LETTERS_MASTER where version != 'v112012' and source = 'http://esource.oraclecorp.com/portal/pls/portal/esrc.esr_portlet.show?id=74,34,12202' and region !=

  • Looking for someone to do paid scripting work

    Hey, I'm in a bit of a bind with InDesign scripting - I've got a huge amount of it to do in very little time. I've hired someone on Elance who claims to know about Extendscript etc to help me, but I am slightly dubious. I thought coming to the Adobe