I have a servicemix module, which is basicly a camel based route.
It works fine during development and also when deploying in older version of FUSE. However, when deploying in a later version of FUSE, I get
Caused by: java.lang.NoSuchMethodError:
com.company.integration.MyRouteBuilder.errorHandler(Lorg/apache/camel/builder/ErrorHandlerBuilder;)Lorg/apache/camel/builder/RouteBuilder;
I do not quite get why :-)
The old version used camel 2.6, the new uses Camel 2.9. Both have RouteBuilder.errorHandler as far as i can tell..
br
I wouldn't spend too much time trying to figure that out myself...I'd just start testing with the same version of Camel that I'm going to deploy it under...otherwise even if you get around this issue, others will likely pop up, etc.
If you do have a requirement to run multiple apps that depend on different versions of Camel, then OSGi supports this as long as install the necessary camel bundle versions and setup your applicaiton bundle manifests correctly, etc.
Reinstalling (or rather, recreating the instance) helped.
Related
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.
I'm facing an irritating behavior from my karaf server: Title says it all, installed bundles get restarted when I use a feature: install command.
* Project context *
Most of the bundles I deal with are camel routes, the other ones are common tools, shared by the routes.
As a result, I have a 2 level project: a common part that is installed first, and the camel routes that all depends on the common part (dependent on Maven point of view).
* Scenario *
start a fresh instance of karaf
install the common features
install a camel route feature: no troubles so far
install a second camel route feature: the bundles from the previously installed feature will restart.
* Breakthrough made *
All the bundles declared a common config file, with the option "update-strategy=reload". This means that karaf would notify each bundle of any modification of this file, and the bundle would restart to take it into account.
As a matter of fact, when I installed a new bundle with a dependency on this file, it would be read in order to initialize the bundle's properties, and karaf considered it to be a file modification. Therefore, installing a new bundle made all the others restart.
As you expect, I dealt with that problem by removing the update-strategy option, and most of my features are now clean.
* Leftovers *
BUT, some of them still holds the bug: Installing any of those troublesome features will have all the other installed features restart. This is a ONE-WAY problem, installing a clean bundle will not have the troublesome ones restart.
I checked anyway, but no other config file could be responsible for that.
Any help or advice would be appreciated, I can also provide anonymized examples of any file that would help you understand, like an osgi-context or a feature's pom.xml
One last thing: my features regroup around 50 bundles each, therefore I can barely understand the karaf logs, and I can't pinpoint which bundle is restarted first.
Thanks for your time and attention!
I think there are some misconceptions in what you describe.
update-strategy=reload does not cause a bundle to reload. It causes a blueprint context to reload.
You should also not share the some config between bundles it is known to mess up you deployments.
There are also other reasons why a bundle may restart. A karaf feature install tries to provide the optimal set of bundles that is needed overall in karaf to satisfy the set of currently installed features.
A typical case is that you first install feature with a bundle containing an optional package import. At this moment it can not provide the package. Then you install a second feature that provides an exporter of the package. Now the optional dependency of the bundle can be satisfied and the bundle will be restarted by karaf.
You can look into such cases by using feature:install -v . This will show you which bundles are restarted and also why. So maybe this can help you to debug why the restart happens.
I´m pretty new to gradle and currently there is question that bugs me. The situation appears as follows: Based on a bower technology stack I implemented an Angular App. The app as it is doesn't change nor has it to be built in any way since there are just static javascript and HTML pages. In my opinion the used versions of angular, bootstrap and other libraries should also stay the same due to compatibility of the single libraries so these files also shouldn't change. Is this a correct behavior or should I get at least the latest build of the used libraries version as I deploy the application?
Also less is used in the application. Is there a way to compile the CSS every time I run the gradle build file or should I deliver just the compiled and finished CSS file?
As a result I´m also not quite sure if it's recommended at all using gradle to deploy an "static" angular application.
I hope someone out there can help me to answer the questions above. As you can guess, I´m not very experienced at deploying of such angular applications since this is my first project with this kind of problem.
This goes for all package managers, not just gradle but npm, gem, nuget, maven, whatever.
Use static dependancy version numbers. Otherwise you will end up finding breaking dependencies in QA or Prod rather than production.
This means you need to be aware of security fixes in your dependencies.
When you need a feature or fix in a new version of your dependencies, unlock the versions, rebuild and test in dev. Re-lock the dependencies and send to QA for verification.
Has anyone been able to use camel-blueprint together with logback? It seems that there are dependencies in camel blueprint which forces you to use log4j even though the log4j dependencies are removed from the pom. After running the project it starts to download the slf4j-log4j12 and then then complains of multiple bindings because it finds both log4j and logback.
I did the same with a camel java project and it worked fine to switch to logback. Does camel-blueprint force you to use log4j as its logging implementation?
Answer found via nabble forum in through discussion with the camel community. For more details go here:
http://camel.465427.n5.nabble.com/camel-blueprint-force-usage-of-log4j-td5772826.html#a5772852
Essentially there are certain dependencies in the maven plugin which uses log4j. For production in JBoss Fuse or Karaf, its Pax logging.
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).