× 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 am clutching at straws here but will it let you do an OPTIONS(*VARSIZE)
after that 3i 0 dim(4096) ?

Failing that can you go into QSH and run

javap -s classname -classpath classlocation

and see what comes back for the toByteArray method and compare it to your
error message.

Regards

Neill


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Marvin Radding
Sent: 29 October 2010 21:05
To: rpg400-l@xxxxxxxxxxxx
Subject: Still having problems with *JAVA definition

Thanks to Barbara and Scott for their help so far.

Sorry to say, I am still having problems with the definition of
toByteArray.

My definition is for the FileInputStream is :

d new_FileInputStreamString...
d pr like(InputStream)
d extproc(*JAVA
d :'java.io.FileInputStream'
d :*CONSTRUCTOR)
d xFilePath...
d like(jstring)

d InputStream s o class(*JAVA
d :'java.io.FileInputStream')


And the definition for toByteArray is:


D toByteArray...
D pr 3i 0 dim(4096)
D static
D extproc(*java
D :'org.apache.poi.util.IOUtils'
D :'toByteArray')
d xFileInputStream...
d like(inputstream)

d picarray s 3i 0 dim(4096)

The path to the image file is defined as

D logoimage s like(jstring)


And the code I execute for this is:

c eval logoimage = new_String('/mr0473/logo.jpg')

c eval InputStream =
c new_FileInputStreamString(logoimage)

c eval picarray = toByteArray(InputStream)

The first 2 statements have no problem. But I get this error when the
last statement executes:

Message . . . . : Java exception received when calling Java method.

Cause . . . . . : RPG procedure SETUP_ANP_ in program XXXXXX/XXXXXXX

received Java exception "java.lang.NoSuchMethodError: toByteArray"
when
calling method "toByteArray" with signature
"(Ljava.io.FileInputStream;)[B"
in class "org.apache.poi.util.IOUtils".


I can't figure out what is wrong with the definition. Can anyone help?

Marvin

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.