|
Special thanks to Kristen for the help on Saturday! I finally got the program to run. I'm not sure which of these changes made the difference, but they did the trick: (1) I imported the specific classes instead of using a wildcard. Instead of import com.ibm.as400.access.*; I coded the following: import com.ibm.as400.access.AS400; import com.ibm.as400.access.ProgramCall; import com.ibm.as400.access.ProgramParameter; import com.ibm.as400.access.AS400Text; (2) I put both my source file (ExtolCl.java) and the jt400Native.jar file in a custom directory of the IFS (/Dot/iConnect). I had been using the /QIBM/ProdData/Java400 directory. (3) I compiled the ExctolCl.java in the IFS using qsh. I had been dragging a compiled class in from the Eclipse IDE on my desktop. (4) I set the classpath in qsh using: export -s CLASSPATH=/Dot/iConnect:/Dot/iConnect/jt400Native.jar I had been using the WRKENVVAR from a command line of the classpath parm of the CL JAVA command. (5) I then ran the program in qsh using the java command. I had been using the CL JAVA command. Thanks again to all for the help! Kelly -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]On Behalf Of Kristen Henry Sent: Saturday, May 20, 2006 2:18 PM To: 'Java Programming on and around the iSeries / AS400' Subject: RE: Program can't find toolbox classes on the iSeries The jt400 jar is for when you run the programs on a machine that is not an iSeries and access an iSeries. The Native (of which I believe the ntv version to be also) is for running on the iSeries as it is optimized for the iSeries. If you program is running on the iSeries only use the Native jar in the classpath. HTH Kristen > -----Original Message----- > From: java400-l-bounces@xxxxxxxxxxxx > [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Kelly Cookson > Sent: Saturday, May 20, 2006 11:14 AM > To: Java Programming on and around the iSeries / AS400 > Subject: Program can't find toolbox classes on the iSeries > > I'm trying to run a simple java program containing jt400.jar > access classes on the iSeries. > > I have the jt400.jar, the jt400ntv.jar, and the > jt400Native.jar files in the /QIBM/ProdData/Java400 > directory. I have also tried with just one these jar files in > the directory. > > I used WRKENVVAR to set the CLASSPATH enviornmental variable > to each of the following: > > '.:/QIBM/ProdData/Java400/jt400.jar' > '/QIBM/ProdData/Java400/jt400.jar' > '.:/QIBM/ProdData/Java400/jt400ntv.jar' > '/QIBM/ProdData/Java400/jt400ntv.jar' > '.:/QIBM/ProdData/Java400/jt400Native.jar' > '/QIBM/ProdData/Java400/jt400Native.jar' > > I have also tried these same classpaths as parameters in the > JAVA command from the command line. > > No matter what I do, I get an error saying: > > java.lang.NoClassDefFoundError: > com/ibm/as400/access/AS400 > at java.lang.Throwable.<init>(Throwable.java:195) > > at java.lang.Error.<init>(Error.java:49) > > at > java.lang.NoClassDefFoundError.<init>(NoClassDefFoundError.jav > a:40) > > at ExtolCl.callProgram(ExtolCl.java:9) > > at ExtolCl.main(ExtolCl.java:29) > > Java program completed with exit code 1 > > > It's finding and executing the class I wrote (ExtolCl), which > is also in the /QIBM/ProdData/Java400 directory. It doesn't > seem to be able to find the toolbox classes. > > What am I missing??? Here's the source code for the program, > if that helps: > > import com.ibm.as400.access.*; > public class ExtolCl { > public String errorParm = ""; > public void callProgram() { > try { > AS400 system = new AS400("mysystem", "myname", "mypassword"); > ProgramCall pgm = new ProgramCall(system); > String program = "/QSYS.LIB/EXTOL.LIB/EXTOLCL.PGM"; > ProgramParameter[] parameterList = new ProgramParameter[1]; > parameterList[0] = new ProgramParameter(1); > pgm.setProgram(program, parameterList); > if (pgm.run() != true) { > errorParm = "1"; > } else { > AS400Text errorValue = new AS400Text(1); > errorParm = > (errorValue.toObject(parameterList[0].getOutputData())).toString(); > }//end-if > system.disconnectAllServices(); > } catch (Exception e) { > errorParm = "1"; > }//end-try-catch > }//end-callProgram > public static void main(String[] args){ > ExtolCl test = new ExtolCl(); > test.callProgram(); > }//end-Main > }//end-ExtolCl > > Thanks in advance for any help! > > Kelly > > -- > This is the Java Programming on and around the iSeries / > AS400 (JAVA400-L) mailing 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. > > >
As an Amazon Associate we earn from qualifying purchases.
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.