ef-labs / vertx-elasticsearch-service

Vert.x elasticsearch service with event bus proxying
57 stars 18 forks source link

Event bus proxy not working #10

Closed mavencode01 closed 9 years ago

mavencode01 commented 9 years ago

Am trying to figure out how to use your service but I keep getting same error message.

Basically, I am using vertx maven service factory to download the service from maven repository

vertx.deployVerticle("maven:com.englishtown.vertx:vertx-elasticsearch-service:2.0.0-RC2::com.englishtown.vertx.vertx-elasticsearch-service", result -> {
            if (result.failed()) {
                LOG.error("Elasticsearch failed to deploy...");
                result.cause().printStackTrace();                   
            }
            else{               
                LOG.info("Elasticsearch deployed successfully... ",);
            }
        });     

Now, If I tried to create a proxy to the service, ElasticSearchService service = ElasticSearchService.createEventBusProxy(vertx, "et.elasticsearch");

it just throws up an error

java.lang.IllegalStateException: Cannot find proxyClass: com.englishtown.vertx.elasticsearch.ElasticSearchServiceVertxEBProxy
    at io.vertx.serviceproxy.ProxyHelper.loadClass(ProxyHelper.java:68)
    at io.vertx.serviceproxy.ProxyHelper.createProxy(ProxyHelper.java:32)
    at com.englishtown.vertx.elasticsearch.ElasticSearchService.createEventBusProxy(ElasticSearchService.java:23)
    at com.worldpay.vertx.handlers.LogServiceHandler.handle(LogServiceHandler.java:24)
    at com.worldpay.vertx.handlers.RESTHandler.handle(RESTHandler.java:1)
    at io.vertx.ext.apex.impl.RouteImpl.handleContext(RouteImpl.java:204)
    at io.vertx.ext.apex.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:67)
    at io.vertx.ext.apex.impl.RoutingContextImpl.next(RoutingContextImpl.java:98)
    at io.vertx.ext.apex.handler.impl.BodyHandlerImpl.handle(BodyHandlerImpl.java:51)
    at io.vertx.ext.apex.handler.impl.BodyHandlerImpl.handle(BodyHandlerImpl.java:36)
    at io.vertx.ext.apex.impl.RouteImpl.handleContext(RouteImpl.java:204)
    at io.vertx.ext.apex.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:67)
    at io.vertx.ext.apex.impl.RoutingContextImpl.next(RoutingContextImpl.java:98)
    at io.vertx.ext.apex.impl.RouterImpl.accept(RouterImpl.java:61)
    at com.worldpay.vertx.service.ServiceAgent$$Lambda$20/281738013.handle(Unknown Source)

Is there something am missing ? I will gladly appreciate if you could help.

Thanks

mavencode01 commented 9 years ago

I got this to work by including the service interface in my project and generating the proxy class myself.

It seems for some reasons, the generated proxy class is not included the jar ????

adrianluisgonzalez commented 9 years ago

If you're using vert.x 3.0.0-milestone4, can you try vertx-elasticsearch-service 2.0.0-RC3?

The proxy class should definitely be included in the jar:

$ jar tf vertx-elasticsearch-service-2.0.0-RC3.jar 
META-INF/
META-INF/MANIFEST.MF
com/
com/englishtown/
com/englishtown/vertx/
com/englishtown/vertx/elasticsearch/
com/englishtown/vertx/elasticsearch/impl/
com/englishtown/vertx/hk2/
vertx-elasticsearch-service-js/
com/englishtown/vertx/elasticsearch/AbstractOptions.class
com/englishtown/vertx/elasticsearch/AbstractWriteOptions.class
com/englishtown/vertx/elasticsearch/DeleteOptions.class
com/englishtown/vertx/elasticsearch/ElasticSearchConfigurator.class
com/englishtown/vertx/elasticsearch/ElasticSearchService.class
com/englishtown/vertx/elasticsearch/ElasticSearchServiceVerticle.class
com/englishtown/vertx/elasticsearch/ElasticSearchServiceVertxEBProxy.class
com/englishtown/vertx/elasticsearch/ElasticSearchServiceVertxProxyHandler.class
com/englishtown/vertx/elasticsearch/GetOptions.class
com/englishtown/vertx/elasticsearch/impl/DefaultElasticSearchService$1.class
com/englishtown/vertx/elasticsearch/impl/DefaultElasticSearchService$2.class
com/englishtown/vertx/elasticsearch/impl/DefaultElasticSearchService$3.class
com/englishtown/vertx/elasticsearch/impl/DefaultElasticSearchService$4.class
com/englishtown/vertx/elasticsearch/impl/DefaultElasticSearchService$5.class
com/englishtown/vertx/elasticsearch/impl/DefaultElasticSearchService$6.class
com/englishtown/vertx/elasticsearch/impl/DefaultElasticSearchService.class
com/englishtown/vertx/elasticsearch/impl/DefaultTransportClientFactory.class
com/englishtown/vertx/elasticsearch/impl/EnvElasticSearchConfigurator.class
com/englishtown/vertx/elasticsearch/impl/JsonElasticSearchConfigurator.class
com/englishtown/vertx/elasticsearch/IndexOptions.class
com/englishtown/vertx/elasticsearch/package-info.class
com/englishtown/vertx/elasticsearch/SearchOptions.class
com/englishtown/vertx/elasticsearch/SearchScrollOptions.class
com/englishtown/vertx/elasticsearch/SortOption.class
com/englishtown/vertx/elasticsearch/TransportClientFactory.class
com/englishtown/vertx/elasticsearch/UpdateOptions.class
com/englishtown/vertx/hk2/BootstrapBinder.class
com/englishtown/vertx/hk2/ElasticSearchBinder.class
com.englishtown.vertx.vertx-elasticsearch-service.json
vertx-elasticsearch-service-js/elastic_search_service.js
META-INF/maven/
META-INF/maven/com.englishtown.vertx/
META-INF/maven/com.englishtown.vertx/vertx-elasticsearch-service/
META-INF/maven/com.englishtown.vertx/vertx-elasticsearch-service/pom.xml
META-INF/maven/com.englishtown.vertx/vertx-elasticsearch-service/pom.properties

If it still doesn't work, can you post a project that reproduces the problem?

mavencode01 commented 9 years ago

@adrianluisgonzalez , it works now.

Thanks