Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error #53

Closed
felix-laofan opened this issue Feb 11, 2018 · 16 comments
Closed

error #53

felix-laofan opened this issue Feb 11, 2018 · 16 comments
Assignees

Comments

@felix-laofan
Copy link

Start cluster on port(s) [2551, 2552, 0]
Exception in thread "main" com.typesafe.config.ConfigException$UnresolvedSubstitution: reference.conf @ jar:file:/C:/Users/Administrator/.m2/repository/com/typesafe/akka/akka-remote_2.12/2.5.9/akka-remote_2.12-2.5.9.jar!/reference.conf: 846: Could not resolve substitution to a value: ${akka.stream.materializer}
at com.typesafe.config.impl.ConfigReference.resolveSubstitutions(ConfigReference.java:111)
at com.typesafe.config.impl.ResolveContext.realResolve(ResolveContext.java:179)
at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:142)
at com.typesafe.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow(SimpleConfigObject.java:379)
at com.typesafe.config.impl.SimpleConfigObject.modifyMayThrow(SimpleConfigObject.java:312)
at com.typesafe.config.impl.SimpleConfigObject.resolveSubstitutions(SimpleConfigObject.java:398)
at com.typesafe.config.impl.ResolveContext.realResolve(ResolveContext.java:179)

@raboof
Copy link
Member

raboof commented Feb 11, 2018

Which sample are you running and how are you starting it?

@felix-laofan
Copy link
Author

akka-sample-cluster-java. in eclipse Meavn project! run
public class SimpleClusterApp {

public static void main(String[] args) {
if (args.length == 0)
startup(new String[] { "2551", "2552", "0" });
else
startup(args);
}

public static void startup(String[] ports) {
for (String port : ports) {
// Override the configuration of the port
Config config = ConfigFactory.parseString(
"akka.remote.netty.tcp.port=" + port + "\n" +
"akka.remote.artery.canonical.port=" + port)
.withFallback(ConfigFactory.load());

  // Create an Akka system
  ActorSystem system = ActorSystem.create("ClusterSystem", config);

  // Create an actor that handles cluster domain events
  system.actorOf(Props.create(SimpleClusterListener.class),
      "clusterListener");

}

}
}

@felix-laofan
Copy link
Author

UTF-8 1.8 2.5.9 com.typesafe.akka akka-actor_2.12 ${akka.version} com.typesafe.akka akka-cluster_2.12 ${akka.version} com.typesafe.akka akka-cluster-metrics_2.12 ${akka.version} com.typesafe.akka akka-slf4j_2.12 ${akka.version} ch.qos.logback logback-classic 1.2.3 com.typesafe.akka akka-testkit_2.12 ${akka.version} test

@raboof raboof self-assigned this Feb 12, 2018
@raboof
Copy link
Member

raboof commented Feb 12, 2018

I suspect you are missing the akka-stream dependency.

akka-sample-cluster-java does not have a pom.xml, if we add that that would have prevented this problem, right?

@felix-laofan
Copy link
Author

    <dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream_2.12</artifactId>
<version>2.5.9</version>

add akka-stream,But the problem still exists

@raboof
Copy link
Member

raboof commented Feb 12, 2018

Hmm, are you sure eclipse picked up the new dependency?

@felix-laofan
Copy link
Author

image

@raboof
Copy link
Member

raboof commented Feb 12, 2018

That indeed looks good - and the error message is still exactly the same ("akka-remote_2.12-2.5.9.jar!/reference.conf: 846: Could not resolve substitution to a value: ${akka.stream.materializer}")?

@felix-laofan
Copy link
Author

so what should i do.

@felix-laofan
Copy link
Author

send project email to you?

@raboof
Copy link
Member

raboof commented Feb 12, 2018

I'm afraid I don't have time to go into such depth right now - could you post the exact error message you're getting now though?

@felix-laofan
Copy link
Author

felix-laofan commented Feb 12, 2018

Exception in thread "main" com.typesafe.config.ConfigException$UnresolvedSubstitution: reference.conf @ jar:file:/C:/Users/Administrator/.m2/repository/com/typesafe/akka/akka-remote_2.12/2.5.9/akka-remote_2.12-2.5.9.jar!/reference.conf: 846: Could not resolve substitution to a value: ${akka.stream.materializer}
	at com.typesafe.config.impl.ConfigReference.resolveSubstitutions(ConfigReference.java:111)
	at com.typesafe.config.impl.ResolveContext.realResolve(ResolveContext.java:179)
	at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:142)
	at com.typesafe.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow(SimpleConfigObject.java:379)
	at com.typesafe.config.impl.SimpleConfigObject.modifyMayThrow(SimpleConfigObject.java:312)
	at com.typesafe.config.impl.SimpleConfigObject.resolveSubstitutions(SimpleConfigObject.java:398)
	at com.typesafe.config.impl.ResolveContext.realResolve(ResolveContext.java:179)
	at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:142)
	at com.typesafe.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow(SimpleConfigObject.java:379)
	at com.typesafe.config.impl.SimpleConfigObject.modifyMayThrow(SimpleConfigObject.java:312)
	at com.typesafe.config.impl.SimpleConfigObject.resolveSubstitutions(SimpleConfigObject.java:398)
	at com.typesafe.config.impl.ResolveContext.realResolve(ResolveContext.java:179)
	at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:142)
	at com.typesafe.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow(SimpleConfigObject.java:379)
	at com.typesafe.config.impl.SimpleConfigObject.modifyMayThrow(SimpleConfigObject.java:312)
	at com.typesafe.config.impl.SimpleConfigObject.resolveSubstitutions(SimpleConfigObject.java:398)
	at com.typesafe.config.impl.ResolveContext.realResolve(ResolveContext.java:179)
	at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:142)
	at com.typesafe.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow(SimpleConfigObject.java:379)
	at com.typesafe.config.impl.SimpleConfigObject.modifyMayThrow(SimpleConfigObject.java:312)
	at com.typesafe.config.impl.SimpleConfigObject.resolveSubstitutions(SimpleConfigObject.java:398)
	at com.typesafe.config.impl.ResolveContext.realResolve(ResolveContext.java:179)
	at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:142)
	at com.typesafe.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow(SimpleConfigObject.java:379)
	at com.typesafe.config.impl.SimpleConfigObject.modifyMayThrow(SimpleConfigObject.java:312)
	at com.typesafe.config.impl.SimpleConfigObject.resolveSubstitutions(SimpleConfigObject.java:398)
	at com.typesafe.config.impl.ResolveContext.realResolve(ResolveContext.java:179)
	at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:142)
	at com.typesafe.config.impl.ResolveContext.resolve(ResolveContext.java:231)
	at com.typesafe.config.impl.SimpleConfig.resolveWith(SimpleConfig.java:78)
	at com.typesafe.config.impl.SimpleConfig.resolve(SimpleConfig.java:68)
	at com.typesafe.config.impl.SimpleConfig.resolve(SimpleConfig.java:63)
	at com.typesafe.config.impl.SimpleConfig.resolve(SimpleConfig.java:41)
	at com.typesafe.config.impl.ConfigImpl$1.call(ConfigImpl.java:371)
	at com.typesafe.config.impl.ConfigImpl$1.call(ConfigImpl.java:364)
	at com.typesafe.config.impl.ConfigImpl$LoaderCache.getOrElseUpdate(ConfigImpl.java:65)
	at com.typesafe.config.impl.ConfigImpl.computeCachedConfig(ConfigImpl.java:92)
	at com.typesafe.config.impl.ConfigImpl.defaultReference(ConfigImpl.java:364)
	at com.typesafe.config.ConfigFactory.defaultReference(ConfigFactory.java:367)
	at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:213)
	at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:182)
	at com.typesafe.config.ConfigFactory$1.call(ConfigFactory.java:259)
	at com.typesafe.config.ConfigFactory$1.call(ConfigFactory.java:256)
	at com.typesafe.config.impl.ConfigImpl$LoaderCache.getOrElseUpdate(ConfigImpl.java:65)
	at com.typesafe.config.impl.ConfigImpl.computeCachedConfig(ConfigImpl.java:92)
	at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:256)
	at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:232)
	at sample.cluster.simple.SimpleClusterApp.startup(SimpleClusterApp.java:24)
	at sample.cluster.simple.SimpleClusterApp.main(SimpleClusterApp.java:13)

@romass12
Copy link

I am facing the same issue,what is the exact problem

@lakhanpandya
Copy link

Please help us resolve this issue, still facing it in 2019.

@johanandren
Copy link
Member

The cause is likely that not all reference.conf files from the jars end up on the classpath, or that they are incorrectly concatenated into a single reference.conf. You will have to dig into however you are trying to run (eclipse, intellij or some build tool?) and what it does when you trigger run.

Running directly from maven or sbt, depending on which sample, in a terminal is probably a workaround.

@johanandren
Copy link
Member

I downloaded Eclipse 2020-03 (4.15.0), opened the akka-sample-cluster-java project and was able to run each of the samples on Java 8 without any extra configuration of Eclipse or the project.

Closing this for now, we can re-open if someone still has a problem and can provide more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants