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.IllegalArgumentException: unknown configuration store implementation: spring-config-server #106

Open
oylshe1314 opened this issue Dec 30, 2019 · 1 comment

Comments

@oylshe1314
Copy link

oylshe1314 commented Dec 30, 2019

dependencies {

compile 'io.vertx:vertx-core:4.0.0-milestone4'
compile 'io.vertx:vertx-config:4.0.0-milestone4'
compile 'io.vertx:vertx-config-spring-config-server:4.0.0-milestone4'

}

jar {
manifest {
attributes "Main-Class" : "io.vertx.core.Launcher", "Main-Verticle" : "com.sk.open.verticle.MainVerticle"
}

from {
    configurations.compile.collect {
        it.isDirectory() ? it : zipTree(it)
    }
}

}

ConfigStoreOptions springStoreOptions = new ConfigStoreOptions();
springStoreOptions.setType("spring-config-server");
springStoreOptions.setConfig(new JsonObject().put("url", "http://localhost:10000/config/game-service/develop/server14"));

    ConfigRetrieverOptions retrieverOptions = new ConfigRetrieverOptions();
    retrieverOptions.addStore(springStoreOptions);

    ConfigRetriever retriever = ConfigRetriever.create(vertx, retrieverOptions);

    retriever.getConfig(event -> {
        if(event.failed()) {
            startPromise.fail(event.cause());
            return;
        }

        JsonObject config = event.result();
        System.out.println(config.toString());
    });

java.lang.IllegalArgumentException: unknown configuration store implementation: spring-config-server (known implementations are: [event-bus, file, json, http, env, sys, directory])
at io.vertx.config.impl.ConfigRetrieverImpl.(ConfigRetrieverImpl.java:111)
at io.vertx.config.ConfigRetriever.create(ConfigRetriever.java:53)
at com.sk.open.verticle.MainVerticle.start(MainVerticle.java:21)
at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$5(DeploymentManager.java:209)
at io.vertx.core.impl.AbstractContext.emit(AbstractContext.java:183)
at io.vertx.core.impl.EventLoopContext.lambda$execute$0(EventLoopContext.java:42)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518)
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:830)

@gaol
Copy link
Member

gaol commented Jan 20, 2020

It looks like the io.vertx.config.spring.SpringConfigServerStoreFactory was not detected by the ServiceLoader, since the vertx-config-spring-config-server has been added as a compile scope dependency, I suggest that you check whether the META-INF/services/io.vertx.config.spi.ConfigStoreFactory in the fat jar has correct items.

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