I’ve recently started to write some unit tests for a Spark Streaming application and even the simplest scenario led to the following error:
class “javax.servlet.FilterRegistration”‘s signer information does not match signer information of other classes in the same package
This happened when Maven ran the test, in other words, it was a run-time error. An Internet search indicated that I should be suspicious about different versions of javax.servlet. The following commands showed that I was on the right track:
mvn dependency:tree
mvn dependency:tree | grep servlet
Modifying the pom.xml for excluding javax.servlet as follows solved the problem:
<dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>2.4.0</version> <scope>provided</scope> <exclusions> <exclusion> <groupId>javax.servlet</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency>
I hope things will be less conflicting in the upcoming Hadoop and Spark versions.
About the author: Emre is the co-founder & CTO of TM Data ICT Solutions in Belgium. You can read more about him in About page of this blog.