Ask Your Question
1

Deploy a bundle without restarting the controller

asked 2016-08-09 03:41:09 -0700

danielZt gravatar image

One of the good things about OSGi is that it allows to update and deploy bundles without restarting Karaf.

During development I would like to update the bundle without having to restart Karaf.

I tried to deploy several updated bundles by placing them in the deploy folder. The problem is the new code is never executed if I do not reboot Karaf.

The error is:

Failed to remove bundle org.opendaylight.hello.impl_1.0.0.SNAPSHOT [195]
java.lang.IllegalStateException: Error while copying old configuration from ModuleInternalInfo [name=ModuleIdentifier{factoryName='hello', instanceName='hello-default'}] to org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hello.impl.rev141210.HelloModuleFactory@50e77f8f

After a restart everything is fine.

Is there something I am missing? Are there java methods I have to change to facilitate the hot-installation?

Context: Beryllium

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2016-08-11 09:17:30 -0700

This is a hard problem, and so far unresolved in OpenDaylight. While in theory OSGi allows hot reloading of bundles, in practice those bundles would have to be implemented in a way that they clean up after themselves properly, and initialize properly, which is not always the case. Even Eclipse, the poster child of OSGi based applications will ask you to restart it when installing or upgrading plugins.

See this thread about some discussion on the topic.

edit flag offensive delete publish link more
0

answered 2016-08-09 04:14:32 -0700

KushalKumar gravatar image

Is there any old bundle present in OSGI ?. If it is remove it first using bundle:uninstall <bundle-id>, then install your bundle by placing in deploy folder.

A better way could be, bundle:install -s file:/<full path="" to="" bundle="" jar="">. This will update the previous one directly.

edit flag offensive delete publish link more

Comments

I tried to uninstall the bundle and then to deploy the updated one but I get a `WARN | /assembly/deploy | fileinstall | 7 - org.apache.felix.fileinstall - 3.4.2 | Failed to update bundle: <bundle name=""> with ID 194. The bundle has been uninstalled` and it does not work.

danielZt ( 2016-08-10 01:34:30 -0700 )edit

Also the bundle:install command you have suggested produces this ERROR org.eclipse.osgi.framework.internal.core.Framework$DuplicateBundleException: Bundle "org.opendaylight.<bundle>" version "1.1.3.SNAPSHOT" has already been installed from: mvn:org.opendaylight.<maven_repo>

danielZt ( 2016-08-10 02:41:49 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2016-08-09 03:41:09 -0700

Seen: 138 times

Last updated: Aug 11 '16