i have this applet that communicates with a servlet.. when the applet connects to the servlet, i get the Server returned HTTP response code: 500 error.. when i am testing in my own pc, everything is fine.. when i tried deploying it in a server, the error occurs.. i do not have any idea what is wrong..
i get the error in this line in my applet:
inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
this is the method that conatins the line above:
protected String myMethod(String fileName) {
String doc = null;
ObjectInputStream inputFromServlet = null;
try {
URL loadMapServlet = new URL(this.getCodeBase(), "loadMap?action=load&fileName=" + this.getCodeBase().toString() + fileName);
URLConnection servletConnection = loadMapServlet.openConnection();
inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
doc = (String)inputFromServlet.readObject();
inputFromServlet.close();
}
catch (Exception e) {
e.printStackTrace();
}
return doc;
}
here is the stack trace
java.io.IOException: Server returned HTTP response code: 500 for URL: http://mental_boi.s46.eatj.com/CityNavigator/loadMap?action=load&fileName=http://mental_boi.s46.eatj.com/CityNavigator/mapSpain.svg
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at edu.citynavigator.map.editor.MapEditor.loadMap(MapEditor.java:685)
at edu.citynavigator.map.editor.MapEditor.init(MapEditor.java:130)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at java.io.StringReader.<init>(Unknown Source)
at edu.citynavigator.map.editor.MapEditor.stringToSVG(MapEditor.java:703)
at edu.citynavigator.map.editor.MapEditor.init(MapEditor.java:131)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
another question.. is it required to sign the applet when doing an applet servlet communication? if yes, is there a free, easy way of doing this?