Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Can't listen on port 80

Options
  • 31-03-2005 11:19am
    #1
    Registered Users Posts: 976 ✭✭✭


    Hello all,
    I'm doing my final year project in NUIG.
    For my project a J2ME mobile phone application is trying to contact a server program running on the collage LAN. It was working well of the Wireless Toolkit Emulator. The server program is listening on port 80( HTTP Port)
    I wnat to be able to contact the server program from an actual mobile phone so I got computer services to open the port (remove firewall for this port)
    As a result, the server program will no longer listen on port 80 I am getting the error:

    Accept Failed:java.lang.NullPointerException
    Error 1java.lang.NullPointerException

    It dosn't seem to be able to open an input stream now that the port is open allowing external devices such as mobile phones to contact the server computer on port 80.
    The line of code giving the error is:

    in = new DataInputStream(new BufferedInputStream(s.getInputStream()));

    The line is trying to open and input stream on server socket s.

    I'd appriciate it if anyone has any idea of what the problem is or if anyone has any advice
    Thanks
    Glenman


Comments

  • Registered Users Posts: 7,498 ✭✭✭BrokenArrows


    that seem strange. are you sure that it was just the opening of the port that caused this problem. How do you know that it was working before if that port was previously locked.

    is it possible that you could try this program outside the college. ie on a home computer which does not have any firewall restrictions.


  • Registered Users Posts: 2,426 ✭✭✭ressem


    Lots of possibilities.

    server/network setup
    So your computer now has an external ip address and port.
    Has the computer running your java web service been placed in a network dmz?
    i.e. check that the server can still access the college intranet etc.

    Can you manually telnet from your development computer (Emulator machine) to the internal address / to the external address and get a connection?

    Code
    Might help your debugging to split that code into it's component parts, and confirm that you're catching I/O exceptions, though at a guess, it's more than likely the socket getinputstream that's throwing the exception.

    --edit ignore following. You're having errors on lan connection---
    Phone setup
    You're using GPRS, dialup internet, IR, bluetooth on the phone for network access? Assuming GPRS, you can connect to the uni's web site using the phone's browser?


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    Is it possible that something else is using port 80, maybe a seperate webserver ?


  • Registered Users Posts: 976 ✭✭✭Glenman


    Thanks for all the tips. Yes stevenmu was right I also have an apache Web Server running on the computer, that is why my server program could not listen on port 80. Once I stopped Apache, it work ok. I should have copped onto that before, ah well.
    Thanks again


Advertisement