How do I add camel-http4 to a Karaf features.xml file? - apache-camel

If I add
<bundle>mvn:org.apache.camel/camel-http4/2.15.1</bundle>
Then I get the following error below.
What is the right way to be able to use camel-http4 from within my blueprint camel routing within Karaf? How should I modify features.xml?
org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=social_importer.kar; type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=social_importer.kar)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))" [caused by: Unable to resolve social_importer.kar/1.0.0.SNAPSHOT: missing requirement [social_importer.kar/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=org.apache.camel.camel-http4; type=osgi.bundle; version="[2.15.1,2.15.1]"; resolution:=mandatory [caused by: Unable to resolve org.apache.camel.camel-http4/2.15.1: missing requirement [org.apache.camel.camel-http4/2.15.1] osgi.wiring.package; filter:="(&(osgi.wiring.package=javax.servlet)(version>=2.5.0)(!(version>=4.0.0)))"]]
Thanks, so far I have discovered with your help the following helps, still investigating.
karaf#root()> feature:repo-add mvn:org.apache.camel.karaf/apache-camel/2.15.2/xml/features
Adding feature url mvn:org.apache.camel.karaf/apache-camel/2.15.2/xml/features
karaf#root()> feature:install camel-http4
karaf#root()> feature:install camel-http
karaf#root()> feature:install camel-ahc

You can install the Camel components from the karaf shell using
features:install camel-http4
That install all the bundles of the feature needed for using camel-http4. And after doing this once, you can install your own bundles.
If you have your own features.xml file, you can refer to other features with
<feature>camel-http4</feature>
And you may need in the top of your features.xml file to refer to the Camel features, such as Camel does to others here: https://github.com/apache/camel/blob/master/platforms/karaf/features/src/main/resources/features.xml#L20

Related

React App Compile Errors After Installing Express and Cors

I am working on a React app that focuses on getting an mp3 file from a server but I am getting a CORS error. While trying to follow a tip to enable CORS I started off by installing express and cors via npm ('npm install express' and 'npm install cors'). However I am now getting 30 compile errors. Here is one such error message:
ERROR in ./node_modules/body-parser/lib/read.js 24:11-26
Module not found: Error: Can't resolve 'zlib' in '/home/brian/Projects/music-player/node_modules/body-parser/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "zlib": require.resolve("browserify-zlib") }'
- install 'browserify-zlib'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "zlib": false }
How do I solve this issue and what are these webpacks and polyfills? Thanks in advance for helping.
Unfortunately, that's not a lot of information on how your app is set up. I guess you are trying to install express (to set up your server) inside your frontend app. If that is the case I would suggest you uninstall it from react app and install it in another directory.
However if the issue still persists this is what works for me. On my side, there was an issue with npm cache.
try to clean your npm cache: npm cache clean --force
If that does not work:
delete your node modules
delete package-lock.json file
use npm install to get the updated node modules and new package-lock.json file
Polyfill is used to implement features on old browsers that do not support a specific feature (for example array.includes() is not supported by Internet Explorer 11)
Webpacks is a module bundler. Its purpose is to compile JavaScript modules and it basically takes your project dependencies (package.json) and generates a dependency graph.
Now regarding the CORS issue. Do you own the server you are trying to retrieve mp3 data? Then you should allow cross origin from that server, setting appropriate headers in the server response: Access-Control-Allow-Origin: *
If you do not own, or you do not have access to the server, you can set up your own server to handle api calls and retrieve data from another server without any CORS issue. You can do it with Express and then request the resource via your server, and send the response back to your frontend.
Just note that you cannot fix the CORS issue directly from the frontend!

Failed to deploy artifacts: could not find artifact npm

I am a new aspirant of Devops.
Most of the blogs addressed related to "404 error Not found" are of maven projects.
Can anyone explain how to resolve it for a react project?
I am trying to deploy a react project onto nexus through ci pipeline[Jenkins].
For deployment, while configuring
//Following some blogs I tried these 2 ways:
Configuring .npmrc file
Altering package.json file
But neither have worked and still halted with the error. Now, I need:
What can be the cause of this error?
Are there any other ways to resolve the error? In perspective of npm format projects
Please help me
Thanks in advance

Trying to import/convert a CRA app into Razzle JS

I'm new to Razzle and I'm trying to learn it. I took a Material-UI dashboard app and am trying to "import" or "convert" it into my blank-ish razzle app.
I copied the contents of the CRA app's ./src into my razzle source at the right spot, referenced the right components, etc.
At first, Razzle didn't like the #import statements in the CRA repo. I fixed that by using npm to install razzle-plugin-scss, which got me past that issue. But now I'm hitting something I don't understand at all (nor even how to go about finding a resolution):
{ Error: Cannot find module 'css-loader/locals'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15)
at Function.resolve (internal/modules/cjs/helpers.js:19:19)
at module.exports (/home/user/my-project/node_modules/razzle-plugin-scss/index.js:106:31)
at runPlugin (/home/user/my-project/node_modules/razzle/config/runPlugin.js:26:10)
at plugins.forEach.plugin (/home/user/my-project/node_modules/razzle/config/createConfig.js:549:16)
at Array.forEach (<anonymous>)
at module.exports (/home/user/my-project/node_modules/razzle/config/createConfig.js:548:13)
at main (/home/user/my-project/node_modules/razzle/scripts/start.js:48:22)
at processTicksAndRejections (internal/process/next_tick.js:81:5) code: 'MODULE_NOT_FOUND' }
I looked in css-loader and found that you (maybe?) need to instruct it to export locals with the exportOnlyLocals: true webpack directive. I'm not sure how to do that in Razzle. I found this page that shows an example of how to configure it through razzle.config.js, but it assumes more knowledge than I have.
How can I configure webpack in Razzle to ... do something? ... to tell the underlying webpack plugin css-loader to load locals?
Any help is much appreciated.
Update
It looks like this is caused by a breaking change in css-loader when it moved to v2.0.0. I still don't know what the solution is, but that's getting me closer.
I ended up reverting to css-loader version 1.0.1 to fix the problem.

Maven build on karaf - opendaylight

i am new to open daylight project.. i want to install open daylight controller and integrate my yang model with this .. so if i execute my POST query on controller it get responded.
i went through this tutorial
https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin::Running_controller_with_the_new_OF_plugin
to start karaf - but while building maven in the git clone ... cd
integration/distributions/extra/karaf mvn clean install.. step my
build is struck.. It remains in '[DEBUG] Using connector
WagonRepositoryConnector with priority 0 for
..nexus.opendaylight.org/content/repositories/public/ Downloading:
...nexus.opendaylight.org/content/repositories/public/com/h2database/h2/1.4.185/h2-1.4.185.jar'
and build get failed.
Please help me resolve this issue
I don't know if I have understood correctly your question, but you can clone opendaylight controller project repository from:
https://github.com/opendaylight/controller
Just try with:
git clone https://github.com/opendaylight/controller.git
and once it be downloaded, you can try to compile it executing:
mvn clean install
I will add controller to .m2 repository.
Anyway, if you want to add any controller feature into your project, you can add it into your features.xml file, as follows:
<repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
That will add mdsal feature to your project.
And modify features/pom.xml with the next dependency:
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>mdsal-artifacts</artifactId>
<version>${mdsal.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
I hope that my info helps you. Let me know if you need more info.
Regards

Rails 4: savonrb > wasabi - Dependency conflict for mime-types version

I want to install the savon gem to parse some WSDLs. After including it in the Gemfile and running bundle install, it is giving the following message:
Bundler could not find compatible versions for gem "mime-types":
In Gemfile:
savon (~> 2.8.0) ruby depends on
wasabi (= 3.3.0) ruby depends on
mime-types (< 2.0.0) ruby
mail (>= 0) ruby depends on
mime-types (2.4.3)
I can't remove the mail gem to resolve this dependency as my actionmailer depends on it. And besides, it doesn't seem to be healthy solution to resolve such dependency conflicts.
So can anyone help me on this? Googling didn't help much.
If you only need to parse a WSDL you could use the current version (3.3.1) of wasabi by itself, which does not depend on the mime-types gem anymore.
If you need savon, there is a pending issue to update the dependency to the next minor version of wasabi, to resolve this issue. Since this has not happened yet, you may clone this repo, do it yourself (replace 3.3.0 with 3.3.1 in this file) and install your own version:
gem 'savon', github: 'xxx/myrepo'
until savon is updated.

Resources