Unable To Encode Buffered Image

Recommended Posts

Hello to everybody!

this is my first post so maybe I will introduce myself: my name is Peter, I come from Poland, one year ago I finished my IT studies and now I am a programmer in small company which makes software for airlines industry. I have been developing statistics program for 2 months using FusionCharts and I am facing now with tough problem but lets get to point.


My dev environment: java 6, tomcat apache 6, fusioncharts v3.2.1, local machine win7 an destination test server running on linux

I implemented chart exporting as described in fusion doc with Server Side exporting and it works on my local machine with windows 7 - exporting PDF, images works correctly

But images exporting doesn't work on linux server (PDF works) and I can't find solution for this. Error is:

statusMessage= Unable to encode buffered image.


I read this topic , , tried solutions at and others but nothing.


Overall I read that it should work just with -DJava.awt.headless=true parameter but it doesn't. Maybe I've missed something. Does anybody know a solution to this?


thanks in advance, regards


Share this post

Link to post
Share on other sites

Set -Djava.awt.headless=true did not help in my case. I had to modify the Java code to make it work. Two key changes:


1: do not use Graphics object in

2: do not use BasicEncoder.encode(BufferedImage bufferedImage, OutputStream outputStream,

float quality, String format) method, use ImageIO.write(bufferedImage, format, outputStream) instead

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now