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



Jon,

Do you mean then it IS possible to use a *srvpgm binded to a
java-project?  I mean, we have no problem to make java-call's, run
java-methods etc... from within ILE-RPG.  Now we wanted to do the other
way.

We created an rpg-project from which we have seperated the dspf (VIEW)
and the recordprocessing (CONTROLLER).  Then we created a java-project
which would have it's own view but uses the ILE-modules.  But it seems
that linking these modules to the java-project isn't possible.  Of
course we can use the "Distributed Program Call" which is provided with
the JT400 toolbox but then we call simple RPG-programs which returns
data in it's params or a dataque.  What we want is to use the data
inside the modules as if it is real-java processing.  When we compile
our Java part on iSeries, we get not errors and can run part of the
java-classes until processing for the Java-GUI starts... obvious, output
is then sent to 5250emulator (CA400) which can't handle GUI.  Compiling
in WDSc4 fails because java tries to link to a 'PC-file'
(myProgram.dll)...

It seems that RPG can call/use java on iSeries without any problem
(beside the rather difficult prototyping) but that we cannot use ILE-RPG
modules from within java running on PC's

Statement which fails:
static
{
    System.loadLibrary("PROGRAMNAME");
}

which returns following error when testing class:
java.lang.UnsatisfiedLinkError: no PROGRAMNAME (PROGRAMNAME.dll) in
java.library.path at
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1380)
at java.lang.Runtime.loadLibrary0(Runtime.java:766)
at java.lang.System.loadLibrary(System.java:849)
at Agents.AgentsController.<clinit>(AgentsController.java:35)
Exception in thread "main"


Patrick Goovaerts
pgoovaerts@pandora.be
TEL: 0032-3-6472715
GSM:0498610325



-----Oorspronkelijk bericht-----
Van: java400-l-admin@midrange.com [mailto:java400-l-admin@midrange.com]
Namens Jon Paris
Verzonden: zaterdag 7 december 2002 19:32
Aan: java400-l@midrange.com
Onderwerp: java to rpg problem


 >> On the iSeries it would attempt to load a *PGM or *SRVPGM. However,
even then the program would have to be written to the JNI standard,
which means C.  You could write JNI "wrappers" in C that in turn call
your RPG.

The phrase "which means C" is not correct as of V5R1 (in fact it was not
correct as of V4R5 but it was just plain ugly to do).  To make an RPG
subprocedure meet the JNI standard simply requires adding the keyword
information EXTPROC(*Java : 'ClassName' : 'MethodName' ) on the
prototype. Works beautifully and the compiler does all the work for you!
*PGM is not an option though as far as I know - it has to be a service
program.

If you wish the same subproc to be callable from RPG then  you simply
write a wrapper that use uses the above keywords around the "standard"
RPG version.

Couldn't get much easier and no nasty C to worry about!

Jon Paris
Partner400

_______________________________________________
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l
or email: JAVA400-L-request@midrange.com
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.