title: Integrate Akka with Spring in Java web application project under Tomcat7
body: <p>I am interested in injecting Actors to beans, while the actors will be created by spring. In addition, I am looking for ways to customize Akka configuration file path.</p>
  
  <p>My project uses Java 7 and spring 3.2.5, akka version is 2.3.7.</p>
  
  <p>I read some documents and guides that instruct to create a bean definition in my spring beans configuration file, as follows:</p>
  
  <pre><code>&lt;bean id="system-actor" class="akka.actor.ActorSystem" factory-method="create" destroy-method="shutdown" scope="singleton"&gt;
      &lt;constructor-arg value="MyApp" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>The system actor created by spring successfully according to default configuration.
  Questions:</p>
  
  <ul>
  <li><p>I want to initialize the system actor according to <strong>/WEB-INF/application.conf</strong> file, I added the -Dconfig.trace=loads system property in order to debug configuration loading, this is the output:</p>
  
  <p>Loading config from class loader WebappClassLoader
    context: /MY-APP
    delegate: false
    repositories:
      <strong>/WEB-INF/classes/</strong>
  ----------> Parent Classloader:
  org.apache.catalina.loader.StandardClassLoader@992f73
   but there were no resources called application.conf
  exception loading application.conf: java.io.IOException: resource not found on classpath: application.conf
  Loading config from class loader WebappClassLoader
    context: /MY-APP
    delegate: false
    repositories:
      <strong>/WEB-INF/classes/</strong>
  ----------> Parent Classloader:
  org.apache.catalina.loader.StandardClassLoader@992f73
   but there were no resources called application.json
  exception loading application.json: java.io.IOException: resource not found on classpath: application.json
  Loading config from class loader WebappClassLoader
    context: /MY-APP
    delegate: false
    repositories:
      <strong>/WEB-INF/classes/</strong>
  ----------> Parent Classloader:
  org.apache.catalina.loader.StandardClassLoader@992f73
   but there were no resources called application.properties
  exception loading application.properties: java.io.IOException: resource not found on classpath: application.properties
  Did not find 'application' with any extension (.conf, .json, .properties); but 'application' is allowed to be missing. Exceptions from load attempts should have been logged above.
  Loading config from URL jar:file:/var/work/MY-APP/jakarta-tomcat/webapps/MY-APP/WEB-INF/lib/akka-actor_2.10-2.3.7.jar!/reference.conf from class loader WebappClassLoader
    context: /MY-APP
    delegate: false
    repositories:
      <strong>/WEB-INF/classes/</strong>
  ----------> Parent Classloader:
  org.apache.catalina.loader.StandardClassLoader@992f73</p></li>
  <li><p>Is there a way to pass this path to system actor bean?</p></li>
  <li><p>There is a way to create actor beans in spring instead of injecting the system actor and using <code>system.actorOf(Props.create(MyActor.class), "name");</code>? Detailed examples will be helpful.</p></li>
  <li>Many answers to simillar issues point to this article: <a href="http://blog.nemccarthy.me/?p=272" rel="nofollow">http://blog.nemccarthy.me/?p=272</a> but this page is offline, someone knows what's written there? </li>
  </ul>