Results 1 to 10 of 10
  1. #1
    hardc0d3r is offline Member
    Join Date
    Jul 2007
    Posts
    3
    Rep Power
    0

    Default Server returned HTTP response code: 500.. i need help

    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:
    Java Code:
    inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
    this is the method that conatins the line above:

    Java Code:
        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 Code:
    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?
    Last edited by hardc0d3r; 07-12-2007 at 02:52 PM.

  2. #2
    simon is offline Member
    Join Date
    Jul 2007
    Posts
    44
    Rep Power
    0

  3. #3
    hardc0d3r is offline Member
    Join Date
    Jul 2007
    Posts
    3
    Rep Power
    0

    Default

    there is no workaround? is there any other way to pass a serialized string?

  4. #4
    boy22 is offline Member
    Join Date
    Jul 2007
    Posts
    36
    Rep Power
    0

    Default

    if you use IE go to
    Tools-- Internet options -- Advanced -- Show Friendly HTTP messages checkbox is unchecked. If the checkbox is checked, IE shows generic error page instead of actual error page returned by server.

  5. #5
    sathish_2111 is offline Member
    Join Date
    Jul 2007
    Posts
    17
    Rep Power
    0

    Default

    Error code 500 means - Internal server error....

    I think your server has some problem. Make sure the URL to which you are accessing is running properly in the server ...

  6. #6
    Join Date
    Jan 2010
    Posts
    1
    Rep Power
    0

    Default http 500 code

    Make sure that your web service use the xmlrpc reference this error occurred when the client & server are belong to different platform.

  7. #7
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Who wrote the code MapEditor.java ?
    There is a Nullpointer at line 703.
    Either debug and fix or consult the documentation to see what conditions cause that line to throw the N.P.E.

  8. #8
    pink123 is offline Member
    Join Date
    Feb 2011
    Posts
    84
    Rep Power
    0

    Default Re: Server returned HTTP response code: 500.. i need help

    Hi,

    I am geting the same error ,can you tell me how you resolved it.

    Thanks,

  9. #9
    Join Date
    Nov 2011
    Location
    Lima, Perú
    Posts
    2
    Rep Power
    0

    Default Re: Server returned HTTP response code: 500.. i need help

    What you have to do is implement the serializable interface in the class that will be sent.

    implements Serializable

    It worked for me!

  10. #10
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,196
    Rep Power
    19

    Default Re: Server returned HTTP response code: 500.. i need help

    rolandopalermo, stop posting to old long dead threads. That doesn't help anyone.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. java code for send sms through http
    By for108 in forum Java Servlet
    Replies: 11
    Last Post: 09-24-2009, 10:22 AM
  2. java.io.Exception: Server returned HTTP response code: 403
    By navishkumarb in forum Advanced Java
    Replies: 1
    Last Post: 01-05-2008, 01:33 PM
  3. response.sendRedirect(url)
    By mutuah in forum Advanced Java
    Replies: 2
    Last Post: 08-07-2007, 01:56 PM
  4. Velocity / XML response
    By sabatier in forum XML
    Replies: 0
    Last Post: 07-24-2007, 01:13 PM
  5. Server returned HTTP response code: 500
    By Heather in forum Java Servlet
    Replies: 1
    Last Post: 07-09-2007, 04:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •