1

I am trying to connect ElasticSearch (version 5.6.7) to Couchbase (version 5.1.0).

I am using Elasticsearch Transport Couchbase (version elasticsearch-transport-couchbase-3.0.1-cypress-es5.6.7.zip), which should work with my version of ElasticSearch (version 5.6.7).

I am following these official instructions:

1) https://developer.couchbase.com/documentation/server/5.1/connectors/elasticsearch/getting-started.html;

2) https://github.com/couchbaselabs/elasticsearch-transport-couchbase.

Everything seems fine, but when i try to query my couchbase using elasticsearch i always get 0 results:

{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}

I am using this link to query my database (where elastic-bucket is an index which was created during elasticsearch configuration): http://localhost:9200/elastic-bucket/_search?q=photo

I dunno what to do since I cannot understand what the problem actually is.

Only thing that i can found out related to log messages in the ElasticSearch:

java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
at org.elasticsearch.transport.couchbase.capi.ElasticSearchCAPIBehavior.bulkDocs(ElasticSearchCAPIBehavior.java:360) ~[elasticsearch-transport-couchbase-3.0.1-cypress-es5.6.7-all.jar:?]
at com.couchbase.capi.servlet.CAPIServlet.handleBulkDocs(CAPIServlet.java:532) ~[couchbase-capi-server-1.6.3.jar:?]
at com.couchbase.capi.servlet.CAPIServlet.service(CAPIServlet.java:89) ~[couchbase-capi-server-1.6.3.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar:3.1.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845) ~[jetty-servlet-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [jetty-servlet-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:513) [jetty-security-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [jetty-servlet-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.server.Server.handle(Server.java:523) [jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320) [jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [jetty-server-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) [jetty-io-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [jetty-io-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [jetty-io-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [jetty-util-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [jetty-util-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [jetty-util-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [jetty-util-9.3.13.v20161014.jar:9.3.13.v20161014]
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [jetty-util-9.3.13.v20161014.jar:9.3.13.v20161014]
at java.lang.Thread.run(Unknown Source) [?:?]

Anyone have any ides? Thanks in advance!

1 Answers1

1

That exception indicates the plugin doesn't like running under Java 9. Thanks for reporting this.

In the short term, you could try running Elasticsearch using Java 8, or try one of the other solutions presented in How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9

Another thing to try would be to see if you can fetch the documents by ID, with an URL like http://localhost:9200/elastic-bucket/<document-type>/<document-id> (where <document-type> is usually couchbaseDocument unless you've configured the plugin to use something else). If you can get documents this way, but not via search, then the stack trace in the log is probably unrelated, and there might be an issue with the how the mapping type is defined.

Disclaimer: I work for Couchbase and maintain the Elasticsearch connector.

dnault
  • 8,340
  • 1
  • 34
  • 53