iSeriesCodePoet
Programmer
Hey guys, 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:
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:
And this is my java method:
If you see anything wrong or have any other ideas. Please let me know. I am starting to loose hair over this.
iSeriesCodePoet
iSeries Programmer/Lawson Software Administrator
See my progress to converting to linux.
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:
Code:
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.String;)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:
Code:
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:
Code:
Public boolean UploadFile(Docfile objDocFIle, String authToken, String url) throws DocgateException{
return objDocgateDAO.UploadFile(objDocFIle,authToken,url);
}
iSeriesCodePoet
iSeries Programmer/Lawson Software Administrator
See my progress to converting to linux.