java.lang.NoSuchMethodException: com.hubrick.vertx.elasticsearch.ElasticSearchServiceVerticle.<init>()
shubh-fp opened this issue · 5 comments
Getting this exception while deploying vertx:
Java Version - 1.8, vertx version - 3.5.3
java.lang.InstantiationException: com.hubrick.vertx.elasticsearch.ElasticSearchServiceVerticle
at java.lang.Class.newInstance(Class.java:427)
at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:39)
at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:229)
at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:202)
at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:79)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:171)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:143)
at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:131)
at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:177)
at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:79)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:171)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:143)
at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:131)
at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:665)
at com.foodpanda.vendor.service.verticle.ServerVerticle.startElasticVerticle(ServerVerticle.java:69)
at com.foodpanda.vendor.service.verticle.ServerVerticle.start(ServerVerticle.java:50)
at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$8(DeploymentManager.java:483)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:339)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodException: com.hubrick.vertx.elasticsearch.ElasticSearchServiceVerticle.()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.newInstance(Class.java:412)
That sounds like guice (or HK2 I guess) either isn't imported correctly, or "guice_binder" (or HK equivalent) isn't set in the verticle config at launch.
I am not providing any configs at verticle launch as mentioned in the README for using default configuration.
It should use default binding configs, right?
{ "main":"java-hk2:com.hubrick.vertx.elasticsearch.ElasticSearchServiceVerticle", "options":{ "worker":false, "config":{ "hk2_binder":[ "com.hubrick.vertx.elasticsearch.hk2.ElasticSearchBinder" ], "address":"et.elasticsearch" } } }
@eemmiirr Can you help what could be the issue?
Hello,
I face the same error both with
- Java 11 / VertX 3.6.3
- Java 8 / VertX 3.6.3
- Java 8 / VertX 3.7.0
Already tried hk2 and guice
This is my code: https://bitbucket.org/rakotomandimby/vertx-elasticsearch-experimentation/src/master/
@shubh-fp , did you managed to make it work?
Updated my situation. Please see https://bitbucket.org/rakotomandimby/vertx-elasticsearch-experimentation/src/master/
Message is now:
com.englishtown.vertx.hk2.HK2VerticleLoader.<init>(java.lang.String, java.lang.ClassLoader, org.glassfish.hk2.api.ServiceLocator)
java.lang.NoSuchMethodException: com.englishtown.vertx.hk2.HK2VerticleLoader.<init>(java.lang.String, java.lang.ClassLoader, org.glassfish.hk2.api.ServiceLocator)
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getConstructor(Class.java:1825)
at com.englishtown.vertx.hk2.HK2VerticleFactory.createVerticle(HK2VerticleFactory.java:91)
at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:238)
at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:211)
at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:79)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:178)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:151)
at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:140)
at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:184)
at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:79)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:178)
at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:151)
at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:140)
at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:677)
at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:664)
at org.rktmb.MainVerticle.start(MainVerticle.java:24)
at io.vertx.core.AbstractVerticle.start(AbstractVerticle.java:106)
at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$8(DeploymentManager.java:494)
at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:320)
at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Facing same issue , any help here ?