Anmelden

View Full Version : Problems reading AFPDS spool with Java Toolbox



manfred.weigl
25-10-10, 13:35
Problems reading AFPDS spool with Java Toolbox


Hi,

I'm trying to read an AFPDS spool using SpooledFile.getPageInputStream() from Java Toolbox. When doing this, I get following Exception:
com.ibm.as400.access.AS400Exception: CPF3CF2 Fehler beim Aufruf von API QWPZHPT1
at com.ibm.as400.access.NPConversation.makeRequest(NP Conversation.java:163)
at com.ibm.as400.access.PrintObjectPageInputStreamImp lRemote.createPrintObjectPageInputStream(PrintObje ctPageInputStreamImplRemote.java:121)
at com.ibm.as400.access.PrintObjectPageInputStream.<init>(PrintObjectPageInputStream.java:82)
at com.ibm.as400.access.SpooledFile.getPageInputStrea m(SpooledFile.java:754)
at de.branchware.bgo.spoolview.SpoolAccessI5.getAFPSp oolAsGif(SpoolAccessI5.java:495)

My calling code looks like this, the error occurs in the marked like (*):
SpooledFile splf = new SpooledFile(...
PrintParameterList printParms = new PrintParameterList();
printParms.setParameter(PrintObject.ATTR_WORKSTATI ON_CUST_OBJECT, "/QSYS.LIB/QWPGIF.WSCST");
printParms.setParameter(PrintObject.ATTR_MFGTYPE, "*WSCST");
PrintObjectPageInputStream in = splf.getPageInputStream(printParms); (*)

Similarily, when reading a spool's PageInputStream, i also get an exception:
java.io.IOException: java.io.IOException: com.ibm.as400.access.ErrorCompletingRequestExcepti on: An error occurred on the system.
at com.ibm.as400.access.PrintObjectTransformedInputSt reamImplRemote.read(PrintObjectTransformedInputStr eamImplRemote.java:418)
at com.ibm.as400.access.PrintObjectTransformedInputSt ream.read(PrintObjectTransformedInputStream.java:1 88)
at java.io.BufferedInputStream.fill(BufferedInputStre am.java:218)
at java.io.BufferedInputStream.read(BufferedInputStre am.java:235)
at de.branchware.bgo.spoolview.SpoolAccessI5.getAFPSp oolAsTiff(SpoolAccessI5.java:542)

The code looks like this:
SpooledFile splf = new SpooledFile(...
PrintParameterList printParms = new PrintParameterList();
printParms.setParameter(PrintObject.ATTR_WORKSTATI ON_CUST_OBJECT, "/QSYS.LIB/QWPGIF.WSCST");
printParms.setParameter(PrintObject.ATTR_MFGTYPE, "*WSCST");
PrintObjectPageInputStreamin = splf.getPageInputStream(printParms);
in.selectPage(page);
byte[ ] buf = new byte[32767];
int bytesRead = 0;
do {
bytesRead = in.read(buf); (*)
if (bytesRead > 0) {
outStream.write(buf);
}
} while ( bytesRead != -1 );

The code has been running on many differents AS/400 systems without any problems. But on one of our customers' machines, we get the problems described above.
The machine is V5R4 (which did not cause any troubles till now).
The following PTFs are installed:
5722JV1 SF99291 Java Group PTF (installed, LVL 24)
5722SS1 SI21833 DB2 UDB for iSeries (installed)
5722SS1 SI23754 Toolbox driver PTF (installed)
5722JC1 SI23752 Toolbox driver PTF (installed)
SF99347 (installed, LVL 40)

Till now, I could not find any hints how to solve the problem.
Could anybody give me a hint how to find the reason for my problem, or where to search for a solution or further hints?

Thanks in advance,
Manfred.

ExAzubi
26-10-10, 11:15
Gello You must set the

ATTR_AFP, "*YES"

in the RpitnParamterList, because your read an AFP Spool.

manfred.weigl
26-10-10, 14:41
Hi ExAzubi,

thanks for your answer. I tried this, but nothing changed.

Meanwhile, another newsgroup pointed me to QNPSERVS' joblog, where I found missing objects like C0S0CR12, CZ6200, which seem to be font objects, which should be in library QFNTCPL. This lib isn't there on our customer's machine.
I'll try to install the lib, and hope that this will solve the problem.

Thanks,
Manfred.