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



I've reached a brick wall with a RPG to Java interface and was hoping
that I might be able to get some assistance. I've tried to include all
relevant code. It's just a self-tutorial exercise at this stage, and out
java programmer has created the java.

 

The class is in the correct IFS folder.

 

It's the old RNX0301 problem and I'm getting nowhere as I'm never quite
sure what other small, but fundamental piece of syntax (or
understanding!) is missing.

 

I have a test harness CL which sets the class path immediately before
calling the RPG:

 

CHGENVVAR  ENVVAR(CLASSPATH) +                              

             VALUE('/java/leo/ibm-jaxrpc-client.jar:/jav+   

             a/leo/objectpoolimp.jar:/java/leo/xercesImp+   

             l.jar:/java/leo/xml-apis.jar:/java/leo/')      

 

I use debug to examine the CLASSPATH just before the failing RPG
command, and it is correct.

 

The class I am using is interfacing to the Active Directory so we can
access various contact details using the iSeries user profile. Here is
the start of the Class, and the one method I'm trying to access:

 

package au.com.eigansvar.web.webservices.userdb.client;

 

public class User  {

    private java.lang.String department;

    private java.lang.String email;

    private boolean enabled;

    private java.lang.String fax;

    private java.lang.String firstName;

    private java.lang.String hphone;

    private java.lang.String hphone2;

    private java.lang.String jobTitle;

    private java.lang.String lastName;

    private java.lang.String mphone;

    private java.lang.String pager;

    private java.lang.String private_mphone;

    private java.lang.String state;

    private java.lang.String wphone;

    private byte[] sid;

    private java.lang.String ad_username;

 

    public User() {

    }

 

    public void setFirstName(java.lang.String firstName) {

        this.firstName = firstName;

    }

 

When I look at the dump taken after the exception occurs, I can see the
two objects:

 

PROFILE               OBJECT(*JAVA)        java.lang.String: asanovl


USER                  OBJECT(*JAVA)
au.com.eigansvar.web.webservices.userdb.client.User:
au.com.eigansvar.web.webservice  

                                           s.userdb.client.User@65c31594


 

(By the way, what does the @65c31594 signify?)

 

I presume their presence in the dump means that the two instantiations
worked correctly?

 

The RPG is as follows (minus comments):

 

/copy qsysinc/qrpglesrc,jni                            

D RunCmd          PR            10I 0 ExtProc('system') 

D  CmdString                      *   Value             

D                                     Options(*string)  

d newString       PR              O   EXTPROC( *JAVA                    

d                                            : 'java.lang.String'       

d                                            : *CONSTRUCTOR)            

 *                                                                      

d                                     CLASS(*JAVA : 'java.lang.String') 

d value                      65535A   CONST VARYING         

d newUser         PR              O   EXTPROC(*JAVA                    

d                                            :'au.com.eigansvar.-      

d                                     web.webservices.userdb.client.-  

d                                     User'                            

d                                            : *CONSTRUCTOR)           

 *                                                                     

d                                     CLASS(*JAVA                      

d                                           :'au.com.eigansvar.-       

d                                     web.webservices.userdb.client.-  

d                                     User')                           

d setFirst        PR                  EXTPROC(*JAVA


d                                            :'au.com.eigansvar.-


d                                     web.webservices.userdb.client.-


d                                     User'


d                                            : 'setFirstName')


d value                           O   CLASS( *JAVA : 'java.lang.string')


d                                     CONST


d User            S               O   CLASS(*JAVA


d                                            :'au.com.eigansvar.-


d                                     web.webservices.userdb.client.-


d                                     User')


 *


d profile         S                   like(jstring)


c                   eval      profile= newString('asanovl')      

c                   eval      user= newUser()                    

c                   callp     setFirst(user : profile)


 

 

The program seems to instantiate profile and user correctly, but the
last line fails with the dreaded RNX0301:

 

Message . . . . :   Java exception received when calling Java method.


Cause . . . . . :   RPG procedure JAVTST05 in program ANVDEV/JAVTST05
received 

  Java exception "java.lang.NoSuchMethodError: setFirstName" when
calling      

  method "setFirstName" with signature "(Ljava.lang.string;)V" in class


  "au.com.eigansvar.web.webservices.userdb.client.User".


 

 

Thanks to the kind souls who assist.


*********************************************************************************************************
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you are not the intended recipient, any use, disclosure or copying of this 
message is unauthorised. If you have received this message in error, please 
reply using the sender's email address. 

This footnote confirms that this email message has been scanned for computer 
viruses. EIG-Ansvar Limited does not accept liability for any loss or damage, 
whether caused by our own negligence or not, that results from a computer virus 
or defect in the transmission of this email or any attached file. 

EIG-Ansvar Limited - Australia (A.B.N. 21 007 216 506)
Email : insure@xxxxxxxxxxxxxxxx

Eig-Ansvar Limited - New Zealand
Email : insure@xxxxxxxxxxxxxxxx

*********************************************************************************************************

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.