FTP Exception

Friends,
I am picking a file via FTP into XI. From XI I am trying to send to my XI directory and R/3 directory. When I execute the scenario I am able to pick the file and load into XI. From XI I am able to send into my XI directory but I am unable to send into R/3. I am using FTP for sending the file to R/3. I am getting an error which states "Error: Message processing failed: java.lang.NullPointerException".
I have checked the userid, pwd, credentials repeatedly. They are fine. Any help would be appreciated.
Korobee

Hi,
I think, some security issues with FTP connection with R/3.
Try to ping the SAP directory from FTP Server and check the availability.
Regards,
Moorthy

Similar Messages

  • FTP exception: Can't open passive connection: Permission Denied

    I have a File sender adapter, with FTP as transport protocol.
    The adapter polls a directory each 60 seconds.
    All works perfectly but <b>sometimes</b> I get the following error :
    Channel CC_GBL_FlatFileSender: Error connecting to ftp server ...: com.sap.aii.adapter.file.ftp.FTPEx: 425 Can't open passive connection: Permission denied.
    And 60 seconds after, no more error.
    Any idee of why I get this error occasionally ?
    In the sender file adapte, data connection is set to Passive.  Do I have to set it to Active ?
    Thanks in advance,
    Laurence

    Hi
    Data Connection
         -  Active
    In active mode, the server establishes a data connection from its data port, port 20, to an end point chosen by the client.
         -  Passive
    In passive mode, the client establishes a data connection to the port required by the server.
    The default setting is a passive data connection. Only change this setting if you have a specific reason. This is what is recommended by SAP.
    It is possible that Passive FTP mode may terminate session.
    In this mode the server "listen" on a data port (which is not its default data port) and to wait for a connection rather than initiate one upon receipt of a transfer command. The response to this command includes the host and port address this server is listening on.
    In the FTP protocol two ports are normally used, 20 and 21.
    Port 21 is the control channel in which requests such as PUT, GET, and PWD are sent to the server.
    Port 20 is the data channel in which actual files, folders and directory
    listings are sent.
    Normally, when you connect to an FTP site, the site establishes the data
    connection to your PC (the client) on Port 20. However, if the site allows
    passive transfers, you can have your PC establish the data connection. It is
    recommended that you use passive mode for most transfers.
    Regards
      Sumit Jain
    **Reward with points if you find it useful.

  • How to disable parsing for FTP uploads?

    I would like to upload documents into iFS using FTP, but I don't want them to be parsed during upload. How could I disable parsing for FTP uploads?
    Thanks, Daniel.

    Hi, Are you using FTP inside or outside of Firewall. We are facing problems in ifs uploading when the users are outside of the firewall. This problem does not exist if we are using port 21, but since this is a well know port, we choose to use something else.
    May be you can share with us on how to configure IFS to enable ftp ( except port 21 ) outside of firewall.

  • Anyway to force FTPS only for FTP

    Is their anyway to force my users to use FTPS vs FTP. I do not see this
    as an option in the restrict.txt. This server is behind a firewall but
    I do not see how I could restrict this via the firewall. Anyone have
    any idea if this is possible.

    Originally Posted by knoke
    Andrew Knoke wrote:
    > Is their anyway to force my users to use FTPS vs FTP. I do not see this
    > as an option in the restrict.txt. This server is behind a firewall but
    > I do not see how I could restrict this via the firewall. Anyone have
    > any idea if this is possible.
    I think I have figured out this question. Although I now have another
    question. I can force secure connections via the ftpserv.cfg file.
    My new question is I would like force all of my users to connect using
    FTPS except a few accounts which are mainly scanners that AFAIK will not
    do FTPS. Is it possible to make exceptions like this based on account
    or IP or do I actually need to setup another FTP server.
    Thanks
    Andy
    Sorry, there is not a way to tell NWFTPD that some users must use FTPS and other users can use regular FTP. It's an all-or-nothing kind of setting.
    Gathagan suggested SFTP/SSH, which is a good option, but I suppose your scanners might not do that, either. But you could set NWFTPD to only allow your scanner users (regardless of which protocol it is) and let NWFTPD support regular FTP, and tell all your other users to use SFTP (part of SSH) instead. You'd essentially get your desired end results, though you have to administer 2 services to get it done.

  • Outgoing FTP problems

    First, I'd like to apologize for my crappy english.
    Well, we're having troubles with the outgoing FTP connections in BorderManager. With the filters unloaded, the FTP works flawlessly. Now, if the filters are loaded, we can only connect to FTP servers that listen in port 21. The exception (with the packet type ftp-port-pasv-st) works perfect, but if we try to connect to a server that listen in port 27, for example, we can authenticate, but listing the directory doesn't work (in other words, the connection in the data channel never gets established). We have created a new packet type for the port 27 (following the example), and with the stateful filtering enabled, and it doesn't work. BorderManager doesn't let us choose the two options relative to FTP in stateful filtering, though, arguing that there are only for FTP connections (port 21, in other words).
    Any ideas?
    Cheers,
    Javier

    In article <[email protected]>, Jsteinaker
    wrote:
    > Mmm, it's not the best scenario. If there's a "right" solution, let's
    > try it first. Can you explain me the idea?
    >
    The right way is to target the filter exceptions you need. Using
    Filter Debug techniques is how I would go about it. (I show some
    examples in my BMgr filtering book). The idea being that you show
    packets being filtered, so you know what filter exceptions to open up.
    FTP is not the simplest application to allow with filter exceptions,
    since it uses both control and data ports. The default stateful FTP
    exceptions take that into account in their design, but once you vary
    from the default ports I wonder if you have real problems making
    stateful exceptions? Anyway, you could open up the control port to
    the target server address in one exception, and try making it stateful.
    Or a pair of non-stateful exceptions, one with non-standard FTP dest
    port, and the other with that port as source port. The data portion
    could be a problem for you, but you might allow all IP from the target
    server, and replies back out.
    PKTSCAN on the server, with Wireshark on a PC to read the data easily
    might be useful for seeing what ports are being used.
    Craig Johnson
    Novell Support Connection SysOp
    *** For a current patch list, tips, handy files and books on
    BorderManager, go to http://www.craigjconsulting.com ***

  • BI publisher report : why "Database Usage Tracking Summary"  repport is empty ?

    Hi everyone,
    I'me using BI publisher intergated to Grid Control12c (R3), trying to get "Database Usage Tracking Summary" report folowing Oracle documentation (http://docs.oracle.com/cd/E24628_01/doc.121/e24473/usage_reports.htm#EMADM13568)
    And I have 2 problems :
    1) FTPburst delivery is not working, sftp is configured but still have the folowing error
    Echec de la distribution.
    [INSTANCE_ID=gs00slli052.occ.lan.1424277393149] [OUTPUT_ID=1973]
    Echec de distribution du document
    [INSTANCE_ID=gs00slli052.occ.lan.1424277393149] [DELIVERY_ID=1974]Error deliver document to FTP::Exception happened when calling deliver API::Error deliver document to FTP::FILE=[::Exception happened when calling deliver API::oracle.xdo.delivery.ssh2.SshException: Error in writing data Broken pipeoracle.xdo.service.delivery.DeliveryException: oracle.xdo.delivery.ssh2.SshException: Error in writing data Broken pipe
    at oracle.xdo.service.delivery.impl.DeliveryServiceI
    2) Since FTPburst delivery is not working, i decide to try mail delivery. The delivery itself is working but the report is empty (see Sortie1.xls in attachements)
    So i don't know why is it empty.
    Can someone   guide me  ?

    Hi,
    Thank You for your quick reply. The table permission was alright.
    Its very strange that, we configure usage tracking in obiee 11.1.1.6.0 using enterprise manager and that how all document says. And then it should automatically update the "NQSCONFIG.INI". But it was not updated there. So we need to change all configuration settings in both "Enterprise Manager" and also in the "NQSCONFIG.INI". Then it works fine!!
    Thanks,
    BK.

  • File Adapter Overwriting the output files

    Hi All,
    I´m using a File Receiver Adapter to write flat files on to an FTP. Same Communication Channel is used for all types of output files (As per the business requirement the file name(
    MzOutput.txt) shud b same for Deliverz orders, Purchase orders etc...). The receiver legacz szstem reads one file at atime and deletes it. So if i´m writing a Deliverz Order File, i have to wait until the file MzOutput.txt gets deleted and then i have to write the next file using the same name. in order to acheive this, i had used a module processor which waits until that MzOutput.txt gets deleted. Mz problem is
    As there are ´n´ no of orders waiting in the queue, if at 12:14:00 the MzOutput.txt gets deleted, then two threads which check for the existance of the MzOutput.txt file finds nothing and tries to write at same time. as a result, first file got overwritten by the second file.
    I dint check the indicator OverwriteExisting File in the CC configuration.If i use two different CC channels to write the same file, it is giving FTP Exception which is true.
    I´m loosing few deliveries as a result of the above case. Can anzone please help me out in this regard?
    Thnx in Advance
    Anil

    Hi Anil,
    Why dont you write the files with 'Add time stamp' option on for the file name and then the third party/legacy system to read the files in the order which they were created.?
    Another option will be to write these files into a folder with these Add time stamp option/counter option and make a shell script check the folder for the MzOutput.txt file exists in the folder from where the third party/legacy system reads the file and once it has deleted the existing file, then ur files shud be moved in the order in which they were written n the temporary folder.
    This will avoid the queue of messages in the adapter engine.
    Cheers
    JK

  • Importing LCA applications issues

    Hello everybody.
    In the last few days I've been working with the LCES2 Linux virtual appliance made available by Adobe and I tried to import a fairly complex application developed with LCES 8.2.1.
    I stumbled across a few issues I'd like to share with you.
    The LCA archive was created with LCES WorkBench and I had no issues with previous versions of LCES; in LCES2, I had to import it using adminui [LiveCycle Archives (8.x)] and then, using LCES2 WB, I had to create a new application and import Processes and Resources from the server.
    Once the operation completed, I noticed the following:
    1) FTP Exceptions are not handled
    I had a couple of FTP "Get to filesystem" and "Put" operations whose "FTPConnectionException" was not handled and caused a LCES exception; as a workaround, I had to remove the exception and "re-draw" it as to point again to the handling block (and it worked).
    2) SubProcess renaming
    The main process had a subprocess named "PDF/A Operations" which, once imported into LCES2 WorkBench, was renamed (in the [Applications] view) as "A Operations". This seems to be a cosmetic issue since I did not have to change the invoking block as to reflect the change of the name.
    3) Accented characters
    In both a "Send with Document" email operation or in a simple assignment (Setvalue/Execute) I had an expression which contained accented characters (eg, à or è); I had to edit the message/assignment as to retype the offending characters (which got depicted as []) as to let LCES2 handle them as expected). The same went for the GeneratePDFOutput which suffered from the same "disease"
    4) Missing Font
    Since the original project was developed on a Windows 2003 server, I had to change a couple of fonts (namely, the "Times New Roman" one) in a form since this font does not exist under Linux by default (and I did not want to spend a lot of time by importing the missing fonts into the Linux box)
    5) Import issue
    I had a process who got incorrectly imported into the new LCES2 environment; by "incorrectly imported" I mean there are some operations (which existed in the LCES 8.2 one) which have not been imported into LCES2. I've still to fix it but I think a simple XML export from LCES WB + Import *might* fix it.
    If you have suggestions/opinions, please let me know.
    Have a nice Xmas time.
    Rob

    In the Region Inspector on the left of your Arrange you find a little box labeled "follow tempo" - if you untick that box the Audio will play at the original speed.

  • J2SE Local Adapter Engine

    Hi,
    We are using the local adapter engine to send and receive files from a FTP server. However, the outbound/receiver adapter is throwing this ugly Java/FTP exception:
    Feb 28, 2006 1:02:58 PM  ...sap.aii.messaging.adapter.ftp.FTPCtrl [Thread-20] Info: ftp server returns reply '220 Service ready'
    Feb 28, 2006 1:02:58 PM  ...sap.aii.messaging.adapter.ftp.FTPCtrl [Thread-20] Info: ftp server returns reply '230 User logged in'
    Feb 28, 2006 1:02:58 PM  ...i.messaging.adapter.XMB2FileProcessor [Thread-20] Error: java.lang.Exception: ftp client test failed with 'com.sap.aii.messaging.adapter.ftp.FTPEx: User logged in'
    As you can see the FTP server returns a nice 220 (Service ready for new user.) and 230 (User logged in, proceed.) response.
    So how come the adapter throws an exception like this here? Can someone try to explain?
    Tnx,
    Roberto

    Hi,
      Actually, your message is truncated so i can't view the complete message,
    But i may suggest,
    1. In the FTP server did you mention the read,write,append authorization to the userid you are refering in the sender file adapter? Typically i use guildftp as a ftp server and that has options for all these authorization.
    2. Do you have any firewall or proxy installed locally,
    3. Can you write the sender adapter settings and paste the error again as its truncated from the right side.
    Regards,
    Anirban.

  • In built web server

    Hi,
    Is there any way to host .asp pages on the built-in web server?
    I'm building a web site on a PC at work but might need to work on it over the holidays at home on my Mac so need to find out if I can run the pages localy.

    Thanks, Charles. I knew I had read that somewhere,
    but wasn't sure. I assume I still need to use the
    other third party software for email and FTP servers?
    I see OS X has its own FTP sharing, but I've read
    it's kind of clunky to use. Any thoughts?
    I don't know anything about setting up FTP, except that it's somewhat insecure (passwords in plain text), and apparently somewhat difficult to set up. But you may not even need FTP. Unless you want other people to be able to put files on your server, you could just put your files for download into the web site and serve them up that way.
    If you're thinking you'd need FTP sharing in order to access your own web pages on the server, that's not true. You can use SSH, which is much more secure. Just turn on "Remote Login" on in the System Preferences on the server. OS X has a built-in sftp client, if you're comfortable in the Terminal app. Otherwise, there are GUI ftp clients that also do sftp.
    As for mail services, I'm not really sure. OS X comes with Postfix, and I've set it up to send email, but never receive. There's a package called Postfix Enabler that enables Postfix and also sets up POP and IMAP services. I've never used it, though, so I have no idea how easy or secure it is (i.e., how hard it is to configure so you're not running an open relay).
    charlie

  • B2B : Hub trading partner model

    Dear All,
    We are facing an issue while using the hub model.
    Use case :
    1# We need to send an EDI 850 document from TP1 and TP2 to  TP3.
    Source : TP1 , TP2
    Target : TP3
    We configured the agreements between following.
    TP1 --> host TP --> TP3
    TP2 --> host TP --> TP3
    The files are getting generated successfully.
    But we could not have the Source TP name in the ISA segment from TP value. We see the HiostTrading partner name.
    What configuration change we need to do , So that TP1 / TP2 name will be shown in generated ISA segment fromTP element.
    Thanks in advance.
    Siddhardha.

    Hi Naresh,
    As of now only directory name (leaf folder) or filename can be used for TP identification in case of File/FTP (except EDI). If your use case does not allow any of these, then please file an enhancement request with support.
    Regards,
    Anuj

  • Second Drive w/ Multiple Permission Issues

    Set Up
    - PowerMac G5 running OS X 10.5 (client, not server) on primary drive
    - 2nd drive where all of our shared files are located (this drive and it's directories are not shared - at least not from System Preference > Sharing - we tried that and the problems still existed)
    There are three of us in our office. We all are connected to an Airport network (we are wireless, the G5 is wired to the Airport). We have one man outside of the office who connects to the G5 via FTP. Everyone (internal & external) works with the files on the 2nd drive. Internally, we're all logged in as admins (individual accounts) when we work off the G5.
    Problem #1 - when our outside man connects to the G5 via FTP, any files he creates/modifies end up with their permissions set to the following:
    Outside User - Read/Write
    (unknown) - Read Only
    everyone - No Access
    The only way to fix it is for someone to log on to the G5 and reset the permissions.
    Problem #2 - Inside the office, we're frequently finding files that have not been modified by our Outside User but their permissions are fouled up. A simple example:
    I create a directory on the G5, then add some files to it. No one else can access these files or the directory I created. The permissions end up looking like they do for our Outside User who is using FTP except the everyone user as Read Only access.
    There's a lot of other permissions related weirdness that is going on. The bottom line is - how should we set things up so we can all use the 2nd drive? In the past (when there were just 2 of us) we both logged into the G5 using the same admin account - no issues ever came up even though we were both logged in all day long.
    Should we all share the same admin account?
    What about our FTP user?
    I'm sure there are some good tutorials but I don't know where to look.
    Also, would it be better if we were running OS 10.5 server?
    Thanks for any help.
    NR

    Set Up
    - PowerMac G5 running OS X 10.5 (client, not server) on primary drive
    - 2nd drive where all of our shared files are located (this drive and it's directories are not shared - at least not from System Preference > Sharing - we tried that and the problems still existed)
    There are three of us in our office. We all are connected to an Airport network (we are wireless, the G5 is wired to the Airport). We have one man outside of the office who connects to the G5 via FTP. Everyone (internal & external) works with the files on the 2nd drive. Internally, we're all logged in as admins (individual accounts) when we work off the G5.
    Problem #1 - when our outside man connects to the G5 via FTP, any files he creates/modifies end up with their permissions set to the following:
    Outside User - Read/Write
    (unknown) - Read Only
    everyone - No Access
    The only way to fix it is for someone to log on to the G5 and reset the permissions.
    Problem #2 - Inside the office, we're frequently finding files that have not been modified by our Outside User but their permissions are fouled up. A simple example:
    I create a directory on the G5, then add some files to it. No one else can access these files or the directory I created. The permissions end up looking like they do for our Outside User who is using FTP except the everyone user as Read Only access.
    There's a lot of other permissions related weirdness that is going on. The bottom line is - how should we set things up so we can all use the 2nd drive? In the past (when there were just 2 of us) we both logged into the G5 using the same admin account - no issues ever came up even though we were both logged in all day long.
    Should we all share the same admin account?
    What about our FTP user?
    I'm sure there are some good tutorials but I don't know where to look.
    Also, would it be better if we were running OS 10.5 server?
    Thanks for any help.
    NR

  • I have created a Blog in iWeb and uploaded it to an FTP server.   It works fine, except that the 'Comments' facility is missing.   When I upload the blog to MobileMe   the 'Comments' facility is there and working great.   How can I solve the problem on th

    I have created a Blog in iWeb and uploaded it to an FTP server.   It works fine, except that the 'Comments' facility is missing.   When I upload the blog to MobileMe   the 'Comments' facility is there and working great.   How can I solve the problem on the FTP server Blog.

    You haven't a problem. You simply did not read the iWeb Help :

  • StringIndexOutofBounds Exception while doing FTP operation

    Hello, I got this exception at run time when I am doing my FTP operations
    java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    at java.lang.String.charAt(String.java:455)
    at FTPConnection.getFullServerReply(FTPConnection.java:312)
    at FTPConnection.getServerReply(FTPConnection.java:296)
    at FTPConnection.executeCommand(FTPConnection.java:329)
    at FTPConnection.login(FTPConnection.java:107)
    at JEditor$FTPUpload.checkTF(JEditor.java:2755)
    at JEditor$FTPUpload.actionPerformed(JEditor.java:2783)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
    67)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
    ctButton.java:1820)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
    istener.java:258)
    at java.awt.Component.processMouseEvent(Component.java:5021)
    at java.awt.Component.processEvent(Component.java:4818)
    at java.awt.Container.processEvent(Container.java:1380)
    at java.awt.Component.dispatchEventImpl(Component.java:3526)
    at java.awt.Container.dispatchEventImpl(Container.java:1437)
    at java.awt.Component.dispatchEvent(Component.java:3367)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3214
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2929)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2859)
    at java.awt.Container.dispatchEventImpl(Container.java:1423)
    at java.awt.Window.dispatchEventImpl(Window.java:1566)
    at java.awt.Component.dispatchEvent(Component.java:3367)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:190)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
    The file that I used for my FTP is
    * File: FTPConnection.java
    * Author: Bret Taylor <[email protected]>
    * $Id$
    * Parts of this code were adopted from a variety of other FTP classes the
    * author has encountered that he was not completely satisfied with. If you
    * think more thanks are due to any particular author than is given, please
    * let him know. With that caveat, this class can be freely distributed and
    * modified as long as Bret Taylor is given credit in the source code comments.
    import java.io.*;
    import java.net.*;
    import java.util.*;
    * <p>A wrapper for the network and command protocols needed for the most common
    * FTP commands. Standard usage looks something like this:</p>
    * <pre> FTPConnection connection = new FTPConnection();
    * try {
    * if (connection.connect(host)) {
    * if (connection.login(username, password)) {
    * connection.downloadFile(serverFileName);
    * connection.uploadFile(localFileName);
    * connection.disconnect();
    * } catch (UnknownHostException e) {
    * // handle unknown host
    * } catch (IOException e) {
    * // handle I/O exception
    * }</pre>
    * <p>Most FTP commands are wrapped by easy-to-use methods, but in case clients
    * need more flexibility, you can execute commands directly using the methods
    * executeCommand and
    * executeDataCommand,
    * the latter of which is used for commands that require an open data port.</p>
    * @author Bret Taylor
    * @version 1.0
    public class FTPConnection extends Object {
         * If this flag is on, we print out debugging information to stdout during
         * execution. Useful for debugging the FTP class and seeing the server's
         * responses directly.
         private static boolean PRINT_DEBUG_INFO = false;
         * Connects to the given FTP host on port 21, the default FTP port.
         public boolean connect(String host)
              throws UnknownHostException, IOException
              return connect(host, 21);
         * Connects to the given FTP host on the given port.
         public boolean connect(String host, int port)
              throws UnknownHostException, IOException
              connectionSocket = new Socket(host, port);
              outputStream = new PrintStream(connectionSocket.getOutputStream());
              inputStream = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));
              if (!isPositiveCompleteResponse(getServerReply())){
                   disconnect();
                   return false;
              return true;
         * Disconnects from the host to which we are currently connected.
         public void disconnect()
              if (outputStream != null) {
                   try {
                        outputStream.close();
                        inputStream.close();
                        connectionSocket.close();
                   } catch (IOException e) {}
                   outputStream = null;
                   inputStream = null;
                   connectionSocket = null;
         * Wrapper for the commands <code>user [username]</code> and <code>pass
         * [password]</code>.
         public boolean login(String username, String password)
              throws IOException
              int response = executeCommand("user " + username);
              if (!isPositiveIntermediateResponse(response)) return false;
              response = executeCommand("pass " + password);
              return isPositiveCompleteResponse(response);
         * Wrapper for the command <code>cwd [directory]</code>.
         public boolean changeDirectory(String directory)
              throws IOException
              int response = executeCommand("cwd " + directory);
              return isPositiveCompleteResponse(response);
         * Wrapper for the commands <code>rnfr [oldName]</code> and <code>rnto
         * [newName]</code>.
         public boolean renameFile(String oldName, String newName)
              throws IOException
              int response = executeCommand("rnfr " + oldName);
              if (!isPositiveIntermediateResponse(response)) return false;
              response = executeCommand("rnto " + newName);
              return isPositiveCompleteResponse(response);
         * Wrapper for the command <code>mkd [directory]</code>.
         public boolean makeDirectory(String directory)
              throws IOException
              int response = executeCommand("mkd " + directory);
              return isPositiveCompleteResponse(response);
         * Wrapper for the command <code>rmd [directory]</code>.
         public boolean removeDirectory(String directory)
              throws IOException
              int response = executeCommand("rmd " + directory);
              return isPositiveCompleteResponse(response);
         * Wrapper for the command <code>cdup</code>.
         public boolean parentDirectory()
              throws IOException
              int response = executeCommand("cdup");
              return isPositiveCompleteResponse(response);
         * Wrapper for the command <code>dele [fileName]</code>.
         public boolean deleteFile(String fileName)
              throws IOException
              int response = executeCommand("dele " + fileName);
              return isPositiveCompleteResponse(response);
         * Wrapper for the command <code>pwd</code>.
         public String getCurrentDirectory()
              throws IOException
              String response = getExecutionResponse("pwd");
              StringTokenizer strtok = new StringTokenizer(response);
              // Get rid of the first token, which is the return code
              if (strtok.countTokens() < 2) return null;
              strtok.nextToken();
              String directoryName = strtok.nextToken();
              // Most servers surround the directory name with quotation marks
              int strlen = directoryName.length();
              if (strlen == 0) return null;
              if (directoryName.charAt(0) == '\"') {
                   directoryName = directoryName.substring(1);
                   strlen--;
              if (directoryName.charAt(strlen - 1) == '\"')
                   return directoryName.substring(0, strlen - 1);
              return directoryName;
         * Wrapper for the command <code>syst</code>.
         public String getSystemType()
              throws IOException
              return excludeCode(getExecutionResponse("syst"));
         * Wrapper for the command <code>mdtm [fileName]</code>. If the file does
         * not exist, we return -1;
         public long getModificationTime(String fileName)
              throws IOException
              String response = excludeCode(getExecutionResponse("mdtm " + fileName));
              try {
                   return Long.parseLong(response);
              } catch (Exception e) {
                   return -1L;
         * Wrapper for the command <code>size [fileName]</code>. If the file does
         * not exist, we return -1;
         public long getFileSize(String fileName)
              throws IOException
              String response = excludeCode(getExecutionResponse("size " + fileName));
              try {
                   return Long.parseLong(response);
              } catch (Exception e) {
                   return -1L;
         * Wrapper for the command <code>retr [fileName]</code>.
         public boolean downloadFile(String fileName)
              throws IOException
              return readDataToFile("retr " + fileName, fileName);
         * Wrapper for the command <code>retr [serverPath]</code>. The local file
         * path to which we will write is given by <code>localPath</code>.
         public boolean downloadFile(String serverPath, String localPath)
              throws IOException
              return readDataToFile("retr " + serverPath, localPath);
         * Wrapper for the command <code>stor [fileName]</code>.
         public boolean uploadFile(String fileName)
              throws IOException
              return writeDataFromFile("stor " + fileName, fileName);
         * Wrapper for the command <code>stor [localPath]</code>. The server file
         * path to which we will write is given by <code>serverPath</code>.
         public boolean uploadFile(String serverPath, String localPath)
              throws IOException
              return writeDataFromFile("stor " + serverPath, localPath);
         * Set the restart point for the next download or upload operation. This
         * lets clients resume interrupted uploads or downloads.
         public void setRestartPoint(int point)
              restartPoint = point;
              debugPrint("Restart noted");
         * Gets server reply code from the control port after an ftp command has
         * been executed. It knows the last line of the response because it begins
         * with a 3 digit number and a space, (a dash instead of a space would be a
         * continuation).
         private int getServerReply()
              throws IOException
              return Integer.parseInt(getFullServerReply().substring(0, 3));
         * Gets server reply string from the control port after an ftp command has
         * been executed. This consists only of the last line of the response,
         * and only the part after the response code.
         private String getFullServerReply()
              throws IOException
              String reply;
              do {
                   reply = inputStream.readLine();
                   debugPrint(reply);
              } while(!(Character.isDigit(reply.charAt(0)) &&
                        Character.isDigit(reply.charAt(1)) &&
              Character.isDigit(reply.charAt(2)) &&
                        reply.charAt(3) == ' '));
              return reply;
         * Executes the given FTP command on our current connection, returning the
         * three digit response code from the server. This method only works for
         * commands that do not require an additional data port.
         public int executeCommand(String command)
              throws IOException
              outputStream.println(command);
              return getServerReply();
         * Executes the given FTP command on our current connection, returning the
         * last line of the server's response. Useful for commands that return
         * one line of information.
         public String getExecutionResponse(String command)
              throws IOException
              outputStream.println(command);
              return getFullServerReply();
         * Executes the given ftpd command on the server and writes the results
         * returned on the data port to the file with the given name, returning true
         * if the server indicates that the operation was successful.
         public boolean readDataToFile(String command, String fileName)
              throws IOException
              // Open the local file
              RandomAccessFile outfile = new RandomAccessFile(fileName, "rw");
              // Do restart if desired
              if (restartPoint != 0) {
                   debugPrint("Seeking to " + restartPoint);
                   outfile.seek(restartPoint);
              // Convert the RandomAccessFile to an OutputStream
              FileOutputStream fileStream = new FileOutputStream(outfile.getFD());
              boolean success = executeDataCommand(command, fileStream);
              outfile.close();
              return success;
         * Executes the given ftpd command on the server and writes the contents
         * of the given file to the server on an opened data port, returning true
         * if the server indicates that the operation was successful.
         public boolean writeDataFromFile(String command, String fileName)
              throws IOException
              // Open the local file
              RandomAccessFile infile = new RandomAccessFile(fileName, "r");
              // Do restart if desired
              if (restartPoint != 0) {
                   debugPrint("Seeking to " + restartPoint);
                   infile.seek(restartPoint);
              // Convert the RandomAccessFile to an InputStream
              FileInputStream fileStream = new FileInputStream(infile.getFD());
              boolean success = executeDataCommand(command, fileStream);
              infile.close();
              return success;
         * Executes the given ftpd command on the server and writes the results
         * returned on the data port to the given OutputStream, returning true
         * if the server indicates that the operation was successful.
         public boolean executeDataCommand(String command, OutputStream out)
              throws IOException
              // Open a data socket on this computer
              ServerSocket serverSocket = new ServerSocket(0);
              if (!setupDataPort(command, serverSocket)) return false;
              Socket clientSocket = serverSocket.accept();
              // Transfer the data
              InputStream in = clientSocket.getInputStream();
              transferData(in, out);
              // Clean up the data structures
              in.close();
              clientSocket.close();
              serverSocket.close();
              return isPositiveCompleteResponse(getServerReply());     
         * Executes the given ftpd command on the server and writes the contents
         * of the given InputStream to the server on an opened data port, returning
         * true if the server indicates that the operation was successful.
         public boolean executeDataCommand(String command, InputStream in)
              throws IOException
              // Open a data socket on this computer
              ServerSocket serverSocket = new ServerSocket(0);
              if (!setupDataPort(command, serverSocket)) return false;
              Socket clientSocket = serverSocket.accept();
              // Transfer the data
              OutputStream out = clientSocket.getOutputStream();
              transferData(in, out);
              // Clean up the data structures
              out.close();
              clientSocket.close();
              serverSocket.close();
              return isPositiveCompleteResponse(getServerReply());     
         * Transfers the data from the given input stream to the given output
         * stream until we reach the end of the stream.
         private void transferData(InputStream in, OutputStream out)
              throws IOException
              byte b[] = new byte[1024]; // 1K blocks I guess
              int amount;
              // Read the data into the file
              while ((amount = in.read(b)) > 0) {
                   out.write(b, 0, amount);
         * Executes the given ftpd command on the server and writes the results
         * returned on the data port to the given FilterOutputStream, returning true
         * if the server indicates that the operation was successful.
         private boolean setupDataPort(String command, ServerSocket serverSocket)
              throws IOException
              // Send our local data port to the server
              if (!openPort(serverSocket)) return false;
              // Set binary type transfer
              outputStream.println("type i");
              if (!isPositiveCompleteResponse(getServerReply())) {
                   debugPrint("Could not set transfer type");
                   return false;
              // If we have a restart point, send that information
              if (restartPoint != 0) {
                   outputStream.println("rest " + restartPoint);
                   restartPoint = 0;
                   // TODO: Interpret server response here
                   getServerReply();
              // Send the command
              outputStream.println(command);
              return isPositivePreliminaryResponse(getServerReply());
         * Get IP address and port number from serverSocket and send them via the
         * <code>port</code> command to the ftp server, returning true if we get a
         * valid response from the server, returning true if the server indicates
         * that the operation was successful.
         private boolean openPort(ServerSocket serverSocket)
              throws IOException
              int localport = serverSocket.getLocalPort();
              // get local ip address
              InetAddress inetaddress = serverSocket.getInetAddress();
              InetAddress localip;
              try {
                   localip = inetaddress.getLocalHost();
              } catch(UnknownHostException e) {
                   debugPrint("Can't get local host");
                   return false;
              // get ip address in high byte order
              byte[] addrbytes = localip.getAddress();
              // tell server what port we are listening on
              short addrshorts[] = new short[4];
              // problem: bytes greater than 127 are printed as negative numbers
              for(int i = 0; i <= 3; i++) {
                   addrshorts[i] = addrbytes;
                   if (addrshorts[i] < 0)
                        addrshorts[i] += 256;
              outputStream.println("port " + addrshorts[0] + "," + addrshorts[1] +
              "," + addrshorts[2] + "," + addrshorts[3] + "," +
              ((localport & 0xff00) >> 8) + "," +
              (localport & 0x00ff));
              return isPositiveCompleteResponse(getServerReply());
         * True if the given response code is in the 100-199 range.
         private boolean isPositivePreliminaryResponse(int response)
              return (response >= 100 && response < 200);
         * True if the given response code is in the 300-399 range.
         private boolean isPositiveIntermediateResponse(int response)
              return (response >= 300 && response < 400);
         * True if the given response code is in the 200-299 range.
         private boolean isPositiveCompleteResponse(int response)
              return (response >= 200 && response < 300);
         * True if the given response code is in the 400-499 range.
         private boolean isTransientNegativeResponse(int response)
              return (response >= 400 && response < 500);
         * True if the given response code is in the 500-599 range.
         private boolean isPermanentNegativeResponse(int response)
              return (response >= 500 && response < 600);
         * Eliminates the response code at the beginning of the response string.
         private String excludeCode(String response)
              if (response.length() < 5) return response;
              return response.substring(4);
         * Prints debugging information to stdout if the private flag
         * <code>PRINT_DEBUG_INFO</code> is turned on.
         private void debugPrint(String message) {
              if (PRINT_DEBUG_INFO) System.err.println(message);
         * The socket through which we are connected to the FTP server.
         private Socket connectionSocket = null;
         * The socket output stream.
         private PrintStream outputStream = null;
         * The socket input stream.
         private BufferedReader inputStream = null;
         * The offset at which we resume a file transfer.
         private long restartPoint = 0L;
    Please help me where am I wrong?
    Thanks

    I would guess the error happens at this line:
    } while(!(Character.isDigit(reply.charAt(0)) && ...
    because apparently reply.length() is 0 at the point of failure, so charAt(0) is beyond the end of the string. You need to check the length first.

  • Using SFTP with FTP Adapter: The SSH API threw an exception.

    Our SOA suite veriosn is 10.1.3.4.
    We have to get the file from SFTP server and put it on the SOA Server. (SFTP and SOA server are running in different machine)
    If Incoming file and outgoing file directory is located in SFTP server..GET and PUT operations works fine.
    but if I give Incoming File location = <SFTP location>... and Outgoing file location = <SOA server location>... I get the below error...
    <2011-01-28 01:45:51,043> <ERROR> <default.collaxa.cube.ws> <AdapterFramework::Outbound> file:/C:/OracleAS_1/bpel/domains/default/tmp/.bpel_FTPTest_1.0_f57b8d368277e2d025bfbd2992350d66.tmp/put.wsdl [ Put_ptt::Put(opaque) ] - Could not invoke operation 'Put' against the 'FTP Adapter' due to:
    ORABPEL-11445
    The SSH API threw an exception.
    The SSH API threw an exception.
    Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable.
    <2011-01-28 01:45:51,043> <ERROR> <default.collaxa.cube.ws> <AdapterFramework::Outbound> file:/C:/OracleAS_1/bpel/domains/default/tmp/.bpel_FTPTest_1.0_f57b8d368277e2d025bfbd2992350d66.tmp/put.wsdl
    [ Put_ptt::Put(opaque) ] - Rolling back JCA LocalTransaction
    <2011-01-28 01:45:51,043> <ERROR> <default.collaxa.cube.ws> <WSIFInvocationHandler::invoke> Fault happened: file:/C:/OracleAS_1/bpel/domains/default/tmp/.bpel_FTPTest_1.0_f57b8d368277e2d025bfbd2992350d66.tmp/put.wsdl [ Put_ptt::Put(opaque) ] - WSIF JCA Execute of operation 'Put' failed due to: The SSH API threw an exception.
    The SSH API threw an exception.
    ; nested exception is:
         ORABPEL-11445
    The SSH API threw an exception.
    The SSH API threw an exception.
    Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable.
    anyone can offer any help?
    Thanks,
    AB
    Edited by: AB on Jan 28, 2011 3:38 AM

    Hi,
    Thanks for the reply.
    As per client's requirement, we shouldn't be using java service for this functionality.
    And as you said, the oracle adapters are not taking anywhere, but guess have no other choice..
    Cheers,
    Varun

Maybe you are looking for

  • Clearing old versions

    Trying to Install iTunes but stops midway saying cannot remove older versions We have been through registry and removed older iTunes & Bonjour but still errors off Is there a download version that will ignore "old versions" somewhere hidden in the re

  • CUA - Creating a test user with profile

    Hi All,        I just set up the CUA in our newly installed solution manager which is the central system and another sandbox system with three  clients as the child systems. I referred to the follwoing for the setup: http://help.sap.com/saphelp_nw200

  • Error in Adventure Demo

    I get the following error when checking out in the Adventure Demo. There has been an error. Cause: com.sun.j2ee.blueprints.waf.controller.web.html.HTMLActionException: CheckoutHTMLAction Exception : Internal Server Error (caught exception while handl

  • When trying to reformat my 5th gen Ipod classic, windows tells me that it is "unable to complete the format". Help?

    My Ipod started making the frowny face at me and telling me to go to support, I plugged it in to my PC and was told that the device needed to be reformatted. I attempted to do so, the quick format fails right away, and when I try to do a regular form

  • Notes of  Approval is blank in SC

    Hi, Notes of approval in SC is balnk. NOTM is header level. I am creating shopping cart using custom program using BAPI : BBP_PD_SC_CREATE. for this i  have populated the e_longtext, but it is not working... What should i give as input??? could any b