ogroendal
ogroendal

Reputation: 353

Play framework does not automatically reload on changes when running on virtual machine

The problem

I am using the Play Framework, and I am doing so on a virtual machine. However Play does not recompile on changes in dev mode.

I have tried using run and ~run in the activator console.

When I do ~run it correctly recompiles the changed file as soon as I hit save in my editor. But when I refresh my browser, it does not show the changes. Forexample, I might edit a scala template, but the text remains the same when I refresh the browser. If I do Ctrl+D after it recompiles my change, it will recompile a few classes and then reload the page, and show the change correctly.

When I do run it does not compile changes at all when I hit refresh in the browser after altering the code, only when doing Ctrl+D

My setup

I am running of a VirtualBox virtual machine configured with Vagrant. I run the code off a shared folder between the host machine and the VM, so that the user can use his preferred IDE on the host machine. I run the database and Play on the VM. I forward port 8001 on the host machine to port 9000 on the VM, and I can correctly use and interact with my app this way. The only thing that does not work is automatic reload.

When I run the code off a Play installation on the host machine, auto-reload compiles and display all changes correctly. I only have the problem when running Play on the VM. I have tried running the same VM setup on several Linux and Windows host machines, and they all display this same problem.

Caching is enabled on this Play project.

Am I doing something wrong?

Upvotes: 4

Views: 568

Answers (0)

Related Questions