[ 
https://issues.apache.org/jira/browse/FLINK-8327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16308180#comment-16308180
 ] 

Aljoscha Krettek commented on FLINK-8327:
-----------------------------------------

So the fat-jar contains the Akka classes?

I think the problem is that the configuration file is not included in the 
fat-jar. For Akka these files should be called {{reference.conf}} and I think 
you can include them in your fat-jar via this (Maven) configuration:
{code}
<transformers>
        <transformer 
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                <resource>reference.conf</resource>
        </transformer>
</transformers>
{code}

Unfortunately, I don't know how to do that using sbt but you can try manually 
adding the {{reference.conf}} file from the {{akka-http}} jar to your jar by 
unzipping and re-zipping it with that file.

> ClassLoader resolution of child-first does not appear to work
> -------------------------------------------------------------
>
>                 Key: FLINK-8327
>                 URL: https://issues.apache.org/jira/browse/FLINK-8327
>             Project: Flink
>          Issue Type: Bug
>          Components: Queryable State
>    Affects Versions: 1.4.0
>         Environment: h3. Environment
> * Local flink cluster version 1.4.0
> * {{classloader.resolve-order: child-first}} in {{conf/flink-conf.yaml}}.
> * scala 2.11.11
> * oracle jdk 1.8.0
> h3. Library version
> * akka actors 2.4.20
> * akka http 10.0.10
>            Reporter: Raymond Tay
>
> h2. Description
> Was trying out the {{Queryable State}} and ran into a problem where the 
> submitted job starts regular Akka actors and making external HTTP calls via 
> {{akka-http}} libraries and the flink runtime was complaining that it was not 
> able to read the key {{akka.http}} (this key is held in the configuration 
> file for {{akka-http}}).
> When i ran our app on the {{sbt}} shell locally, it was able to see the key 
> {{akka.http}} but when we submitted the fatjar (via {{sbt-assembly}}) to 
> flink, it was throwing the error message (see below). Looks like a class 
> loader issue but i'm not sure.
> Any help is much appreciated !
> h2. Error message
> {noformat}
> Caused by: com.typesafe.config.ConfigException$Missing: No configuration 
> setting found for key 'akka.http'
>       at 
> com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:152)
>       at 
> com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:170)
>       at 
> com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:176)
>       at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)
>       at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
>       at 
> com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:258)
>       at 
> com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:264)
>       at com.typesafe.config.impl.SimpleConfig.getConfig(SimpleConfig.java:37)
>       at akka.http.scaladsl.Http$.createExtension(Http.scala:843)
>       at akka.http.scaladsl.Http$.createExtension(Http.scala:719)
>       at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:917)
>       at akka.actor.ExtensionId$class.apply(Extension.scala:79)
>       at akka.http.scaladsl.Http$.apply(Http.scala:838)
>       at akka.http.scaladsl.Http$.apply(Http.scala:719)
>       at org.example.state.A.<init>(Simple.scala:158)
>       ... 18 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to