I have a fragment bundle and associated host bundle.  With Karaf (3.0.1)
running, I install the fragment then host and both show as "Installed".  I
then start the host and the fragment shows as "Resolved" and the host as
"Active" and they also show as connected to each other.  All is fine.

If I restart Karaf with this configuration, all seems fine and both bundles
get back to the same state.

I actually have a second fragment bundle that also attaches to the same
host.  If I install the two fragments and then install the host, all are
"Installed", and if I start the host the fragments are now "Resolved" and
the host is "Active".  All is well.

However, now when I restart Karaf, sometimes the host bundle starts
successfully and sometimes it doesn't.  When it doesn't, the fragment
bundles are "Resolved" and indicate they are attached to the right host, and
the host indicates it is attached to the fragments, but its status is
"Failure".  The error in the log is:

20140507 07:35:39.011 [ERROR] FelixStartLevel |
19:org.apache.aries.blueprint.core |
org.apache.aries.blueprint.container.BlueprintContainerImpl | Unable to
start blueprint container for bundle <host bundle name>
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to
load class <class from 2nd fragment> from recipe BeanRecipe[name='<bean ID
from second fragment blueprint XML>']

The class mentioned is present in the second fragment bundle, it does work
on the install/start and several Karaf restarts after all.  But what is
interesting is that it always seems to be the second fragment that has the
issue and once it starts failing, it always fails (just a handful of tests
though).

Thinking that it may have something to do with start orders, although the
fragments don't get started and only the host gets started, I left the
fragment start levels at the default 80, but changed the host start level to
81.

I tried this first just changing the level but not reinstalling anything and
it worked on the first Karaf restart, but failed the same way with the
second restart.  I later tried this again and it failed on the first Karaf
restart not even working once.

When the problem occurs, just stopping/starting the host bundle doesn't seem
to help.  I seem to have to uninstall all three bundles and reinstall them
to get it working again.

What might be the problem and how can I get it working where the host bundle
properly starts on a Karaf start?  Having to manually install things on a
Karaf start is not going to be workable in a production environment.

Thanks,

Kevin



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Fragment-host-fails-to-start-on-Karaf-restart-tp4033057.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to