Verify connection via AS400

1.1k views Asked by At

My method must trying to connect to some other DB server. When I run my application on Linux Server - there was all OK. When I run it on Windows OS - I have java.net.SocketTimeoutException: Read timed out

 private boolean pingServer(String host) {
    String username = "username";
    String password = "password";
    boolean successful;

    AS400 as400 = new AS400(host, username, password);
    SocketProperties socketProperties = as400.getSocketProperties();
    socketProperties.setLoginTimeout(TIMEOUT_MILLISEC);
    socketProperties.setSoTimeout(TIMEOUT_MILLISEC);

    as400.setSocketProperties(socketProperties);
    try{
        successful = as400.validateSignon();
    } catch (AS400SecurityException e) {
        successful = true;
    } catch (IOException e) {
        successful = false;
    } catch (TransactionException e) {
        successful = false;
    }
    as400.disconnectAllServices();
    as400 = null;
    return successful;
}

Can anybody give me some advice? Thanks.

1

There are 1 answers

7
Thorbjørn Ravn Andersen On

AS/400 connections use a lot of network ports which must be available to you.

Try disabling all firewalls between you and the server and try again. This include the software firewall (may be part of the antivirus suite) on the Windows system