× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: Call RPG from Java using ToolBox - run on PC and fail on AS400
  • From: Kris Kottapali <kris.kottapali@xxxxxxxx>
  • Date: Thu, 18 Jan 2001 09:11:23 -0600

try this!

pgm.setProgram(QSYSObjectPathName.toPath("BRUCELIB", "TEST1",
"PGM"));

Kris Kottapali
Sr.Devloper
kkottapali@arch.com
Work Phone:513-530-2550
Pager:866-207-4334
Fax:513-489-7933
Arch Wireless
Cincinnati,OH


-----Original Message-----
From: Joe Pluta [mailto:joepluta@plutabrothers.com]
Sent: Wednesday, January 17, 2001 5:26 PM
To: JAVA400-L@midrange.com
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-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.