How to setup karaf so that i don't need to build my project and restart karaf again and again for the updates in code?
I am unable to achieve this in my current project. I have tried placing features.xml in /deploy folder but no use, it is flushed every time after build.
Asked
Active
Viewed 1,791 times
1

Vadim Kotov
- 8,084
- 8
- 48
- 62

Sanket Shirode
- 57
- 1
- 9
1 Answers
0
See my answer to this question. Basically you deploy your project to maven, install the feature from maven and set karaf to auto update snapshot changes from your local repo.
This way you can even update while you are in a remote debug session.

Christian Schneider
- 19,420
- 2
- 39
- 64
-
Thanks @Christian Schneider Though auto update is not working as i need to manually update using bundle id but achieved the desired thing. One more problem i'm facing is getting errors when i update using id like **unable to initialize bean** is this because of problem in my jar or something else?? – Sanket Shirode Feb 16 '18 at 06:25
-
Sounds like a problem in your bundle. You can type diag to get some infos. – Christian Schneider Feb 16 '18 at 07:17
-
About the auto update. This only works if you use snapshot versions (which you should do) like 1.0.0-SNAPSHOT and it only works with the local repo. So you have to do mvn install for a local project. – Christian Schneider Feb 16 '18 at 08:57
-
1When i deploy the bundle first time it works but when i make changes, rebuild and then i use update command with bundle id it throws error. Still there is possibility of having error in my bundle?? – Sanket Shirode Feb 16 '18 at 09:43
-
Regarding auto-update i have used snapshot versions same as u mentioned above and added the bundle id to watchlist using bundle:watch command still it was not working – Sanket Shirode Feb 16 '18 at 09:46
-
For auto update I normally just use bundle:watch *. How do you install the bundle in the first place? You must use a mvn url. What error do you get when you update manually? Also take a look at the logs using log:tail. – Christian Schneider Feb 16 '18 at 10:14
-
I am using mvn url for bundle installation and when i manually update i'm getting unable to open zip bundlefile error in logs – Sanket Shirode Feb 20 '18 at 04:28
-
Exception in opening Zip file error, caused by file not found as it is trying to open the old bundle file which is lost after update and new one is created – Sanket Shirode Feb 20 '18 at 05:16
-
This might be an error in karaf or pax-url maven. Can you open a jira issue in karaf? Please also add your system. – Christian Schneider Feb 20 '18 at 09:01
-
Hey actually i found out that the update command is not updating the actual content of bundle file only folder number is incremented under bundleId folder – Sanket Shirode Feb 20 '18 at 09:57