Java overloaded method in library fails when not run in web server
问题 I am trying to write a small library that can either be used in a standard java app or as part of a servlet. I have defined a couple of overloaded methods as follows: // imports etc. public ExampleLibrary { /** * This one is meant to be used by a J2SE app */ public String processData(Map headers) throws MyException { // process // return result } /** * This one is meant to be used by a servlet */ public String processData(HttpServletRequest request) throws MyException { // extract headers