Thanks. Yes, eventually I did a DSPMSG QSYSOPR and found that a command in
the CL program the Java program was trying to run couldn't be found. I
fully qualified the CL command name in the CL program, recompiled, and the
Java program was happy. I wish these things would just fail instead of
hanging.

On Fri, Oct 31, 2014 at 12:00 PM, <java400-l-request@xxxxxxxxxxxx> wrote:

Send JAVA400-L mailing list submissions to
java400-l@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.midrange.com/mailman/listinfo/java400-l
or, via email, send a message with subject or body 'help' to
java400-l-request@xxxxxxxxxxxx

You can reach the person managing the list at
java400-l-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of JAVA400-L digest..."


Today's Topics:

1. ProgramCall just hangs (Kelly Beard)
2. Re: ProgramCall just hangs (David Gibbs)


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

message: 1
date: Thu, 30 Oct 2014 14:27:42 -0500
from: Kelly Beard <kenverybigliar@xxxxxxxxx>
subject: ProgramCall just hangs

Whenver I do a ProgramCall object and pass parameters, the Java program
just hangs on the run() method. There is nothing to tie up the program it
is trying to run. In fact, here is the CL *PGM it is trying to run:

PGM PARM(&ROLE)
/* Variable declaration */
DCL VAR(&ROLE) TYPE(*CHAR) STG(*AUTO) LEN(10)

RTVRSFDFT SYNCROLE(&ROLE)

ENDPGM

HERE is the Java program.

import java.io.*;
import com.ibm.as400.access.*;

// How to compile and run:
// javac -cp :/QIBM/ProdData/OS400/jt400/lib/jt400Native.jar RSFRole.java
// java -cp :/QIBM/ProdData/OS400/jt400/lib/jt400Native.jar RSFRole
//
public class RSFRole {
public static void main(String args[])
{
byte initial_value = 0;
AS400 system = new AS400("localhost");
AS400Text nametext = new AS400Text(8);

ProgramCall pgm = new ProgramCall(system);
ProgramParameter[] parameterList = new ProgramParameter[1];
parameterList[0] = new ProgramParameter(10);
try {
if (pgm.run("/QSYS.LIB/BEAK.LIB/RSFROLE.PGM", parameterList) !=
true) {
System.err.println("barf.");
// Show the messages (returned whether or not there was an
error.)
AS400Message[] messagelist = pgm.getMessageList();
for (int i = 0; i < messagelist.length; ++i) {
// Show each message.
System.out.println(messagelist[i].getText());
}
}
else {
AS400Text text = new AS400Text(10);

System.out.println(text.toObject(parameterList[0].getOutputData()));
}
}
catch (Exception e) {
System.err.println("barf.");
e.printStackTrace();
}
}
}


--
Kelly Beard


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

message: 2
date: Thu, 30 Oct 2014 14:44:36 -0500
from: David Gibbs <david@xxxxxxxxxxxx>
subject: Re: ProgramCall just hangs

On 10/30/2014 2:27 PM, Kelly Beard wrote:
Whenver I do a ProgramCall object and pass parameters, the Java
program just hangs on the run() method. There is nothing to tie up
the program it is trying to run. In fact, here is the CL *PGM it is
trying to run:

Have you checked for Msg-Wait on the job that's running the command?

To find the job, just do a WRKOBJLCK <user profile> *USRPRF.

david


--
IBM i on Power Systems: For when you can't afford to be out of business!

I'm riding a metric century (100 km / 62 miles) in the 2015 American
Diabetes Association's Tour de Cure to raise money for diabetes research,
education, advocacy, and awareness. You can make a tax deductible donation
to my ride by visiting http://email.diabetessucks.net. My goal is $5500
but any amount is appreciated.

See where I get my donations from ... visit
http://email.diabetessucks.net/mapdonations.php for an interactive map
(it's a geeky thing).


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

Subject: Digest Footer

--
This is the Java Programming on and around the IBM i (JAVA400-L) digest
list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



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

End of JAVA400-L Digest, Vol 12, Issue 60
*****************************************





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.