flori
flori

Reputation: 448

Play Framework (Java): Debugging 'cannot find symbol: (routes file : line number not found)' error

I have a big application with a lot of classes and a big route file. After adding the new route, it stopped working and gives me the following error:

Compilation error

error: cannot find symbol

In /home/path..../routes (line number not found)

Upvotes: 0

Views: 2053

Answers (3)

o-0
o-0

Reputation: 1789

Here I assume that your route definition is correct: pointing to a correct controller with the right signature.

Recompile: So in play you need to do a clean compile whenever you touch the route file:

sbt clean compile

This will regenerate the files related to the route file and the error will go away.

Upvotes: 1

Arjunlal
Arjunlal

Reputation: 154

Errors with routes can usually be resolved by cleaning and rebuilding. Use activator clean or play clean to clean the project. If that does not solve the issue, re-check the routes file. Errors in routes file can make it hard for play to figure out reverse routing related imports.

Upvotes: 0

Indigenuity
Indigenuity

Reputation: 9740

As mentioned in the comments, activator clean is the best solution for this. Just got this same problem today, and it seems that something just got corrupted in the build path until I cleaned and restarted activator.

You can get the Clean function on an activator project from the UI by click the ... button in the Build tab.

Upvotes: 0

Related Questions