Discussion:
VerifyError with JPEGCodec.createJPEGEncoder(OutputStream)
(too old to reply)
freetodd
2006-08-09 18:54:30 UTC
Permalink
I am trying to add Captcha images to our check out process in our
WebSphere commerce environment. I downloaded two different Captcha
applications and integrated them into our commerce environment.
Everything works fine when testing locally on my PC but when I deploy
the code to our development iSeries server, that is when the problems
start. Regardless of what Captcha application I use I get a
java.lang.VerifyError on this line of code:

JPEGImageEncoder jpegEncoder =
JPEGCodec.createJPEGEncoder(jpegOutputStream);

These classes come from the com.sun.image.codec.jpeg package. I tried
using a FileOutputStream and ByteArrayOutputStream and get the same
error. According to the API for VerifyError it is Thrown when the
"verifier" detects that a class file, though well formed, contains some
sort of internal inconsistency or security problem. I am new to the
iSeries world and can only guess this has to do with permissions or
security that the iSeries has and a Windows environment doesn't.
walker.l2
2006-08-11 09:01:45 UTC
Permalink
I imagine this will be a 'headless mode' issue of some sort. A Windows
JVM is able to interact with a GUI (and thus AWT, Swing, etc.), an
iSeries has no GUI for the JVM to interact with. I suspect that the
com.sun.* package interacts with GUI classes internally, and these are
not available on the iSeries. Image manipulation without a GUI is dealt
with by headless mode and RAWT or NAWT on the iSeries. Have a look at
the InfoCenter for the relevant OS/400 version for more details on
these.
You should be able to do what you are trying to do, but you will
probably have to do it differently (maybe by using classes other than
those in com.sun.*).
freetodd
2006-08-14 13:52:36 UTC
Permalink
Post by walker.l2
I imagine this will be a 'headless mode' issue of some sort. A Windows
JVM is able to interact with a GUI (and thus AWT, Swing, etc.), an
iSeries has no GUI for the JVM to interact with. I suspect that the
com.sun.* package interacts with GUI classes internally, and these are
not available on the iSeries. Image manipulation without a GUI is dealt
with by headless mode and RAWT or NAWT on the iSeries. Have a look at
the InfoCenter for the relevant OS/400 version for more details on
these.
You should be able to do what you are trying to do, but you will
probably have to do it differently (maybe by using classes other than
those in com.sun.*).
The 'headless' mode was part of an earlier problem but this one deals
with the class from Sun. They did not come in a jar file, they were
downloaded as Java files. Since they were not in a jar file I added
them to a common jar file I created and that is what caused the
VerifyError. The iSeries didn't like them being in the common jar file
so I pulled them out and packaged them in their own jar file and
everything is running fine.

Loading...