0

I am trying to run the sample File Integration with FTP which is given by Ballerina Integrator.

While running the service i am facing same issue each and every time.

I have installed Ballerina Integrator only. I have done uninstall and installation freshly after that also Same issue.

Please help me.

Run Time Error

Community
  • 1
  • 1
Sumathi
  • 93
  • 10

2 Answers2

4

I could successfully run the sample with following configurations. (sample data are given). Here I have used a Secured FTP server to do the configuration.

listener ftp:Listener dataFileListener = new({
    protocol: ftp:SFTP,
    host: "18.156.78.137",
    port: 22,
    secureSocket: {
        basicAuth: {
            username: "cloudloc",
            password: "fsf#$#213"
        }
    },
    path: "/clouddir/"
});

ftp:ClientEndpointConfig ftpConfig = {
    protocol: ftp:SFTP,
    host: "18.156.78.137",
    port: 22,
    secureSocket: {
        basicAuth: {
            username: "cloudloc",
            password: "fsf#$#213"
        }
    }
};

Make sure you set the path parameter correctly in the dataFileListener. Without this parameter I could reproduce your attached error. Once this is correctly configured you would get a log printed like follows.

2020-01-24 15:13:23,758 INFO  [wso2/ftp] - Listening to remote server at 18.156.78.137... 
2020-01-24 15:13:24,333 INFO  [wso2/file_integration_using_ftp] - Added file path: /clouddir/a1.txt 
2020-01-24 15:13:24,415 INFO  [wso2/file_integration_using_ftp] - Added file: /clouddir/a1.txt - 12
Maninda
  • 2,086
  • 3
  • 15
  • 29
  • Where have to create project? Local or Inside of /Ballerina-Integrator ? – Sumathi Jan 24 '20 at 10:17
  • There is no requirement for the project location. I just downloaded the project with "Download Zip" button to a random location and modified as explained. Then ran the code with "ballerina run file_integration_using_ftp". Note that executing with run command is not the recommended way. You can execute in 2 steps instead with build and then running the jar file. – Maninda Jan 24 '20 at 11:10
  • Same i have tried with random location now it showing 'ballerina' is not recognized as an internal or external command, operable program or batch file. I have ballerina integrator in my system. – Sumathi Jan 24 '20 at 12:03
  • Please check whether you have correctly installed Ballerina with the command, "ballerina -v". If you have installed correctly you should get the Ballerina version printed. – Maninda Jan 26 '20 at 18:07
  • Ok fine. Which ballerina version & Ballerina Integrator version you have? – Sumathi Jan 27 '20 at 03:46
  • It was Open JDK 1.11.0 when I installed Ballerina Integrator with VSCode – Maninda Jan 27 '20 at 04:58
  • I have java 1.8 only. Then no need of Ballerina and Ballerina Integrator outside of VSCode? – Sumathi Jan 27 '20 at 08:51
  • 1
    Sorry for the confusion. I have "Ballerina 1.0.2" that was packed with Ballerina Integrator which was a previous release. Once you have installed Ballerina Integrator you should be able to get the Ballerina version with "ballerina -v" command. Then you should be able to execute any Ballerina code from any random location inside your home directory. – Maninda Jan 27 '20 at 09:19
  • Thank you, now its working for me no more error as of now. Just i have installed Ballerina Integrator,which is packed with "Ballerina 1.0.2" then i removed Ballerina & BI plugins from the VSCode. – Sumathi Jan 27 '20 at 09:53
  • i didnt get output. My output was like `2020-01-28 12:10:48,713 INFO [wso2/ftp] - Listening to remote server at corpsftp.xxxxx.com` after this no lines displayed – Sumathi Jan 28 '20 at 06:59
  • You should have placed a file at that FTP path location to get the logs I got. – Maninda Jan 28 '20 at 08:45
  • I have uploaded some files into FTP as well deleted few files from the FTP location but no more changes in log just showing that mentioned line alone. – Sumathi Jan 28 '20 at 10:03
  • What I did was I added a file named, "a1.txt" to FTP location, "/clouddir/" and executed the FTP Connector code where I got the above logs. For further checking you can use a command like "telnet 18.156.78.137 22" to check whether the remote server can be connected. Most probably that would work as your log says it is connected to the server. If you have given host address for the "host" parameter please check replacing that with the relevant IP address. – Maninda Jan 28 '20 at 12:09
  • Yeah tried but no more lines printed other than `Listening to remote server at corpsftp.xxxxx.com` – Sumathi Jan 29 '20 at 10:55
0

Just install Ballerina Integrator alone which is packed with Ballerina 1.0.2 so no need to install Ballerina again or separately. From VSCode why output is not coming means,VSCode's market place all are upgraded with latest version.

Locally installed "BI with Ballerina" is lower version, In VSCode "BI with Ballerina" is latest one. Mismatched version is the main problem which i was faced.

Sumathi
  • 93
  • 10