Hello, I have a simple application to read from a file and carry out
operations on it. However, when deployed to appspot, it keeps reading
the file as null and doesn't execute. gr17.tsp is a text file
containing a travelingsalesman problem.

It works fine on localhost so i really don't see what's the problem
here. Really appreciate any help, thanks. The application is at
http://helloworldureca.appspot.com/

import java.io.*;
@SuppressWarnings("serial")
public class TSP_gr17Servlet extends HttpServlet {
        public void doGet(HttpServletRequest req, HttpServletResponse resp)
                        throws ServletException, IOException {
                Matrix m1 = new Matrix();

                resp.setContentType("text/plain");
                PrintWriter writer = resp.getWriter();
                String filename = "web-inf/gr17.tsp";
                ServletContext context = getServletContext();

                // First get the file InputStream using
ServletContext.getResourceAsStream() method.
                InputStream is = context.getResourceAsStream(filename);

                if (is != null) {
                        m1.readMatrix(is);
                                m1.displayMatrix(writer);
                                m1.insertionCal(writer);
                                writer.println("reached");
                      }

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.


Reply via email to