Discussion:
Using PCML to access and RPG program
(too old to reply)
Cheri Duchrow
2005-01-07 17:49:18 UTC
Permalink
I have a web application running on a WAS Express Server - Right now
developing and doing the testing on the Test Environment Server. I have
successfully called other programs using the ProgramCall Object in jt400.jar
but thought I would try to use PCML and the ProgramCallDocument. I have
seen several examples and have patterned my code using the examples. Here
is the Code
ProgramCallDocument pcml;

AS400 as400x =

new AS400(

Constants.SYS_HOST_NAME,PropertiesManager.getProperty(FinesConstants.DATASOU
RCEKEY + PropertiesManager.GEN_DB_USER),

PropertiesManager.getProperty(FinesConstants.DATASOURCEKEY +
PropertiesManager.GEN_DB_PASSWORD));



String receiptNum;



try {


List aList = aRLBean.getReceiptBeanList();

//PcmlMessageLog.setTraceEnabled(true);

pcml = new ProgramCallDocument(as400x,
"com.sands.portage.fines.dataaccess.svr200b");

.... Rest of the code, try catch block and finally statements.



My PCML file is in the same package of the class that is calling it but I
have fully qualified the name anyways. It is not serialized just a plain
text file and it does have the pcml extension on it.

Here is the contents of the pcml file:

<pcml version="1.0">

<!-- RPG program: *PGM -->

<!-- created: 2005-01-06-17.12.05 -->

<!-- source: CADLIB/QRPGSRC(SVR200B) -->

<program name="svr200b" path="/QSYS.LIB/QSYS.LIB/SVR200B.PGM">

<data name="casenum" type="char" length="9" usage="inputoutput" />

<data name="amtpaid" type="packed" length="7" precision="2"
usage="inputoutput" />

<data name="receiptNum" type="char" length="9" usage="inputoutput" />

</program>

</pcml>

When I step through in debug when it creates the new ProgramCallDocument it
skips the rest of my code in the try block and skips right to the finally
block. Even though I am catching serveral exceptions it does not appear to
throw and exception. I have tried numerous things and debugging into
classes that I don't have code for. I could try to outline all that I have
done but this may get pretty long. If you need more information please let
me know. I am using WDSC to develop the application and have made sure all
of the necessary jar files are in my lib directory (J2EE). Any suggestions
would be appreciated to help me resolve this issue before I have to revert
back to using the ProgramCall object.

Thanks

Cheri
Mark Phippard
2005-01-10 20:41:54 UTC
Permalink
Post by Cheri Duchrow
When I step through in debug when it creates the new
ProgramCallDocument it skips the rest of my code in the try block and
skips right to the finally block. Even though I am catching serveral
exceptions it does not appear to throw and exception. I have tried
numerous things and debugging into classes that I don't have code
for. I could try to outline all that I have done but this may get
pretty long. If you need more information please let me know. I am
using WDSC to develop the application and have made sure all of the
necessary jar files are in my lib directory (J2EE). Any suggestions
would be appreciated to help me resolve this issue before I have to
revert back to using the ProgramCall object.
It is most likely a class loader problem. PCML had a bug in this area
where it would try to locate the pcml document using its class loader
as opposed to the application class loader. What is probably happening
is that you are using jt400.jar for some "global" function in WAS
Express, such as a JDBC datasource. Therefore, jt400 is being loaded
at a level that is higher in the stack than your application. At
runtime, your PCML document is not found in the class path for that
class loader.

This was fixed a while ago in the open source version of jt400, so I
would assume if you are up to date on PTF's and using the version of
jt400 that comes with OS/400 that you would not have the problem.

You can workaround the problem by putting a copy of your pcml document
in a folder that is part of the WebSphere server classpath.

Mark

Loading...