How can I change the default port used by the play framework in development mode when issueing the "run" command on the play console.
This is for playframework 2.0 beta.
Using the http.port configuration parameter either on the command line or in the application.conf seems to have no effect:
C:\dev\prototype\activiti-preso>play run --http.port=8080
[info] Loading project definition from C:\dev\prototype\activiti-preso\project
[info] Set current project to activiti-preso (in build file:/C:/dev/prototype/activiti-preso/)
Windows, really? Ok, disabling colors.
--- (Running the application from SBT, auto-reloading is enabled) ---
[error] org.jboss.netty.channel.ChannelException: Failed to bind to: 0.0.0.0/0.0.0.0:9000
[error] Use 'last' for the full log.
I did this.
sudo
is necessary.EDIT: I had problems because of using
sudo
so take care. Finally I cleaned up the project and I haven't used that trick anymore.Play 2.0-RC4
It is important to include quotes around the play command you want to run. In my case without the quotes play would still run on port 9000.
Alternatively you could run the following from the play console (type 'play' to get to the console)
Play 2.2.0 on Windows
Using a zip distribution (produced using the "dist" command), the only way I was able to change the startup port was by first setting JAVA_OPTS and then launching the application.
E.g., from the command line
where myapp.bat is the batch file created by the "dist" command.
The following would always ignore my http.port parameter and attempt to start on the default port, 9000
However, I've noticed that this works fine on Linux/OSX, starting up on the requested port:
We cannot change the application port from the avtivator but can change from the command line activator "~run 8080"
But to run on the poet 9000 from the activator we need to stop the application which is using this port. We can use the this application to find this and end the process https://technet.microsoft.com/en-in/sysinternals/bb897437.aspx
After this we can run and it will be successful.
From the play console, you just need to type run 8888, if you want to run it from port 8888.
On Windows maybe the play "run 9001" will not work. You have to change the play.bat file. See Ticket