tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mantri, Mr Ramesh" <man...@nrlmry.navy.mil>
Subject RE: tomcat apparently shutting down by itself
Date Thu, 06 Jul 2000 03:13:57 GMT
Dear all,
   (First off, thank you, Aleksey)
When started from sh, tomcat didn't die away. This should perhaps
be included in tomcat FAQ.

We still have a major problem - that with images. When we try to
send an image file from servlet to applet, for some reason it is
throwing a FileNotFoundException. Do we need to configure images
separately in tomcat? The documentation doesn't say so. In any
case I am appending below a few lines of code. Please take a look
at it and try to identify the source of the problem.

Applet:
=======
public class testImage extends JApplet {
   public void init() {
      try {
         URL url = new URL("http://host:port/WEBAPP/servlet/testImage");
         URLConnection con = url.openConnection();
         con.setUseCaches(false);
         ObjectInputStream objStr = new
ObjectInputStream(con.getInputStream());
         ImageIcon img = (ImageIcon) objStr.readObject();
         Container cp = getContentPane();
         JLabel lbl = new JLabel(img);
         contentPane.add(lbl);
      } catch (Exception e) {
         e.printStackTrace();
      }
   }
}

Servlet
=======
public class testImage extends HttpServlet {
   public void doGet(HttpServletRequest req, HttpServletResponse res)
   throws ServletException, IOException {
      URL url = new URL("http://host:port/WEBAPP/images/someImage.gif");
      ImageIcon img = new ImageIcon(url);
      ObjectOutputStream out = new
ObjectoutputStream(res.getOutputStream());
      out.writeObject(img);
   }
}

Exception Stack Trace
=====================
java.io.FileNotFoundException: http://host:port/WEBAPP/servlet/testImage
..........................
at java.io.IOException.<init>(Compiled Code)
at java.io.FileNotFoundException.<init>(Compiled Code)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Compiled Code)
.............

Also, allow me to add that another test applet and servlet which pass only
String data are working fine. That causes us to suspect that it could be a 
problem caused due to the transmission of image data from servlet to applet.

sincerely,
Ramesh Mantri


-----Original Message-----
From: Aleksey Tsalolikhin [mailto:atsaloli@earthlink.net]
Sent: Wednesday, July 05, 2000 5:18 PM
To: mantri@nrlmry.navy.mil
Subject: Re: tomcat apparently shutting down by itself


Dear Sir,

	What shell are you starting tomcat from?

	If not sh, try starting tomcat from sh.

	I've seen it before where a daemon is started from another
shell (like tcsh) and then it dies, when the xterm is closed.

Hope this helps,
Aleksey Tsalolikhin


Mime
View raw message