karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gareth <gareth.o.coll...@gmail.com>
Subject Startup Race Conditions For FileInstall/Blueprint
Date Tue, 02 Oct 2012 15:47:42 GMT

I have some questions about FileInstall/Blueprint in apache karaf 2.2.9.

I created for myself a custom karaf installation that by default puts a
blueprint file into the deploy directory which is available on first

Unfortunately I found a small race condition with doing this. Sometimes, on
first startup, fileinstall will try to process the file before blueprint is
initialized so I see the following error:

2012-10-01 18:39:44,386 | ERROR | []:[] | pw-133-61/deploy |
BlueprintDeploymentListener      | rint.BlueprintDeploymentListener   65 |
12 - org.apache.karaf.deployer.blueprint - 2.2.8 | Unable to build blueprint
application bundle
java.net.MalformedURLException: unknown protocol: blueprint
        at java.net.URL.<init>(URL.java:395)[:1.6.0_29]
        at java.net.URL.<init>(URL.java:283)[:1.6.0_29]
        at java.net.URL.<init>(URL.java:306)[:1.6.0_29]

To get around this issue in the past (apache karaf 2.2.5), I had setup
fileinstall to delay checking the deploy directory:

felix.fileinstall.poll    = 30000
felix.fileinstall.start.level = 80
felix.fileinstall.noInitialDelay = true

Whilst this works fine on karaf 2.2.5, when I update to karaf 2.2.9 this
causes me problems on karaf restarts. This configuration now causes my
bundle to be started then stopped/started again on the first check of the
deploy directory (fileinstall refreshes the bundle even though there has
been no change). I suspect this new behaviour is caused by the following
change in felix fileinstall 3.2.2:

    * [FELIX-3398] - Track new versions of artifact listener and optionally
update all bundles when a new version is detected

Given all this information, I have the following questions:

(1) Am I doing anything wrong here? Is it bad form for me to put a file in
the deploy directory before first karaf startup? I am putting it in the
deploy directory rather than creating a bundle so I can mess with the
blueprint file if needed. I put it in the deploy directory on initial start
as this application is static - I am not going to be updating bundles after
initial install.

(2) Is it a bug for felix fileinstall to refresh the bundle even though
nothing has changed...or should I just be accepting that it will always do
this? I ask because, as my application is static and initializes a lot of
resources, I hadn't planned to worry too much about clean start/stop/start
(I only run this app in OSGi as it shares a lot of code with my real OSGi

Any suggestions would be greatly appreciated.

thanks in advance,


View this message in context: http://karaf.922171.n3.nabble.com/Startup-Race-Conditions-For-FileInstall-Blueprint-tp4026233.html
Sent from the Karaf - User mailing list archive at Nabble.com.

View raw message