sql - Scala with spark - "javax.servlet.ServletRegistration"的签名者信息与同一包中其他类的签名者信息不匹配

标签 sql scala apache-spark

我有一个带有 spark 依赖项的简单 Scala 应用程序。我只是想使用以下代码创建 Spark 上下文。

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

     }

当我尝试在 main 中运行此代码时 - 它会在 new SparkContext(sparkConfig) 处引发安全执行,并显示以下消息。
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 .

在 Eclipse 的问题选项卡上,它显示一个警告
说明 路径 资源位置类型
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

我在windows机器上安装了2.10.4的scala。
在 Eclipse 中设置的 Scala 编译器版本是 2.10.5 。是什么导致了这个安全异常?这是不兼容的版本问题还是其他什么原因?我将如何解决它?

最佳答案

这个问题或多或少与冲突的依赖关系有关。
以下任务解决了我的问题。

Go to Project

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


这解决了问题。

关于sql - Scala with spark - "javax.servlet.ServletRegistration"的签名者信息与同一包中其他类的签名者信息不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30299976/

相关文章:

php - MySQL查询排序正确信息

sql - 我需要帮助编写一个复杂的(对我而言)SELECT 语句

scala - (Spark) 对象 {name} 不是包 org.apache.spark.ml 的成员

scala - 在一个时钟周期内多次重新分配变量 - Chisel

java.lang.NoClassDefFoundError : org/apache/spark/sql/SparkSession 错误

php - sql 查询在 php 中给出错误

sql - Presto 过滤聚合内的行数组

scala - 在 Scala 选项类型 isEmpty 方法中检查 None

apache-spark - Kubernetes 上的 Spark UI 历史服务器?

r - Sparklyr - 在 Spark 中更改日期格式