Create Bean java.lang.ClassNotFoundException #1060
-
I want to use integration using Camel Karavan. The essence of integration is to receive messages from REST service and transfer them to RabbitMq. To create a connection to RabbitMq I made Bean. Here is my yaml file: - rest:
id: rest-6f81
post:
- id: post-78d2
path: /test
to: direct:internal
consumes: application/json
- beans:
- constructors: {}
name: RabbitMQConnectionFactory
properties:
host: 'localhost'
port: '5672'
username: Test
password: Test
type: org.springframework.amqp.rabbit.connection.CachingConnectionFactory
- route:
id: route-d7a0
nodePrefixId: route-425
from:
id: from-b82a
uri: direct
parameters:
name: internal
steps:
- log:
id: log-90a7
message: ${body}
- to:
id: to-bcd8
uri: spring-rabbitmq
parameters:
exchangeName: test
testConnectionOnStartup: true
connectionFactory: '#bean:RabbitMQConnectionFactory' At startup. jbang "-Dcamel.jbang.version=4.3.0" camel@apache/camel run * I get the following error logs:
I think the key problem is this: Can anyone tell me how to fix this? I'm new to Camel and really don't understand what might be missing. Maybe I'm missing something small. I use camel-karavan as VS Code extension. Same error when running through docker. UPD. Added file application.properties camel.karavan.project-id=test
camel.karavan.project-name=test
camel.karavan.project-description=bnjbnln
camel.jbang.gav=org.camel.karavan.demo:test:1
camel.jbang.runtime=camel-main
camel.jbang.version=4.3.0
camel.jbang.dependencies=camel-console,camel-platform-http-main
camel.jbang.jib-maven-plugin-version=3.4.0
camel.server.enabled=true
camel.server.healthCheckEnabled=true
camel.server.devConsoleEnabled=true
camel.main.tracingStandby=true
camel.main.autoConfigurationFailFast=false
camel.context.dev-console=true
camel.health.enabled=true
camel.health.exposure-level=full
jkube.version=1.15.0
jib.from.image=gcr.io/distroless/java17@sha256:3a4ea21bd7b412b8b6ae61313b39337d8f03bb6844013810e8e4625d8c765edb
spring.rabbitmq.password=Test
spring.rabbitmq.port=5672
spring.rabbitmq.host=localhost
spring.rabbitmq.username=Test |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Can you add the JAR to the dependencies as the bean is created before the route which has the hint that spring-rabbitmq component is in use. So its a chicken vs egg. So you can add it to the dependencies:
If you use a kamelet then it has the right set of dependencies automatic. |
Beta Was this translation helpful? Give feedback.
-
Camel 4.4 will know about the rabbit CF so when you upgrade then it will work OOTB |
Beta Was this translation helpful? Give feedback.
Can you add the JAR to the dependencies as the bean is created before the route which has the hint that spring-rabbitmq component is in use. So its a chicken vs egg.
So you can add it to the dependencies:
If you use a kamelet then it has the right set of dependencies automatic.