Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala with spark - "javax.servlet.ServletRegistration"'s signer information does not match signer information of other classes in the same package

I have simple scala application with spark dependencies. I am just trying to create spark context using the follwing code.

 def main(args: Array[String]) {
    var sparkConfig : SparkConf  = new SparkConf() ;
    sparkConfig.setAppName("ProxySQL").setMaster("local");
    var sc = new SparkContext(sparkConfig) 

     }

When i try to run this code inside main - it throws security execption at new SparkContext(sparkConfig) with the following message .

Exception in thread "main" java.lang.SecurityException: class "javax.servlet.ServletRegistration"'s signer information does not match signer information of other classes in the same package .

At problem tab of Eclipse, it shows one warning Description Path Resource Location Type

More than one scala library found in the build path (D:/workspaces/scala/scalaEclipse/eclipse/plugins/org.scala-ide.scala210.jars_4.0.0.201503031935/target/jars/scala-library.jar, C:/Users/prems.bist/.m2/repository/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar).This is not an optimal configuration, try to limit to one Scala library in the build path.     SQLWrapper  Unknown Scala Classpath Problem

I have scala installation of 2.10.4 at windows machine. Scala compiler version set at eclipse is 2.10.5 . What is causing this security exception? Is this the incompatiblity version issues or what exaclty else? How would i solve it?

like image 295
Prem Singh Bist Avatar asked Dec 11 '22 23:12

Prem Singh Bist


2 Answers

The problem was more or less related with conflicting dependencies.

The following task resolve my issue.

Go to Project

Build Path -> Order and Export tab -> Change the order of javax.servlet jar either to bottom or top.

This Resolved the problem.

like image 77
Prem Singh Bist Avatar answered Apr 27 '23 17:04

Prem Singh Bist


Well,as I follow the suggestion:Go to Project Build Path -> Order and Export tab -> Change the order of javax.servlet jar either to bottom or top.

I find my buidpath libiaries was changed and it seems mussy(too many small libs),maybe this was caused by maven.

So I try to remove all of them and reimport the libs and chose Project -> Maven ->Update Project !

Now ,it goes well.

enter image description here

like image 36
Matiji66 Avatar answered Apr 27 '23 16:04

Matiji66