× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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-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.