Jayson Chelliah

Greenhorn
+ Follow
since Jul 26, 2011
Jayson likes ...
Eclipse IDE Tomcat Server Java
Merit badge: grant badges
For More
Malaysia
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jayson Chelliah

Hi Ranchers,

There's a code written by an ex-colleague of mine which reads BLOBs from DB and display them as jpg in a Word document. 99% of the images work fine. However, there were two images which threw the following exception :

java.lang.IllegalArgumentException: Numbers of source Raster bands and source color space components do not match
at java.awt.image.ColorConvertOp.filter(ColorConvertOp.java:460)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.acceptPixels(JPEGImageReader.java:1102)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1070)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:885)
at javax.imageio.ImageIO.read(ImageIO.java:1422)
at javax.imageio.ImageIO.read(ImageIO.java:1326)


The code is actually calling the read() method of javax.imageio.ImageIO by passing the InputStream object obtained from the Blob. The API specification of this method says:

Returns a BufferedImage as the result of decoding a supplied InputStream with an ImageReader chosen automatically from among those currently registered. The InputStream is wrapped in an ImageInputStream. If no registered ImageReader claims to be able to read the resulting stream, null is returned.

and

Throws : IllegalArgumentException - if input is null.

Based on the API documentation, I just want opinions from you guys whether the issue here is :

1. Original image is corrupted
2. InputStream object is null
3. No ImageReader is able to read the InputStream passed.


Thanks!

12 years ago
Thanks Volker. I will decide whether to proceed the changes.
12 years ago
Greetings,

In Tomcat's server.xml file, there's a Engine tag with attribute jvmRoute, like this :
<Engine name="Catalina" defaultHost="svr-myapp1" jvmRoute="server1">

Based on my research, I know this attribute is used in conjunction with the Apache load balancer. In the project which I currently working on, load balancing of two Tomcat servers is done by F5 Network, and it doesn't use the jvmRoute attribute. My question is, is it safe to just add this attribute in the server.xml, or will this have consequences?

The reason is need the jvmRoute attribute is because I'm need to store all session IDs created by the container in the DB. With jvmRoute, I can differentiate the session ID whether they were created by server1 or server2. Attribute jvmRoute will append the string specified in every session IDs created, for e.g D3743GDUI38484.server1. I would also appreciate any other suggestion to make server indicator appear with the session ID. Thanks.

Jason
12 years ago
Thanks for the detailed answer Ivan !
12 years ago
Oh so Sun exams can longer be enrolled via Prometric? I thought they were having issue with their website.
Hi all,

I have a web app, which is already deployed and running on tomcat. I need to create a web service, which will receive three parameters, and update two tables in the db. Can i create the service class within the same application and publish it as web service, or should i create brand new web application for this purpose alone?

Thanks.
12 years ago