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



Your java method returns a boolean but you've prototyped it as returning a
Boolean.  Either change the java method to return a Boolean or change your
protype to specify type "N" which is an RPG indicator which is what maps to
boolean.

HTH,
Gary

> -----Original Message-----
> From: java400-l-bounces@xxxxxxxxxxxx 
> [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Wills, 
> Mike N. (TC)
> Sent: Friday, December 12, 2003 2:08 PM
> To: RPG programming on the AS400 / iSeries; Java Programming 
> on and around the iSeries / AS400
> Subject: Java/RPG problem, I need help solving.
> 
> 
> Hey guys, first of all I apologize for the cross-post, but I 
> wasn't sure where I should post this question... And sorry 
> about the length.
> 
> I am working on linking RPG and java programs together. I 
> have written a couple modules, one for each class I am 
> interfacing. They both seem to work just fine except for one 
> method. I keep getting:
> 
> Message ID . . . . . . :   RNX0301       Severity . . . . . . . :   50
> 
> Message type . . . . . :   Escape
> 
> Date sent  . . . . . . :   12/12/03      Time sent  . . . . . 
> . :   14:40:56
> 
>  
> 
> Message . . . . :   Java exception received when calling Java method.
> 
> Cause . . . . . :   RPG procedure DOCP_UPLOA in program 
> PDFPGMSNEW/F.DOCPROC
> 
>   received Java exception "java.lang.NoSuchMethodError: 
> UploadFile" when
> 
>   calling method "UploadFile" with signature
> 
>  
> "(Lcom.taylor.docgate.Docfile;Ljava.lang.String;Ljava.lang.Str
> ing;)Ljava.lan
>   g.Boolean;" in class "com.taylor.docgate.Docprocess".
> 
> Recovery  . . . :   Contact the person responsible for 
> program maintenance
> to 
>   determine the cause of the problem.
> 
> Technical description . . . . . . . . :   If the exception 
> indicates that
> the 
>   Java class was not found, ensure the class for the method 
> is in the class
> 
>   path. If the exception indicates that the Java method was 
> not found, check
> 
>   the method name and signature. If the signature is not 
> correct, change the
> 
>   RPG prototype for the method, or change the Java method, so 
> that the return 
>   type and parameter types match. You can determine the 
> signatures for all the
>   methods in class XYZ using command QSH CMD('javap -s XYZ').
> 
> 
> 
> Now I can call other methods in the class just fine, and I 
> have recompiled several times. Below is the code I am using. 
> I have talked to our java programmers and some others who I 
> know deal a bit with java and no one can seem to find my 
> signature error. DocP, String, and DocFile are defined as 
> constants for the appropriate class, so 'String' is 
> 'Const('java.lang.String')'.
> 
> This is my subprocedure:
>      P*--------------------------------------------------
>      P* Procedure name: DocP_UploadFile
>      P* Purpose:        Upload a file to DocuShare
>      P* Returns:
>      P* Parameter:      Document => Core DocuShare document 
> information
>      P* Parameter:      AuthToken => Autority Token
>      P* Parameter:      URL
>      P*--------------------------------------------------
>      PDocP_UploadFile  B                   EXPORT
>      DDocP_UploadFile  PI
>      D  objDocP                        O   Class(*Java: DocP)
>      D  Document                       O   CLASS(*JAVA:DocFile)
>      D                                     CONST
>      D  AuthToken                      O   CLASS(*JAVA:String)
>      D                                     CONST
>      D  URL                         500A   CONST
>      D                                     OPTIONS(*VARSIZE)
> 
>      D uploadDoc       PR              O   ExtProc(*Java: DocP:
> 'UploadFile')
>      D                                     Class(*Java: 
> 'java.lang.Boolean')
>      D  Doc                            O   Class(*Java: DocFile) Const
>      D  AuthToken                      O   Class(*Java: String) Const
>      D  URL                            O   Class(*Java: String) Const
> 
>      D boolean         S               O   Class(*Java: 
> 'java.lang.Boolean')
> 
>       /FREE
> 
>        monitor;
>          boolean = uploadDoc(objDocP: Document: AuthToken: 
> #cvtToString(URL));
>          return;
>        on-error *all;
>          return;
>        endmon;
> 
>       /END-FREE
>      PDocP_UploadFile  E  
> 
> And this is my java method:
> 
> Public boolean UploadFile(Docfile objDocFIle, String 
> authToken, String url) throws DocgateException{  
>    return objDocgateDAO.UploadFile(objDocFIle,authToken,url);        
> }
> 
> If you see anything wrong or have any other ideas. Please let 
> me know. I am starting to loose hair over this.
> 
> Mike Wills
> Lawson Programmer/Administrator
> Taylor Corporation
> Email: mnwills AT taylorcorpNOSPAM DOT com
> AIM: iSeriesCodePoet _______________________________________________
> This is the Java Programming on and around the iSeries / 
> AS400 (JAVA400-L) mailing list To post a message email: 
> JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change 
> list options,
> visit: http://lists.midrange.com/mailman/listinfo/java400-l
> or email: JAVA400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/java400-l.
> 


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.