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



Right.  It wouldn't compile because I had the parameter for the newInt
prototype as

D  byes                       9999A   Const Varying

instead of

D  byes                         10I 0 Const Varying

Now it compiles.  When I call it, I get the following error:

Message ID . . . . . . :   RNQ0301
Date sent  . . . . . . :   11/14/02      Time sent  . . . . . . :
11:15:02

Message . . . . :   Java exception received when calling Java method (C G D
  F).

Cause . . . . . :   RPG procedure ICR001 in program ICR001/MIKEE received
Java
  exception "java.lang.NoSuchMethodError: conversionTest" when calling
method
  "conversionTest" with signature
"(Ljava.lang.String;Ljava.lang.Integer;)S"
  in class "conversionTest".
Recovery  . . . :   Contact the person responsible for program maintenance
to
  determine the cause of the problem.
Possible choices for replying to message . . . . . . . . . . . . . . . :
  D -- Obtain RPG formatted dump.
  S -- Obtain system dump.
  G -- Continue processing at *GETIN.
   C -- Cancel.
   F -- Obtain full formatted dump.
 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').

Running the following command:
qsh cmd('javap -s conversionTest')

Gives me this output:
   Compiled from conversionTest.java
   public synchronized class conversionTest extends java.lang.Object
       /* ACC_SUPER bit set */
   {
       public conversionTest(java.io.File,int);
           /*   (Ljava/io/File;I)V   */
       public static void main(java.lang.String[]);
           /*   ([Ljava/lang/String;)V   */
   }

Obviously, the signatures do not match.  Should I post the source for
conversionTest.java?  Should I take this thread to the Java list?

Mike E.





                    "Andrew Lutz"
                    <andrew.lutz@pmig       To:     <rpg400-l@midrange.com>
                    roup.com>               cc:
                    Sent by:                Subject:     RE: Prototyping and 
Creating integer objects in RPG for
                    rpg400-l-admin@mi        calling Javaclasses
                    drange.com


                    11/14/02 10:31 AM
                    Please respond to
                    rpg400-l






Based on what you copied you created a ten character alpha field.
Right?

This is not what I said.

If you have an Integer to define it is (10I 0)

You originally stated that you were using (5I 0) which is not a Integer
it is a small integer.



-----Original Message-----
From: meovino@estes-express.com [mailto:meovino@estes-express.com]
Sent: Wednesday, November 13, 2002 9:04 PM
To: rpg400-l@midrange.com
Subject: RE: Prototyping and Creating integer objects in RPG for calling
Javaclasses


Andrew,

Thanks for getting back to me so fast!

I changed
D xformat         S              5

to
D xformat         S             10

I still get the java.lang.NoSuchMethodError

Mike E.





                    "Andrew Lutz"
                    <andrew.lutz@pmig       To:
<rpg400-l@midrange.com>
                    roup.com>               cc:
                    Sent by:                Subject:     RE: Prototyping
and Creating integer objects in RPG for
                    rpg400-l-admin@mi        calling Java classes
                    drange.com


                    11/13/02 11:59 PM
                    Please respond to
                    rpg400-l






Integer is defined as 10I 0

Small Integer is 5I 0

Change it to 10


-----Original Message-----
From: meovino@estes-express.com [mailto:meovino@estes-express.com]
Sent: Wednesday, November 13, 2002 8:52 PM
To: rpg400-l@midrange.com
Subject: Prototyping and Creating integer objects in RPG for calling
Java classes

I'm having some trouble calling a Java class that takes an int as one of
its inputs.  I have tried the following as the prototype for the method
parameter:

D  format                         O   Class(*JAVA:'java.lang.Integer')
D                                     Const

and this for the constructor:

D newInt          PR              O   ExtProc(*JAVA:
D                                             'java.lang.Integer':
D                                             *CONSTRUCTOR)
D                                     Class(*JAVA:'java.lang.Integer')
D  byes                       9999A   Const Varying

Here's the declaration for the field I'm using as the input parm for the
RPG program:

D xformat         S              5
 * I would think this should be 5I 0 or 5S 0, but it only compiles if I
declare this as alpha.

Here's the declaration for the variable I'm using as the input parm for
the
Java class:

D sFormat         S               O   Class(*JAVA:'java.lang.Integer')

And finally, here's how I'm trying to create the java.lang.Integer
object.

C                   Eval      sFormat   = newInt(xformat)

If it's not yet obvious, I really don't know what I'm doing here.  I'm
trying to adapt another RPG program we're using that calls a Java class,
but that one only uses strings.  I'd be happy to post all of the source
on
request.

Thanks!

Mike E.



_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.







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.