question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Camel-quarkus-couchbase Consumer is not working

See original GitHub issue

Suppose to run

docker run -d --name db -p 8091-8094:8091-8094 -p 11210:11210 couchbase:6.5.1

and to create sample bucket “beer-sample” with the sample data by creating a user admin/password

Now run a simple route

import javax.enterprise.context.ApplicationScoped;

import org.apache.camel.builder.RouteBuilder;

@ApplicationScoped
public class CamelRoute extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        from("couchbase://http://localhost:8091?bucket=beer-sample&username=admin&password=password")
                .to("log:info");
    }
}

This will fail badly with

2021-11-10 12:08:34,679 WARN  [org.apa.cam.com.cou.CouchbaseConsumer] (Camel (quarkus-camel-example-http-log) thread #0 - couchbase://http://localhost:8091) Consumer Consumer[couchbase://http://localhost:8091?bucket=beer-sample&password=xxxxxx&username=admin] failed polling endpoint: couchbase://http://localhost:8091?bucket=beer-sample&password=xxxxxx&username=admin. Will try again at next poll. Caused by: [com.couchbase.client.core.error.DecodingFailureException - Deserialization of content into target class com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode failed; encoded = ["21st_amendment_brewery_cafe"]]: com.couchbase.client.core.error.DecodingFailureException: Deserialization of content into target class com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode failed; encoded = ["21st_amendment_brewery_cafe"]
	at com.couchbase.client.java.codec.JacksonJsonSerializer.deserialize(JacksonJsonSerializer.java:137)
	at com.couchbase.client.java.view.ViewRow.lambda$decode$0(ViewRow.java:126)
	at java.base/java.util.Optional.map(Optional.java:265)
	at com.couchbase.client.java.view.ViewRow.decode(ViewRow.java:122)
	at com.couchbase.client.java.view.ViewRow.keyAs(ViewRow.java:77)
	at org.apache.camel.component.couchbase.CouchbaseConsumer.poll(CouchbaseConsumer.java:121)
	at org.apache.camel.support.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:190)
	at org.apache.camel.support.ScheduledPollConsumer.run(ScheduledPollConsumer.java:107)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode` (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
 at [Source: (byte[])"["21st_amendment_brewery_cafe"]"; line: 1, column: 1]
	at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67)
	at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1764)
	at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:400)
	at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1209)
	at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserialize(AbstractDeserializer.java:274)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:322)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4593)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3609)
	at com.couchbase.client.java.codec.JacksonJsonSerializer.deserialize(JacksonJsonSerializer.java:134)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
oscerdcommented, Nov 12, 2021

Thanks @jamesnetherton

Definitely not a problem of camel or camel-quarkus.

0reactions
oscerdcommented, Nov 12, 2021

Excluding jackson-databind from camel-jackson, make it works.

Ok they’re shading databind.

Read more comments on GitHub >

github_iconTop Results From Across the Web

apache/camel-quarkus · GitHub - Couchbase native support
I'm currently work on a quarkus extension, because my microservice use couchbase (version 2.7.16). Camel uses couchbase java-client 3.0.6.
Read more >
Camel Quarkus extensions reference
Extension Artifact JVM since Native since Support level ActiveMQ camel‑quarkus‑activemq 1.0.0 1.0.0 Stable AMQP camel‑quarkus‑amqp 1.0.0 1.0.0 Stable ArangoDb camel‑quarkus‑arangodb 1.1.0 1.1.0 Stable
Read more >
Chapter 70. Couchbase Component Red Hat Fuse 7.9
Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup...
Read more >
CXF Extension for Quarkus :: Quarkiverse Documentation
CXF implements the Java API for XML Web Services (JAX-WS) which makes building web services easy. CXF supports a variety of web service...
Read more >
Changelog - Google Git
CR1 + Upgrade Camel to 3.16.0 #3653 (jamesnetherton); Fix typo in docs & Added tests for NotNull ... Camel-quarkus-couchbase Consumer is not working...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found