如何运行SUIM示例,将Akka打包在胖罐中?
在项目的自述文件之后,我得到下面的错误,结果是缺少Akka配置元素。
我正在使用Maven作为构建工具。有几个站点说我可以通过使用Maven shade插件fix来解决这个问题。使用建议的阴影插件构建,我仍然得到相同的错误。所以我想我做错了。有人可以发现我所缺少的东西 - 或者指出我还需要做些什么吗?我已将下面的shade插件配置添加到SUIM源代码中的示例pom中并重建。
当然,我希望作者能够以某种方式运行它,不带阴影插件。所以,如果有办法完全绕过它,请告诉我。
配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>allinone</shadedClassifierName>
<artifactSet>
<includes>
<include>*:*</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>reference.conf</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>edu.cmu.lti.suim.examples.App</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
错误:
$ java -cp ./suim-examples/target/suim-examples-0.0.1-SNAPSHOT-jar-with-dependencies.jar edu.cmu.lti.suim.examples.App local[2]
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka.remote.log-received-messages'
at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:126)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:146)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:151)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:151)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:119)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:157)
at com.typesafe.config.impl.SimpleConfig.getBoolean(SimpleConfig.java:167)
at akka.remote.RemoteSettings.<init>(RemoteSettings.scala:18)
at akka.remote.RemoteActorRefProvider.<init>(RemoteActorRefProvider.scala:32)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$3$$anonfun$apply$1.apply(DynamicAccess.scala:108)
at akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$3$$anonfun$apply$1.apply(DynamicAccess.scala:105)
at akka.actor.DynamicAccess$class.withErrorHandling(DynamicAccess.scala:72)
at akka.actor.ReflectiveDynamicAccess.withErrorHandling(DynamicAccess.scala:90)
at akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$3.apply(DynamicAccess.scala:105)
at akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$3.apply(DynamicAccess.scala:102)
at scala.Either.fold(Either.scala:96)
at akka.actor.ReflectiveDynamicAccess.createInstanceFor(DynamicAccess.scala:102)
at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:549)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:111)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:104)
at org.apache.spark.util.AkkaUtils$.createActorSystem(AkkaUtils.scala:64)
at org.apache.spark.SparkEnv$.createFromSystemProperties(SparkEnv.scala:128)
at org.apache.spark.SparkContext.<init>(SparkContext.scala:105)
at edu.cmu.lti.suim.examples.App$.main(App.scala:37)
at edu.cmu.lti.suim.examples.App.main(App.scala)
SUIM是一个混合Apache UIMA和Spark的项目。