RSS

How to fix class “javax.servlet.FilterRegistration”‘s signer information does not match signer information of other classes in the same package (when unit testing with Spark Streaming)

04 Dec

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.

 
Leave a comment

Posted by on December 4, 2014 in Programlama

 

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: