# Akka com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'enabled'

**URL:** <https://discuss.akka.io/t/akka-com-typesafe-config-configexception-missing-no-configuration-setting-found-for-key-enabled/1056>\
**Category:** Akka Cluster\
**Tags:** akka-cluster\
**Created:** [May 17, 2018, 3:08am UTC](https://discuss.akka.io/t/akka-com-typesafe-config-configexception-missing-no-configuration-setting-found-for-key-enabled/1056 "2018-05-17T03:08:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![geeknotnerd](https://avatars.discourse-cdn.com/v4/letter/g/b2d939/32.png) [@geeknotnerd](https://discuss.akka.io/u/geeknotnerd)\
**Post date:** [May 17, 2018, 3:08am UTC](https://discuss.akka.io/t/akka-com-typesafe-config-configexception-missing-no-configuration-setting-found-for-key-enabled/1056/1 "2018-05-17T03:08:09Z")

</div>

I am trying to get my akka cluster up and running on my localhost with below configuration. My language is Java.  
It works all good in eclipse, however, it gives me an error when I build my fat jar and try to run it from the command line.  
Error:  
`Caused by: com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'enabled'`

I am pretty sure that it finds following conf file as I confirmed that any changes I do in the file take effect in next run.

My pom.xml entries:

```auto
     <dependency>
			<groupId>com.typesafe.akka</groupId>
			<artifactId>akka-actor_2.12</artifactId>
			<version>2.5.12</version>
		</dependency>
		<dependency>
			<groupId>com.typesafe.akka</groupId>
			<artifactId>akka-cluster_2.12</artifactId>
			<version>2.5.12</version>
		</dependency>

```

Below is my application.conf file

```auto
Master {
    
akka { 

  actor {
    provider = "cluster"
  }
  remote {
    maximum-payload-bytes = 30000000 bytes
    log-remote-lifecycle-events = off
    netty.tcp {
      hostname = "127.0.0.1"
      port = 0
      message-frame-size = 30000000b
      send-buffer-size = 30000000b
      receive-buffer-size = 30000000b
      maximum-frame-size = 30000000b
    }
  }

  cluster {
    roles = ["Master"] 
    seed-nodes = [
      "akka.tcp://GyanClusterSystem@127.0.0.1:2556"]
      

    # auto downing is NOT safe for production deployments.
    # you may want to use it during development, read more about it in the docs.
    #
    #auto-down-unreachable-after = 10s
  }
}
}

Worker {
akka { 
  actor {
    provider = "cluster"
  }
  remote {
    maximum-payload-bytes = 30000000 bytes
    log-remote-lifecycle-events = off
    netty.tcp {
      hostname = "127.0.0.1"
      port = 0
      message-frame-size = 30000000b
      send-buffer-size = 30000000b
      receive-buffer-size = 30000000b
      maximum-frame-size = 30000000b
    }
  }

  cluster {
    roles = ["Worker"]
    seed-nodes = [
      "akka.tcp://GyanClusterSystem@127.0.0.1:2556"]
      

    # auto downing is NOT safe for production deployments.
    # you may want to use it during development, read more about it in the docs.
    # auto-down-unreachable-after = 10s
  }
}
}

```

---

<div class="post-metadata">

**Author:** ![ktoso](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/ktoso/32/19_2.png) [@ktoso](https://discuss.akka.io/u/ktoso)\
**Post date:** [May 17, 2018, 3:15am UTC](https://discuss.akka.io/t/akka-com-typesafe-config-configexception-missing-no-configuration-setting-found-for-key-enabled/1056/2 "2018-05-17T03:15:18Z")

</div>

Please show more of your pom; are you building a far jar? Are you properly concating the reference.conf files?

---

<div class="post-metadata">

**Author:** ![ktoso](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/ktoso/32/19_2.png) [@ktoso](https://discuss.akka.io/u/ktoso)\
**Post date:** [May 17, 2018, 3:15am UTC](https://discuss.akka.io/t/akka-com-typesafe-config-configexception-missing-no-configuration-setting-found-for-key-enabled/1056/3 "2018-05-17T03:15:50Z")

</div>

See documentation about this: [https://doc.akka.io/docs/akka/2.5.6/scala/general/configuration.html#when-using-jarjar-onejar-assembly-or-any-jar-bundler](https://doc.akka.io/docs/akka/2.5.6/scala/general/configuration.html#when-using-jarjar-onejar-assembly-or-any-jar-bundler)

---

<div class="post-metadata">

**Author:** ![geeknotnerd](https://avatars.discourse-cdn.com/v4/letter/g/b2d939/32.png) [@geeknotnerd](https://discuss.akka.io/u/geeknotnerd)\
**Post date:** [May 17, 2018, 3:24am UTC](https://discuss.akka.io/t/akka-com-typesafe-config-configexception-missing-no-configuration-setting-found-for-key-enabled/1056/4 "2018-05-17T03:24:48Z")

</div>

Here is build section of my pom.xml

```auto
<build>
		<plugins>
			<!-- Maven Assembly Plugin -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.4.1</version>
				<configuration>
					<!-- get all project dependencies -->
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<!-- MainClass in mainfest make a executable jar -->
					<archive>
						<manifest>
							<mainClass>io.gyan.GyanCrunchClusterCreator</mainClass>
						</manifest>
					</archive>

				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id>
						<!-- bind to the packaging phase -->
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.0.2</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>

		</plugins>
	</build>

```

---

<div class="post-metadata">

**Author:** ![geeknotnerd](https://avatars.discourse-cdn.com/v4/letter/g/b2d939/32.png) [@geeknotnerd](https://discuss.akka.io/u/geeknotnerd)\
**Post date:** [May 17, 2018, 3:40am UTC](https://discuss.akka.io/t/akka-com-typesafe-config-configexception-missing-no-configuration-setting-found-for-key-enabled/1056/5 "2018-05-17T03:40:12Z")

</div>

Also, I have only one conf file. application.conf So I am guessing I don’t need any other reference.conf files?  
Also, I guess I need to Maven Shade plug-in instead of Assembly?

For simplicity sake and testing purposes, I kept my application.conf file outside of my codebase for now. Please see below.

```auto
@Bean
	public ActorSystem actorSystem() {

		Config parsedConfig = ConfigFactory.parseFile(new File("/gyan/application.conf"));

		Config config = ConfigFactory
				.parseString(
						"akka.remote.netty.tcp.port=" + "2556" + "\n" + "akka.remote.artery.canonical.port=" + "2556")
				.withFallback(ConfigFactory.load(parsedConfig).getConfig("Master"));

		ActorSystem system = ActorSystem.create("GyanClusterSystem", config);

		SpringExtension.SPRING_EXTENSION_PROVIDER.get(system).initialize(applicationContext);
		return system;
	}

```

---

<div class="post-metadata">

**Author:** ![geeknotnerd](https://avatars.discourse-cdn.com/v4/letter/g/b2d939/32.png) [@geeknotnerd](https://discuss.akka.io/u/geeknotnerd)\
**Post date:** [May 17, 2018, 4:15am UTC](https://discuss.akka.io/t/akka-com-typesafe-config-configexception-missing-no-configuration-setting-found-for-key-enabled/1056/6 "2018-05-17T04:15:29Z")

</div>

I tried with shade plugin as well, but no luck 😔

```auto
<build>
		<plugins>
		<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.0.2</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>3.1.1</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

```

---

<div class="post-metadata">

**Author:** ![ktoso](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/ktoso/32/19_2.png) [@ktoso](https://discuss.akka.io/u/ktoso)\
**Post date:** [May 17, 2018, 6:27am UTC](https://discuss.akka.io/t/akka-com-typesafe-config-configexception-missing-no-configuration-setting-found-for-key-enabled/1056/7 "2018-05-17T06:27:45Z")

</div>

> Also, I have only one conf file. application.conf So I am guessing I don’t need any other reference.conf files?

You do have have tons of them actually 🙂  
Each akka-\* library defines its own reference.conf, so they have to be merged using the shading as documented.

Please configure the plugin the as it is shown in the documentation – the things around `reference.conf ` specifically. In the piece you pasted you did not configure it.

---

<div class="post-metadata">

**Author:** ![geeknotnerd](https://avatars.discourse-cdn.com/v4/letter/g/b2d939/32.png) [@geeknotnerd](https://discuss.akka.io/u/geeknotnerd)\
**Post date:** [May 19, 2018, 12:41am UTC](https://discuss.akka.io/t/akka-com-typesafe-config-configexception-missing-no-configuration-setting-found-for-key-enabled/1056/8 "2018-05-19T00:41:45Z")

</div>

🙂 Thanks, that worked. Finally, it’s up and running!
