×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Based on the way you call it, the PR definition needs an input parm:

D postXml         PR           EXTPROC(*JAVA:'PostOutBoundXml':
D 'postXml') D O Class(*JAVA:'java.lang.String')

cornelius, chad wrote:

Thanks Kristen...  I used the fully qualified class and corrected an error
in the classpath variable.  Now I am getting noSuchMethodError postXml()V.
postXml accepts a String object and returns void.  I am a little confused.

Thanks,
Chad Cornelius, IIS
(720) 921-7835

-----Original Message-----
From: Kristen Henry [mailto:klhnry@xxxxxxxxxxxx] Sent: Monday, September 12, 2005 6:49 PM
To: 'Java Programming on and around the iSeries / AS400'
Subject: RE: CLASSPATH Problem (RPG Calling JAVA)

You must use the fully qualified class name in the *JAVA: designation.

Kristen

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of cornelius, chad
Sent: Monday, September 12, 2005 5:29 PM
To: 'Java Programming on and around the iSeries / AS400'
Subject: CLASSPATH Problem (RPG Calling JAVA)

I realize this topic has been beaten to pulp in the archives, but I am
unable to determine why my simple RPG program cannot find a Java class that
I have written.  I followed the steps that Kevin Vandever mentions in his
Midrange articles.



I have built a Prototype and RPG program as follows:

D postXml         PR                  EXTPROC(*JAVA:'PostOutBoundXml':

D 'postXml') D newString PR O ExtProc(*JAVA:
D                                             'java.lang.String':

D *CONSTRUCTOR)
D                                     Class(*JAVA:'java.lang.String')

D charParm 100A CONST VARYING


RPG Program:



H DftActGrp(*NO) ActGrp(*CALLER) /Copy *LibL/QRpgLeSrc,XmlOutPR
D strObj          S               O   Class(*JAVA:'java.lang.String')

C/FREE strObj = newString('<TEST>'); postXml(strObj); Eval *inLR = *on;
/END-FREE



When I call the Java postXml method, I get an exception
"java.lang.NoClassDefFoundError: PostOutBoundXml" when calling

method "postXml" with signature "()V" in class "PostOutBoundXml".  I created
the PostOutBoundXml class in Eclipse, jar'd it up, and placed the jar on the
IFS.  I set the CLASSPATH variable as *job.  The PostOutBoundXml does have a
package.  However, I am assuming the 400 will register it within the jar
file?  I am testing simply by calling the RPG program from the command line.
Does anyone know what I could be doing wrong?  Any help would be greatly
appreciated.



Thanks,

Chad Cornelius, IIS

(720) 921-7835




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.