Reputation: 3753
I am playing with a tutorial and have the following:
*maven project
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
*Docker Wildfly 10
FROM jboss/wildfly:10.1.0.Final
*Java Code
@WebFilter(urlPatterns = "/*")
public class TokenFilter extends HttpFilter {...}
*And of course the error :)
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpFilter from [Module "deployment.api.war:main" from Service Module Loader]
Maven marks Java 8 as provided, wildfly should have it. I am pretty sure I am missing a dependency in maven, but not sure which one. The other bits of this software are working just fine (REST bits)
Any hints?
Upvotes: 2
Views: 290
Reputation: 7938
I think the problem is, your wildfly version is older than the java-ee version you specified as provided. (java-ee 8 is released 1 year later than your wildfly version. And HttpFilter class is available since this version)
If you remove the provided it should work(unless some dependency inconsistencies happens. If that the case you have to upgrade wildfly version)
https://www.oracle.com/corporate/pressrelease/java-se-9-and-ee-8-092117.html
Upvotes: 2