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




Conn is a socket connection that is already established. False is defined in my RPG as
D False S O Class(*JAVA:'java.lang.Boolean')


From: matt.haas@xxxxxxxxxxx
To: rpg400-l@xxxxxxxxxxxx
Date: Tue, 12 Feb 2008 09:25:00 -0500
Subject: RE: Calling Java from RPG - Again

You have an extra parameter in your call to createAccount. I'm guessing "Conn" is some sort of database (or socket) connection and that's not defined on the prototype. Also, there is a difference between a boolean and a Boolean variable in Java. That will probably cause an issue as well.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon S
Sent: Tuesday, February 12, 2008 9:19 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Calling Java from RPG - Again


Well I thought I had it working, but now I am stuck again. I am getting the following error:

Cause . . . . . : RPG procedure CG0001 in program GDSBILLBLD/CG0001 received
Java exception "java.lang.NoSuchMethodError: createAccount" when calling
method "createAccount" with signature
"(Ljava.lang.String;Ljava.util.Hashtable;Ljava.lang.String;Ljava.lang.Boolea
n;)V" in class "com.stalker.CGPro.CGProCLI".

Here is my call in RPG

createAccount(Conn:saccountName
:settings
:smailboxName
:FALSE);

And here is the java method and my prototype.

* void createAccount(String accountName, Hashtable settings, String
* accountType,boolean external)
D
D createAccount...
D PR ExtProc(*JAVA:CGConnectClass:
D 'createAccount')
* method parameters
D accountName O Class(*JAVA:'java.lang.String')
D Const
D settings O Class(*JAVA:'java.util.Hashtable'
D Const
D accountType O Class(*JAVA:'java.lang.String')
D Const
D external O Class(*JAVA:'java.lang.Boolean')
D Const


Any help would be greatly appreciated.

Jon> From: rvrratjon@xxxxxxxxxxx> To: rpg400-l@xxxxxxxxxxxx> Subject: RE: Calling Java from RPG> Date: Mon, 11 Feb 2008 19:01:22 +0000>>> That works. Thanks again Scott.>>>> Date: Mon, 11 Feb 2008 12:21:30 -0600>> From: rpg400-l@xxxxxxxxxxxxxxxx>> To: rpg400-l@xxxxxxxxxxxx>> Subject: Re: Calling Java from RPG>>>> Hi Jon.>>>>> One of the methods that I am calling has a parameter of a data type>>> hashtable. How on earth do I create that in RPG? Data Structure?>>> Array?>>>> The Hashtable parameter from your code snippet appears to be a Java>> object. From RPG, that'd be data type O, with the CLASS keyword to>> describe which Java class it refers to. You've already done this with>> the String data type in some of the previous code examples in this>> thread -- the only difference is that you'll want to use>> java.util.Hashtable in the CLASS keyword instead of the java.lang.String>> that you posted before.>>>> Personally, I prefer to create a standalone va
riable like this:>>>> D Hashtable s O CLASS(*JAVA>> D :'java.util.Hashtable')>>>> Then, in your prototype for the Java method, you can declare the>> parameter as "like(Hashtable)". That way, you don't have to retype the>> whole CLASS thinggy on your prototype.>>>> You'll need to have a separate prototype for the Hashtable constructor,>> and another prototype for the "put" method in order to duplicate the>> code from the example you posted. The following code is untested, it's>> just off the top of my head, hopefully it'll give you an idea of what to do:>>>>>> D new_Hashtable pr like(Hashtable)>> D extproc(*JAVA>> D :'java.util.Hashtable'>> D :*CONSTRUCTOR)>>>> D Hashtable_put pr like(jObject)>> D extproc(*JAVA>> D :'java.util.Hashtable'>> D :'put')>> D key like(jObject) const>> D value like(jObject) const>>>> D settings s like(Hashtable)>>>> /free>>>> settings = new_Hashtable();>> Hashtable_put( settings>> : new_String('RealName')>> : new_St
ring('Jojn X. Smith') );>> Hashtable_put( settings>> : new_String('MaxAccountSize')>> : new_String('100K') );>>>> .>> .>> .>>>> CLI_createAccount( new_String('john@xxxxxxxxxxx')>> : settings>> : *NULL>> : FALSE );>>>> Hope that makes sense.>> -->> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list>> To post a message email: RPG400-L@xxxxxxxxxxxx>> To subscribe, unsubscribe, or change list options,>> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l>> or email: RPG400-L-request@xxxxxxxxxxxx>> Before posting, please take a moment to review the archives>> at http://archive.midrange.com/rpg400-l.>>>> _________________________________________________________________> Helping your favorite cause is as easy as instant messaging. You IM, we give.> http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join> --> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list> To post a message email: RPG400-L@mid
range.com> To subscribe, unsubscribe, or change list options,> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l> or email: RPG400-L-request@xxxxxxxxxxxx> Before posting, please take a moment to review the archives> at http://archive.midrange.com/rpg400-l.>
_________________________________________________________________
Need to know the score, the latest news, or you need your Hotmail(r)-get your "fix".
http://www.msnmobilefix.com/Default.aspx
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


_________________________________________________________________
Climb to the top of the charts! Play the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan

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.