0

I am new to the Java Play! framework and am using it to develop a RESTful service for a client (who use it on all their machines). I have put version 1.2.3 on to my Windows development machine. play is in the path.

I've succesfully followed the instructions in the "my first play app" tutorial up to the point where it suggests opening a browser to http://localhost:9000/. The browser just sits there indicating "busy".

The interesting thing is, the browser also just sits there when I open this without calling play run first, which makes me wonder if something else is hogging port 9000.

  • How can I find out if something is hogging port 9000?
  • If I can't prevent that, is there a simple way to get Play! to use some other port?
  • If it's not that, what else could it be?
Bhavik Ambani
  • 6,357
  • 14
  • 52
  • 84
Andrew Wyld
  • 6,923
  • 6
  • 49
  • 95
  • 1
    Disable all software firewalls on the machine. – Thorbjørn Ravn Andersen Dec 12 '12 at 17:06
  • Unfortunately that didn't work in this case, but I did read elsewhere that that can cause the same problem. – Andrew Wyld Dec 12 '12 at 17:13
  • 1
    Try http://127.0.0.1 instead of http://localhost – Thorbjørn Ravn Andersen Dec 12 '12 at 17:19
  • @ThorbjørnRavnAndersen bussy port will be bussy, even if you'll use IP instead of address, there is some program which listens on this port, probably some messanger or something like this. – biesior Dec 12 '12 at 17:20
  • It reacts the same way using 127.0.0.1 as lcoalhost. I think something else is using port 9000, though since discovering 9001 works fine I haven't bothered to work out what it is. – Andrew Wyld Dec 12 '12 at 17:24
  • @biesior the symptom described could also be explained by "localhost" having a bad DNS entry combined with packet loss. – Thorbjørn Ravn Andersen Dec 12 '12 at 17:58
  • @ThorbjørnRavnAndersen, ofc you are right, just some time before you wrote, OP added a comment to other answers that port 9001 works (with localhost) so apparently you missed that info. Anyway he finally found a solution. – biesior Dec 12 '12 at 18:01
  • 1
    It's fair to say @biesior found it too but I thought the `netstat -an` information was useful. @ThorbjørnRavnAndersen's info also useful though, I have read elsewhere that firewalls cause problems with this. – Andrew Wyld Dec 12 '12 at 18:26

2 Answers2

2
  1. To check for ports in use on Windows, try netstat -an.
  2. Someone else already answered on how to get Playframework to use a different port, here is that answer: https://stackoverflow.com/a/8206747/463196
Community
  • 1
  • 1
Philip Tenn
  • 5,615
  • 7
  • 42
  • 77
1

The fastest way will be just finding next available port, de facto port 9000 has no special meaning for Play. (also as Thorbjørn wrote in the comment check if there's no some firewall blocking the connections)

Check Configuration reference to see how to change default port, just add this to your conf/application.conf file:

http.port=10123

On te other hand, I'd suggest you move toward current stable version of Play - 2.0.4, currently 1.2.x branch isn't actively developed and it's in 'maintenance state' which means that only important bugfixes will be added to it.

biesior
  • 54,554
  • 10
  • 118
  • 177
  • Changing it to 9001 worked. Thanks! As for changing version, I'm using 1.2.3 because the client is, and I need to know code I write on mine will work on theirs. – Andrew Wyld Dec 12 '12 at 17:10