When I compiled Java EE with JBoss, some configuration file said:
jboss Cannot find class file for javax/servlet/ServletContext
So, I added the dependency in my pom:
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
<artifactId>jboss-servlet-api_3.0_spec</artifactId>
<version>1.0.2.Final</version>
</dependency>
But, it does not have any effect. It still could not find the javax.serlet.ServletContext package in my pom dependency.
Only when I added the “spec pack” in my including path, it works.
I use Eclipse, anyone know why this happened?
You’re missing
javaee-web-apidependency: