• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java: getRecipesByID and getRecipesByServingSize producing a fatal ambiguity error

 
Shakur Burton
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Even though this snippet of code successfully compiles in CMD, I keep getting this error when I try to get it to work on Tomcat 8:



Just what exactly am I doing wrong here? I'm having a hard time trying to find what to modify to get rid of this annoying error...
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36026
430
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even thought it says SqlException, I don't think the code is getting that far. You can test that theory by using this simplified program instead. it should fail. Now look at URL. Which of the two methods do you expect it to call? Why? Frommy point of view, both look the same. /recipes/5 would match both so Java doesn't know which to call.


 
The knights of nee want a shrubbery. And a tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!