I am using  JTOpen_1_4 to run the following program. After running the
program I get the following error "Error connecting: Software caused
connection abort: JVM_recv in socket input stream read"

The system admin tells me that he has issued STRHOSTSVR SERVER(*ALL)
command, so all the host server on OS/400 must be running.

Is any special privilege required to run this program ?

Please help.

Thanks
Sandeep



import com.ibm.as400.access.*;

public class TestCommandCall
{
    public static void main(String args[])
    {
        AS400 system400 = new AS400(systemname, username, password);
        System.out.println("Creating CommandCall object...");
        CommandCall cmdObj = null;
        try
        {
          System.out.println("Connecting...");
          system400.connectService(AS400.COMMAND);
          System.out.println("Creating CommandCall object...");
          cmdObj = new CommandCall(system400);
        } catch (Exception exc)
        {
          System.out.println("Error connecting: " + exc.getMessage());
          System.exit(1);
        }
        runCmd(cmdObj, "ADDLIBLE CUSTLIB");
        runCmd(cmdObj, "ADDLIBLE CUSTLIB");
        system400.disconnectAllServices();
        System.exit(1);
    }

    public static boolean runCmd(CommandCall cmdObj, String cmdString)
    {
        boolean cmdOK = false;
        try
        {
           System.out.println("Calling command "+cmdString+"...");
           cmdOK = cmdObj.run(cmdString);
           System.out.println("Command returned. Result = " + cmdOK);
        } catch (Exception exc) {}
        AS400Message msgs[] = cmdObj.getMessageList();
        if (msgs != null)
          {
             for (int idx=0; idx < msgs.length; idx++)
                System.out.println("Message: " + msgs[idx].getText());
          }
        System.out.println();
        return cmdOK;
    } // end runCmd method
}

The output of this program is shown below,

C:\AS400\test>java TestCommandCall
Creating CommandCall object...
Connecting...
Error connecting: Software caused connection abort: JVM_recv in socket input
stream read


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.