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



I was tipped off list and it turned out I set the full classpath (i.e.
a classpath containing both my class and JTOpen) the "traditional" way
with putenv, which is completetly irrelevant to JNI. I don't know what
I was thinking there. On the JNI classpath I had only specified the
classpath to my class, not to JTOpen, so naturally they couldn't be
found.

It now works very well.

Thanks for your time and help.

2011/7/27 Erik Olsson <erik.eo.olsson@xxxxxxxxx>:
It means that the method abends and returns to the caller.

I have a couple of things to try out tomorrow, quite mystifying this.

Thanks

On 27 jul 2011, at 19:27, Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx> wrote:

You say "it dies" but what does that mean?

Also, why are you using JNI instead of the RPG *JAVA support?  It seems
like an awful lot of work.

Joe

Hello,

I have a Java method that lists files from a given directory on my
local AS400 and puts them on an FTP server.
This works ok when I call the method from an RPG IV module using the
language's built in support (extproc(*JAVA) etc).

When I call the method via JNI it dies on the first JTOpen statement:

System.out.println(ifsdir); // this input parm is printed ok when
called from both RPG IV and JNI
IFSJavaFile dir = new IFSJavaFile(new AS400("mybox"), ifsdir);
System.out.println("made it here"); // only call from RPG IV makes it here

I've tested supplying user and password too to the AS400 constructor,
same thing.
I have also verified that the input string is ok. I don't know what
CCSID RPG IV is using when it's transforming an EBCDIC string into a
java.lang.String object but on the JNI side I've converted the input
strings to both CCSID 1208 and 819 before calling NewStringUTF() with
the same result.

The classpath is set in the calling program and is the same from both
RPG IV and JNI.

So, are there any special considerations to be aware of when using
JTOpen classes from JNI? Very grateful for suggestions!

Best wishes
Erik

--
This is the Java Programming on and around the IBM i (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.