• Subject: Re: Call RPG from Java using ToolBox - run on PC and fail on AS400
  • From: "Bruce Jin" <brucej@xxxxxxxxxxxxxxxxxxxx>
  • Date: Thu, 18 Jan 2001 08:40:16 -0600

Hi  Joe;

Following your advice I used an empty parmList in place of the ‘null’ and
now the java class also runs on AS400.

Indeed, the jt400.zip on AS400 is newer (V4R5 270 box) and the zip file on
my PC was from an old 170 box. After I copied the new zip file to my PC, the
java program also failed to run on PC if I did not use an empty parmList. It
appears that ibm has changed the toolbox to not allow a null value.

Thanks for your help.

Bruce



-----Original Message-----
From: Joe Pluta <joepluta@plutabrothers.com>
To: JAVA400-L@midrange.com <JAVA400-L@midrange.com>
Date: Wednesday, January 17, 2001 10:43 PM
Subject: RE: Call RPG from Java using ToolBox - run on PC and fail on AS400


>My first guess would be that you are running two different versions of the
>toolbox... the one on your PC doesn't seem to match the one on the AS/400.
>
>Regardless, you might want to try setting the parameters with a zero-length
>array of ProgramParameters:
>
>pgm.setParameterList(new ProgramParameter[0]);
>
>I haven't tried it, since I've never run into the problem.  Let us know
what
>you find out!
>
>Joe
>
>> -----Original Message-----
>> From: owner-java400-l@midrange.com
>> [mailto:owner-java400-l@midrange.com]On Behalf Of Bruce Jin
>> Sent: Wednesday, January 17, 2001 3:36 PM
>> To: JAVA400-L@midrange.com
>> Subject: Call RPG from Java using ToolBox - run on PC and fail on AS400
>>
>>
>>  Hello:
>>
>> I wrote a simple java program to call a simple RPG program. The
>> RPG program
>> is called TEST1 and it has no *ENTRY PLIST in it.  The code is
>> listed below.
>> The java class runs OK on PC (it prompts system, name user, password).
The
>> RPG is called correctly. The output on the VAJ console is like this:
>>
>> AS400 obj created...
>> pgm.run() = true
>> Call completed.
>>
>>
>> When I copied this class to AS400 and run it in Qshell, the class ran but
>> the call failed and I get the following output:
>>
>> > java CallRPG2
>>    AS400 obj created...
>>    error=java.lang.NullPointerException: parameterList
>>    Call completed.
>>    $
>>
>> Any ideas?
>> TIA. Bruce
>>
>>
>> import com.ibm.as400.access.*;
>>
>> class CallRPG2 {
>>
>>     public static void main(java.lang.String[] args) {
>>
>>    boolean pgmrun;
>>
>>    AS400 as400 = new AS400();
>>    System.out.println("AS400 obj created..." );
>>
>>    ProgramCall pgm = new ProgramCall(as400);
>>    try{
>>      pgm.setProgram(QSYSObjectPathName.toPath("BRUCELIB", "TEST1",
>> "PGM"),null);
>>      pgmrun = pgm.run();
>>      System.out.println("pgm.run() = " + pgmrun);
>>      if (pgmrun != true)  {
>>       AS400Message[] msgList = pgm.getMessageList();
>>         for (int i=0; i<msgList.length; i++)
>>          System.out.println(msgList[i].getText());
>>    }
>>
>>  } catch (Exception e) {
>>   System.out.println("error=" + e);
>>  }
>>
>>  System.out.println("Call completed." );
>>  as400.disconnectService(AS400.COMMAND);
>>  System.exit(0);
>>   }
>>
>> }
>>
>>
>> +---
>> | This is the JAVA/400 Mailing List!
>> | To submit a new message, send your mail to JAVA400-L@midrange.com.
>> | To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
>> | To unsubscribe from this list send email to
>> JAVA400-L-UNSUB@midrange.com.
>> | Questions should be directed to the list owner: joe@zappie.net
>> +---
>>
>
>+---
>| This is the JAVA/400 Mailing List!
>| To submit a new message, send your mail to JAVA400-L@midrange.com.
>| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
>| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
>| Questions should be directed to the list owner: joe@zappie.net
>+---

+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2022 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.