Hi Daniele,

Read this section of the docs! 
http://doc.akka.io/docs/akka/2.4/general/configuration.html#when-using-jarjar-onejar-assembly-or-any-jar-bundler

--
Johan Andrén
Akka Team

On Tuesday, September 20, 2016 at 3:44:58 PM UTC+2, Daniele Ascione wrote:
>
> I looked in the Akka User List for a long time, but I coudn't find 
> anything which helped me in this situation. Sorry if this is a duplicated 
> answer.
> I'm trying to create an akka "Hello World" bundle (inspired by the this 
> example 
> <https://github.com/akka/akka/tree/master/akka-samples/akka-sample-main-java>),
>  
> and I'm trying to start it in Karaf.
> I wrote this *activator *in java: 
> public class AkkaActivator extends ActorSystemActivator {
>
> ActorSystem actorSystem; 
> ActorRef actorRef;
> @Override
> public void configure(BundleContext context, ActorSystem system) {
> Config regularConfig = ConfigFactory.load();
> String sysName = system.name();
> ActorSystem.apply(sysName, regularConfig);
> actorRef = system.actorOf(Props.create(HelloWorld.class), "helloWorld");
> system.actorOf(Props.create(Terminator.class, actorRef), "terminator");
> }
>
> }
>
>  , which I deployed in a jar using the maven-bundle-plugin 
> <http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html>
> .
> I wrote also a *reference.conf* file which is inserted by maven plugin in 
> the root of the created jar. The file is the following one:
>   
> akka {
>   loglevel = INFO
> }
>
>
> All the code is avaible in this repo 
> <https://bitbucket.org/audhumla/akka-osgi/overview>.
> When I try to start the bundle from karaf, I obtain the following 
> exception:
>
> 2016-09-20 15:20:15,560 | ERROR | nsole user karaf | ShellUtil             
>            | 44 - org.apache.karaf.shell.core - 4.0.5 | Exception caught 
> while executing command
> org.apache.karaf.shell.support.MultiException: Error executing command on 
> bundles:
> Error starting bundle 327: Activator start error in bundle 
> com.example.akka-poc-bundle [327].
> at 
> org.apache.karaf.shell.support.MultiException.throwIf(MultiException.java:61)
> at 
> org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:69)[24:org.apache.karaf.bundle.core:4.0.5]
> at 
> org.apache.karaf.bundle.command.BundlesCommand.execute(BundlesCommand.java:54)[24:org.apache.karaf.bundle.core:4.0.5]
> at 
> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[44:org.apache.karaf.shell.core:4.0.5]
> at 
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[44:org.apache.karaf.shell.core:4.0.5]
> at 
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[44:org.apache.karaf.shell.core:4.0.5]
> at 
> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[44:org.apache.karaf.shell.core:4.0.5]
> at 
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[44:org.apache.karaf.shell.core:4.0.5]
> at 
> org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[44:org.apache.karaf.shell.core:4.0.5]
> at 
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[44:org.apache.karaf.shell.core:4.0.5]
> at 
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[44:org.apache.karaf.shell.core:4.0.5]
> at 
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)[44:org.apache.karaf.shell.core:4.0.5]
> at 
> org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:270)[44:org.apache.karaf.shell.core:4.0.5]
> at java.lang.Thread.run(Thread.java:745)[:1.8.0_91]
> Caused by: java.lang.Exception: Error starting bundle 327: Activator start 
> error in bundle com.example.akka-poc-bundle [327].
> at 
> org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:66)[24:org.apache.karaf.bundle.core:4.0.5]
> ... 12 more
> Caused by: org.osgi.framework.BundleException: Activator start error in 
> bundle com.example.akka-poc-bundle [327].
> at 
> org.apache.felix.framework.Felix.activateBundle(Felix.java:2276)[org.apache.felix.framework-5.4.0.jar:]
> at 
> org.apache.felix.framework.Felix.startBundle(Felix.java:2144)[org.apache.felix.framework-5.4.0.jar:]
> at 
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)[org.apache.felix.framework-5.4.0.jar:]
> at 
> org.apache.karaf.bundle.command.Start.executeOnBundle(Start.java:38)[24:org.apache.karaf.bundle.core:4.0.5]
> at 
> org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:64)[24:org.apache.karaf.bundle.core:4.0.5]
> ... 12 more
> Caused by: com.typesafe.config.ConfigException$Missing: No configuration 
> setting found for key 'akka.version'
> at 
> com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:152)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:170)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:176)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> com.typesafe.config.impl.SimpleConfig.getString(SimpleConfig.java:246)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> akka.actor.ActorSystem$Settings.<init>(ActorSystem.scala:168)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:522)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> akka.actor.ActorSystem$.apply(ActorSystem.scala:142)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> akka.actor.ActorSystem$.apply(ActorSystem.scala:126)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> akka.osgi.OsgiActorSystemFactory.createActorSystem(OsgiActorSystemFactory.scala:32)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> akka.osgi.ActorSystemActivator.start(ActorSystemActivator.scala:42)[327:com.example.akka-poc-bundle:0.0.1]
> at 
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)[org.apache.felix.framework-5.4.0.jar:]
> at 
> org.apache.felix.framework.Felix.activateBundle(Felix.java:2226)[org.apache.felix.framework-5.4.0.jar:]
> ... 16 more
> I noticed that if I modify the reference.conf file adding the line:
> version = 2.4.10
> Instead of getting:
> No configuration setting found for key 'akka.version'
> I obtain:
> No configuration setting found for key 'akka.actor'
>
> I could I solve this problem?
>
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to