Can anyone help and tell me why am I facing an error like this??
[ERROR] /home/ccuser/worspace/spring-traveladventuresapi-v2/src/main/java/com/codecademy/plants/controllers/TravelAdventuresController.java:
[40,36] cannot find symbol
[ERROR] symbol: method finbByCountry(java.lang.String)
[ERROR] location: variable adventureRepository of type com.codecademy.plants.repositories.AdventureRepository
And I have the same with findByState() method. Might this be a problem with interface implementation? As far as I know I haven’t change anything in other files than just the TravelAdventureController.java.
I have had many problems with this exercise, but I have done it looking at the superheroes and it is working for me.
I copied all the superhero imports
@GetMapping(“/bycountry/{country}”)
public List getAdventureByCountrycurl (@PathVariable String country){
return adventureRepository.findByCountry(country);
}
///accepts GET request to traveladventures/bystate?state=Lisboa @GetMapping(“/bystate”)
public List getAdventureByState(@PathVariable String state){
return adventureRepository.findByState(state);
}
I finally solved the problem some time ago (with help from the project walkthrough video, I was surprised to find it but yes, there is one!), so now I don’t even remember what was my issue then… though, I believe your answer will help next learners for sure!
Thanks for this!
I c/p and double-checked, but it’s still not working for me. I think there’s a Codecademy bug - one of the files seems to be missing because codecademy’s saying the file AdventureRepository.java has been relocated and it won’t run properly until it’s been redirected.
There must really be a problem on their side!
My code, which worked before and is pretty similar to yours, does not compile any more. I get the same errors related to finbByCountry(java.lang.String) and finbByState(java.lang.String)) form AdventureRepository.java.
And, again, I have the problem with ‘Failed to connect to localhost…’ permanently blocking my curl tests.
Where did you find the information about AdventureRepository.java being relocated - what do you mean by “codecademy’s saying…”?
It was a error notice Codecademy.com gave me. I didn’t know if it was for us the students or the developers @ Codecademy so I ignored it. It seems they moved that file somewhere else and forgot to update the path ^^