Why would my play framework say wait for a .sbt lo

2019-03-11 04:10发布

问题:

[Sally] $ run

[info] Updating {file:/Users/MyName/Desktop/sally/todolist/}Sally...
Waiting for lock on /Users/MyName/Documents/play-2.1.3/repository/.sbt.ivy.lock to be available...

Sally is my project's name. I am learning how to use play. Yesterday It was all awesome. Today when I woke up and opened my computer, everything went to hell. I kept seeing this message when I try to run the program.

What is this lock anyway? Should I uninstall/remove the framework and reinstall it?? (Btw how do I do that?)

回答1:

Just remove the .lock file. It is used when resolving dependancies and to avoid conflicts if you launch two Play consoles.



回答2:

Deleting the .lock file also works. But if you don't want to delete the lock file, you can unlock the file from the process which has the lock. If you are on windows, you can use a UI tool called "Unlocker" to do this (go to that file=>right click=>select unlocker).



回答3:

On my windows machine, I managed to solve the above issue by killing the processes that use that lock file.

Use the following official tool from Microsoft to search for the processes that are using the lock file.

https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer



回答4:

I ran the following commands to fix this.

$ ps aux | grep sbt

Get the process ids and kill it.(like below)

$ kill -9 112233 565644

And then run sbt run to start the app.