1
votes

I'm having a problem with play framework: when I compile after modifying a single file and run it, it often runs the old compiled code. Seems to be using something like an internal cache.

system: play 2.2.1 built with Scala 2.10.2 (running Java 1.7.0_25)

issue: After recompiling the project and refreshing browser's view it is often still executed the previous code.

fix: clean compile will fix it, by the way it's quite time consuming.

Thank you, Pietro

1
Are you running it in play run mode? - Jatin
no, I usually do some new work and then I stop the server, type "compile", "run" and then I push F5 in the browser. - pietro909
of course, with "~run" it works - pietro909
Then what is the question? - Jatin

1 Answers

2
votes

Well this is because you are not running it in development mode i.e. play run.

In this mode, the server will be launched with the auto-reload feature enabled, meaning that for each request Play will check your project and recompile required sources. If needed the application will restart automatically.