Issue with Apache camel 2.4 version - apache-camel

This is an issue when I change the camel version from 1.6 to 2.4.
I wanted to use a method userOriginaLmessage which was not supported in 1.6. Hence I starte using camel 2.4 version. The code is getting compiled. But when I deploy it in Fuse ESB environment I get below error.
Unexpected exception parsing XML document from class path resource [camel-route.xml]; nested exception is java.lang.VerifyError:
Can you please help me on this ? What can be the issue.
Thanks in advance for the help.

Is there any more error message showing up than what you posted? Seems a bit lacking in information :)
There were a ton of changes from 1.6 to 2.4. You should take a look at the Camel 1.x -> 2.x migration guide if you have not done so already:
http://fusesource.com/docs/router/2.2/migration/index.html

Related

JAXB ClassNotFoundException com.sun.xml.bind.v2.ContextFactory when hot-deploying camel routes

Yes I know, there are numerous questions and answers since JAXB was removed from JDK 11. But this one is specific.
I've a Wildfly Server (tested with 18.0.1 and 16.0.0) running with the wildfly-camel subsystem 11.0.1 patch applied. The patch installs Camel 2.25.0
Deploying and Hot-Deploying (while the server is up) Camel routes works fine!
Until I deploy Liferay on the same server :-(
Then the Hot-Deploy of a camel route gives me the annoying
[java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory from [Module "org.apache.camel.spring" version 2.25.0...
exeption.
No matter if I run the server on JDK 11 or JDK 8! Liferay 7.3.2 claims to be runnable on both JDK versions so I guess it has something to with the way Liferay was build.
Reading this article
http://www.descher.at/descher-vu/2019/01/java-11-jaxb-and-osgi/
that the JAXB topic is very complex and far from being resolved.
Question:
How can a deployed application destroy otherwise working classpath resolutions?
And more important:
How to fix it?
I tried removing the 2 jars in question jaxb-api.jar and jaxb-impl.jar from Liferay. But that didn't help.
Turns out that the root cause of the error is a missing dependency to com.sun.xml.bind in the org.apache.camel.spring module of the wildfly-camel patch.
I filed the issue in detail.
Looks like Liferay has nothing to do with it. Because in theory jboss-modules should separate the deployments.

Apache Camel 3.1.0 Logging Issue

While I was porting Apache Camel Version from 2.x to 3.1.0 with Camel REST DSL and Spring Boot, I am facing the below logging issue.
My logging key is defined in application.properties i,e mymessage=Hello World.
Inside route when I am using it as
.log(LoggingLevel.INFO, "${properties:mymessage}") [Works in both 2.x and 3.1.0]
.log(LoggingLevel.INFO, "{{mymessage}}") [Works only in 2.x]
My problem is I have lots of logging statements using {{xxx}} which is unfortunately not working during 3.1.0 upgrading process.
Am I missing any specific setting.
I tried using #PropertySource by putting the key in the separate file also tried it with spring cloud config nothing works.
Any help would be highly appreciated.
This has been solved and will be part of 3.2.0, see https://issues.apache.org/jira/browse/CAMEL-14651

Cannot find org.apache.camel.support.processor.validation.PredicateValidatingProcessor in camel version 3

I'm trying to migrate my Apache Camel 2.10.4 apps to 3.0.0M4. After much effort, I'm stuck at this problem which seems to complain about missing dependency
Java.lang.NoClassDefFoundError: org/apache/camel/support/processor/validation/PredicateValidatingProcessor.
Looking through the camel version 3.0.0-M4 but I cannot find any jars which have the above class. Googling doesn't turn up anything with regards to the new processor path org.apache.camel.support.processor. I appreciate the help in resolving this issue!
Make sure you have came-jaxp on the classpath - and also make sure your classpath have all the same version of Camel.
I have also added the missing camel-jaxp to the release package of Apache Camel so its included in the next release.
the package path is wrong.
correct path - org.apache.camel.support.processor.PredicateValidationException.

Including camel-test-spring causes NoClassDefFoundError for DefaultParameterNameDiscoverer

I have a Camel project using Maven to build and manage dependencies. My project depends on Camel component versions 2.14.0. I've matched Spring dependencies with Camel and use Spring component versions 3.2.11.RELEASE. However, if I include camel-test-spring version 2.14.0 as a dependency in the test scope it pulls in both spring-beans version 4.0.7.RELEASE and spring-expression 4.0.7.RELEASE into the runtime scope, which result is my application throwing java.lang.NoClassDefFoundError: org/springframework/core/DefaultParameterNameDiscoverer. Oh, btw, the application boots from a Java main method with org.apache.camel.spring.Main.
Adding exclusions for both spring-beans and spring-expression into the POM dependency for camel-test-spring resolves the runtime exception but I'm not sure if this is the right thing to do. Does anyone have more insight into why camel-test-spring 2.14.0 depends on the 4.0.7.RELEASE versions of spring-beans and spring-expression when most (all?) the other Camel 2.14.0 components seem to depend on 3.2.11.RELEASE versions of Spring components?
Regards,
Matt
Please you camel-test-spring3 which support Spring 3.x instead of camel-test-spring (for Spring 4.0.x).

Suggester configuration

I am a beginner i already installed solr 3.4 using Tomcat. i installed it for my undergrad thesis . i am reading the cookbook 3.1 and Lucid imagination 1.4. but i am facing problem in configuration suggester component which i found in cook book 3.1. I have written the xml code in config xml file and i tried also the solr wiki code but, it is giving me error when i am quering http://localhost:8983/solr/suggester/?q=a . My question is
. how could i resolve this
. Does 3.4 version have suggester component, though i have checked.
. Is there any version clash issue in solr
It will be great help for me to proceed if you enlighten.
Suggester was included with Solr 3.1 and above.
Check out the references, which explains it better -
http://lucidworks.lucidimagination.com/display/solr/Suggester
http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/

Resources