Deploying camel spring application in Apache Karaf 4.2.0 - apache-camel

I am trying to deploy camel spring application in apache karaf. I am using maven to resolve the dependencies. The application runs fine in Intellij but when I deploy the application (along with all the project dependencies) in karaf the application won't start.
Can anyone tell me what is the correct way to deploy camel spring application in karaf?
And also the best approach in resolving the project dependencies?
Camel-version: 2.16.5
Karaf: 4.2.0

If the application is not starting, then it might be waiting for some resolvable dependency. Check the log and install the dependency manually using feature:install. Also ensure all libraries are properly mentioned in pom.xml

Related

How can I deploy my angular 2 app on tomcat or jboss?

I have built a basic angular 2 app. However I need to deploy it on Jboss or Tomcat as I need to use it along with my Java EE application.
Thanks for your help.
You would use a bundler such as angular-cli or webpack to create the production bundle which is then served by the HTTP server. The bundler creates all required file that go into the htdocs directory. Normally Angular apps are completely decoupled from your backend server so there shouldn't be any JBoss or Tomcat specifics.
The Angular team are going to increasingly focus on angular-cli as the premier bundling solution so it might be a good idea to start there.
If you are using angular-cli you can use ng build command. It creates all static files for deploy Angular2 app into the dist folder. You must copy and paste them in webresources folder of your Web Application (WAR). At the moment I am looking for how to deploy this files easier.

Is it possible to use camel-2.16.2 with servicemix 5.6.0 and karaf -2.4.4?

In our application we have encountered impotency issue which is fixed by https://issues.apache.org/jira/browse/CAMEL-9480. we are currently using service mix 5.5.0 with following dependencies.
Activiti 5.17.0
Apache ActiveMQ 5.11.1
Apache Camel 2.15.2
Apache CXF 3.0.4
Apache Karaf 2.4.3 .
So in-order to get fix for CAMEL-9480, i tried to upgrade camel to 2.16.2 by doing service mix upgrade to 5.6.0 which supports following dependencies
Activiti 5.19.0.2
Apache ActiveMQ 5.12.3
Apache Camel 2.16.2
Apache CXF 3.1.4
Apache Karaf 2.4.4
after upgrade i am getting following error during deployment
[caused by: Unable to resolve 295.0: missing requirement [295.0] osgi.wiring.package; (&(osgi.wiring.package=org.eclipse.jetty.util.log)(version>=9.2.0)(!(version>=10.0.0)))]
when i checked camel-jetty-2.16.2.pom,it uses camel-jetty9 and in karaf features its mentioned as below.
<details>camel-jetty9 intend to work with jetty9, so this feature only works in the karaf container which support jetty9, e.g. karaf 4.x</details>
so is it possible to use camel-2.16.2 with karaf 2.4.4 or we need upgrade to karaf 4.x?
There are two bundles and two features:
camel-jetty which support jetty8 (and Karaf 2/3)
camel-jetty9 which support jetty9 and Karaf 4
However, It depends too on the other camel features you use. Some feature uses a feature jetty without versions, other use directly camel-jetty9 or camel-jetty, etc. Sometimes, It necessary to rewrite some feature to fix a version range, but in most case, it works out of the box.

camel blueprint force usage of log4j

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.

Single page application using grunt and tomcat

We are building single page application, using AngularJS and Spring Rest services along with spring boot. For front end build we are using grunt and for server site build maven. But we are not sure hove to build single WAR file which contains build out put from gunt and our java output.
Deployment server Tomcat.
Regards
Mahesh
You can give a try using maven-grunt plugin.
https://github.com/allegro/grunt-maven-plugin
I have the exact same setup. I am invoking grunt from maven.
From maven I invoke frontend-maven-plugin it actually downloads node binary and all node packages. And invokes grunt and bower. This essentially helps me build my project in any environment without installing node(even in Jekins server). Configure warSourceDirectory to read grunts output.

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).

Resources