Spark:no configuration setting found for key akka 问题解决

问题描述

Caused by: com.typesafe.config.ConfigException$Missing: No configuration setting
 found for key 'akka'
        at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:124)
        at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:147)
        at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:159)
        at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:164)
        at com.typesafe.config.impl.SimpleConfig.getString(SimpleConfig.java:206)
        at akka.actor.ActorSystem$Settings.(ActorSystem.scala:168)
        at akka.actor.ActorSystemImpl.(ActorSystem.scala:504)
        at akka.actor.ActorSystem$.apply(ActorSystem.scala:141)
        at akka.actor.ActorSystem$.apply(ActorSystem.scala:108)
        at akka.actor.ActorSystem$.apply(ActorSystem.scala:99)

  默认情况下,Akka将从以下位置读取配置文件:

  1. classpath根目录下的application.conf(包括在jar中)
  2. 从ActorSystem手动传递配置(“name”,config)。
  3. classpath根目录下的reference.conf(包括在jar中) 

解决办法:pom.xml 文件中中指定 reference.conf

<transformer
        implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
    <resource>reference.conf</resource>
</transformer>

发布了57 篇原创文章 · 获赞 26 · 访问量 10万+

猜你喜欢

转载自blog.csdn.net/BoomLee/article/details/83790290