Marat Vildanov
Marat Vildanov

Reputation: 1

Karaf switch to another version bundle

I've got two versions (1.0 and 2.0) in karaf of the same war bundle containing the servlet running on the same address. I'm running it with this command:

bundle:install -s "webbundle:file:///home/marat/projects/webmodule/target/webmodule-1.0.war?Bundle-SymbolicName=Runner&Web-ContextPath=/sample"

And both war bundles are shown Active in Karaf webconsole.

I have an app that pings the address http://localhost:8181/sample/hello (the servlet) every 10ms (the app sends GET requests). Firstly the app is getting the answers from the servlet represented by war v1.0. If I stop the bundle containing war v1.0 I expect that karaf automatically switches the requests sent to address http://localhost:8181/sample/hello to war v2.0 since the servlet in that bundle is on the same address as of war 1.0. The app gets this response instead:

java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8181/sample/hello

When I restart a pinger app then it successfully connects to war v2.0.

What can I do to make Karaf switch without automatically to war v2.0 when I stop war version 1.0?

Upvotes: 0

Views: 50

Answers (1)

Federico Cerruto
Federico Cerruto

Reputation: 251

I think the second war is not deployed, you can't register the same endpoint twice.

Upvotes: 0

Related Questions