Getting a java.lang.NullPointerException Error with DevTest FTP Step

book

Article ID: 7774

calendar_today

Updated On:

Products

CA Application Test Service Virtualization CA Continuous Application Insight (PathFinder) CA Service Virtualization (DevTest / LISA / VSE / Application Test)

Issue/Introduction

I am trying to Upload/Download a txt file from FTP server on Linux using a DevTest FTP Step.  When I execute the step, I am getting a java.lang.NullPointerException (NPE).

 

============================================================================

| Exception:

============================================================================

| Step: FTP

----------------------------------------------------------------------------

| Message: java.lang.NullPointerException

----------------------------------------------------------------------------

| Trapped Exception: null

| Trapped Message: java.lang.NullPointerException

----------------------------------------------------------------------------

STACK TRACE

java.lang.NullPointerException

at com.amoebacode.ftp.FTPUtil.isFTPResponse(FTPUtil.java:146)

at com.amoebacode.ftp.FTPSocket.getServerResponse(FTPSocket.java:157)

at com.amoebacode.ftp.FTPSocket.openConnection(FTPSocket.java:107)

 

at com.amoebacode.ftp.FTPClient.openConnection(FTPClient.java:135)

Cause

The FTP step lets you send or receive a file using the FTP protocol. After entering the FTP information, user name, and user password, you can either upload a file or download a file.

You can get this type of errors if 1) the FTP Server is not running on the Host machine or 2) the user you are using to access the Host does not have the right permissions.

In this example it was a permissions issue on the FTP Server.

 

Environment

DevTest 10.1.0, but should work for all releases that have the FTP Step.

Resolution

In the below example my Host Linux machine 10.130.219.147.  My User is test.  The file I am wanting to get is also called test and happens to be in my /home/test folder.

 

From a command prompt from the client machine:

 

C:\Users\nunma04>ftp 10.130.219.147

Connected to 10.130.219.147.

220 (vsFTPd 3.0.2)

User (10.130.219.147:(none)): test

331 Please specify the password.

Password:

230 Login successful.

ftp> get test

200 PORT command successful. Consider using PASV.

150 Opening ASCII mode data connection for test (12 bytes).

226 Transfer complete.

ftp: 14 bytes received in 0.00Seconds 14000.00Kbytes/sec.

ftp>

 

The contents of my file:

C:\Users\nunma04>type test

testing

123

 

I know my FTP Server is up and I can login to get my file.

This is my FTP Step:  FTP normally runs or Port 20 or 21.  When I click the Execute Now push button I see the contents of the file are am doing the FTP on.

<Please see attached file for image>

src="/servlet/servlet.FileDownload?file=0150c000004AKKqAAO" alt="ftp_step.png" width="965" height="398">

 

Additional Information

https://docops.ca.com/devtest-solutions/10-1/en/reference/test-step-descriptions/external-subprocess-steps/external-ftp-step

 

Attachments

1558700161148000007774_sktwi1f5rjvs16oy7.png get_app