tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trojansnake12 <>
Subject Debian Tomcat Fail
Date Wed, 27 May 2009 02:22:47 GMT

I am about at my wits' end here with Tomcat on Debian.  I have an app called, and all it should do is grab a file from the file system, and
output that on the browser window.  On my windows box, this works perfectly. 
I'm using jdk6 on the windows box, and gcj4.3 on the debian box.  My other
apps work fine, none of them working with ImageIO.  I will post the code for
the servlet below here.

The BOLDED line below is the one that, if uncommented, totally breaks my
server.  Like, if I travel to the URL, I get a server connection error, and
my entire Tomcat server shuts down.  If I leave out the ImageIO write line,
the application obviously doesn't do anything, but it does provide me a nice
blank browser window without crashing my entire server.  Why the hell is
this happening?

import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.lang.*;
import java.awt.*;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;

public class Project extends HttpServlet {
	public void doGet(HttpServletRequest request,HttpServletResponse response)
throws IOException, ServletException {

//		PrintWriter out = response.getWriter();

		try {

			File myGifFile = new File("../webapps/geosim/WEB-INF/images/test.jpg");
			BufferedImage bufi =;


			file = new File("../webapps/examples/servlets/images/android_new.jpg");
			fis = new FileInputStream(file);

			raw = new byte[(int)file.length() + 1];;
			for(int i = 0; i<(int) file.length(); i++) {

			String imageData = new sun.misc.BASE64Encoder().encode(raw);

			xml += imageData.length();
			xml += "</imageSize><imageData>";

			xml += imageData + "</imageData></image></status>";
//			out.println(raw);
//			os.write(raw, 0, len);
		catch(Exception e) {
//			response.getOutputStream().println("error: " + e.getMessage());
//			os.writeBytes("error: " + e.getMessage());

View this message in context:
Sent from the Tomcat - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message