sbt-assembly icon indicating copy to clipboard operation
sbt-assembly copied to clipboard

shading appears to mess with application.conf / reference.conf

Open velvia opened this issue 10 years ago • 3 comments

I tried to shade Akka as well, and it appears that, in addition to the test in assembly issue, it also seems to mess with application.conf. In the stack trace below, Akka's init system is looking for a root config key of "sjs", because I had a rule to rename "akka.**" to "sjs.akka.@1".

Exception in thread "main" com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'sjs'
    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 sjs.akka.actor.ActorSystem$Settings.<init>(ActorSystem.scala:168)
    at sjs.akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:504)
    at sjs.akka.actor.ActorSystem$.apply(ActorSystem.scala:141)
    at sjs.akka.actor.ActorSystem$.apply(ActorSystem.scala:118)
    at spark.jobserver.JobServer$$anonfun$main$1.apply(JobServer.scala:121)

Unfortunately I removed the commit from the PR because of this issue, the jar would not run. Perhaps the shader is too aggressive in changing strings also?

velvia avatar Oct 08 '15 06:10 velvia

Hi velvia,

According to the doc of jarjar, it indeed changes string literals referencing class names ("moving resource files and transforming string literals").

wxiang7 avatar Nov 25 '15 06:11 wxiang7

I think that renaming the whole akka package is calling for trouble anyway. Unfortunately, renaming just the usual entry point into Akka, with is ActorSystem, doesn't work either (see #205)

mlangc avatar Apr 06 '16 05:04 mlangc

I'm experiencing the same issue. I feel the need the shade akka to integrate it with flink 1.3.2 (although I know that the new flink 1.4.0 already incorporates the real akka 1.4.0).

I guess the solution would be to also "shade" programmatically the configuration keys. Is this in any way possible?

juanmirocks avatar Dec 16 '17 07:12 juanmirocks