When building an OSGI bundle with tycho, the compiler-plugin throws the following error:
...AnswerServlet.java:[307] resp.setCharacterEncoding("UTF-8") ^^^^^^^^^^^^^^^^^^^^^^^^The method setCharacterEncoding(String) is undefined for the type HTTPServletResponse
As you can see, the Class HTTPServletResponse
can be resolved from the build path (the package javax.servlet
) successfully, but the Class seems not to have the function setCharacterEncoding(...)
.
Invesitgations showed, that this method is only included of javax.servlet
2.4+.
However, i am using version 3. There is no other version of this library on my entire file system...so how is that possible?
Building in a standalone java file against this lib/Class/function also works well. Only the tycho compiler plugins fails.
Moreover, i activated the debug-log where the compiler-plugin lists all the build-path. The only entry about javax.servlet
was corret.
~\.m2\repository\p2\osgi\bundle\javax.servlet\3.0.0.v201112011016\javax.servlet-3.0.0.v201112011016.jar[+javax/servlet/*;+javax/servlet/http/*;+javax/servlet/annotation/*;+javax/servlet/descriptor/*;+javax/servlet/resources/*;?**/*]
Moreover, there were no other relations to any other javax.servlet
things.