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

java.lang.IllegalStateException: Result is already complete: succeeded #9

Closed
nimo23 opened this issue May 10, 2017 · 4 comments
Closed

Comments

@nimo23
Copy link

nimo23 commented May 10, 2017

I use vertx 3.4.1.

I want to load config.json from file-system within a start-method of a vertical-instance:

ConfigStoreOptions configFile = new ConfigStoreOptions()
				  .setType("file")
				  .setFormat("json")
				  .setConfig(new JsonObject().put("path", "src/main/resources/config.json"));
		  
		  ConfigRetrieverOptions options = new ConfigRetrieverOptions().addStore(configFile);
		  ConfigRetriever retriever = ConfigRetriever.create(vertx, options);
		  
		  retriever.getConfig(ar -> {
			  if (ar.failed()) {
				  log.warn("Failed to retrieve the configuration");
			  } else {
				  JsonObject config = ar.result();
				  log.info(config.getString("http.port"));
			  }
			});

However, I get this stacktrace:

[INFO] 16:59:40.774 | vert.x-eventloop-thread-0 | ContextImpl | 343 | Unhandled exception
[INFO] java.lang.IllegalStateException: Result is already complete: succeeded
[INFO] 	at io.vertx.core.impl.FutureImpl.fail(FutureImpl.java:121) ~[vertx-core-3.4.1.jar:?]
[INFO] 	at io.vertx.config.impl.ConfigRetrieverImpl.lambda$null$7(ConfigRetrieverImpl.java:166) ~[vertx-config-3.4.1.jar:?]
[INFO] 	at io.vertx.config.impl.ConfigurationProvider.lambda$null$0(ConfigurationProvider.java:41) ~[vertx-config-3.4.1.jar:?]
[INFO] 	at io.vertx.config.impl.spi.JsonProcessor.process(JsonProcessor.java:27) ~[vertx-config-3.4.1.jar:?]
[INFO] 	at io.vertx.config.impl.ConfigurationProvider.lambda$get$1(ConfigurationProvider.java:39) ~[vertx-config-3.4.1.jar:?]
[INFO] 	at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:188) ~[vertx-core-3.4.1.jar:?]
[INFO] 	at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100) ~[vertx-core-3.4.1.jar:?]
[INFO] 	at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:287) ~[vertx-core-3.4.1.jar:?]
[INFO] 	at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:337) ~[vertx-core-3.4.1.jar:?]
[INFO] 	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [netty-common-4.1.8.Final.jar:4.1.8.Final]
[INFO] 	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) [netty-common-4.1.8.Final.jar:4.1.8.Final]
[INFO] 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:445) [netty-transport-4.1.8.Final.jar:4.1.8.Final]
[INFO] 	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [netty-common-4.1.8.Final.jar:4.1.8.Final]
[INFO] 	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_74]

Is this my fault?

@cescoffier
Copy link
Member

Shouldn't you read the "http.port" property as an integer and not a String. It causes a class cast exception.

@nimo23
Copy link
Author

nimo23 commented May 10, 2017

yes, you are right. This was my fault. Within the stacktrace there was no sign for a class cast exception..

@nimo23 nimo23 closed this as completed May 10, 2017
@cescoffier
Copy link
Member

Yes, I'm actually chasing why.

@cescoffier cescoffier reopened this May 10, 2017
@cescoffier
Copy link
Member

(don't close the issue, I will close it when I've the answer)

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

No branches or pull requests

2 participants