You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
I use vertx 3.4.1.
I want to load config.json from file-system within a start-method of a vertical-instance:
However, I get this stacktrace:
Is this my fault?
The text was updated successfully, but these errors were encountered: