melt
melt copied to clipboard
Resolve Servlet Dependency Clash in Docker Containers
Describe the bug
Error message:
java.lang.NoSuchMethodError: javax.servlet.ServletContext.createServlet(Ljava/lang/Class;)Ljavax/servlet/Servlet
The existence of two servlet-api
dependencies in the docker container may lead to a problem on some machines.
[INFO] +- com.github.dwslab.melt:receiver-http:jar:master-SNAPSHOT:compile
[INFO] | +- org.eclipse.jetty:jetty-servlet:jar:9.4.34.v20201102:compile
[INFO] | | \- org.eclipse.jetty:jetty-security:jar:9.4.34.v20201102:compile
[INFO] | | \- org.eclipse.jetty:jetty-server:jar:9.4.34.v20201102:compile
[INFO] | | \- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] | \- org.eclipse.jetty:jetty-servlets:jar:9.4.34.v20201102:compile
[INFO] \- com.github.dwslab.melt:matching-eval:jar:master-SNAPSHOT:test
[INFO] \- com.github.dwslab.melt:matching-jena-matchers:jar:master-SNAPSHOT:test
[INFO] \- org.gradoop.famer:famer-clustering:jar:0.1.0-SNAPSHOT:test
[INFO] \- org.gradoop:gradoop-flink:jar:0.6.0:test
[INFO] \- org.apache.flink:flink-shaded-hadoop-2:jar:2.6.5-9.0:test
[INFO] \- javax.servlet:servlet-api:jar:2.5:test
To Reproduce There is no known way to reproduce this error since affected containers work on some machines (and do not work on others). For now we could not identify the reason.
Expected behavior No exception.
Interim Solution https://dwslab.github.io/melt/faq#evaluation-of-a-docker-based-matcher-javalangnosuchmethoderror-javaxservletservletcontextcreateservlet