dev@glassfish.java.net

Re: "Cannot start bundle" error during startup

From: Richard S. Hall <heavy_at_ungoverned.org>
Date: Wed, 05 Jan 2011 14:46:07 -0500

On 1/5/11 14:13, Richard S. Hall wrote:
> I assume you are just seeing a race condition if you are doing this
> repeatedly.
>
> The File Install bundle has a thread monitoring a directory and will
> perform operations on bundles as a results of changes in this
> directory or their state in the framework. I would guess that the
> thread may have noticed that a bundle was stopped and is trying to
> restart it while the OSGi framework is in the process of shutting down.
>
> The OSGi framework doesn't have any special way to detect that a
> shutdown has started

Actually, I take that back, it does seem like File Install could listen
for BundleEvent.STOPPING for System Bundle, in which case it could stop
all of its threads.

-> richard

> so I think this sort of thing is not preventable. However, I suppose
> File Install could try to verify the start level so it can avoid such
> an exception.
>
> Otherwise, I think this exception is harmless.
>
> -> richard
>
> On 1/5/11 13:20, Bobby Bissett wrote:
>> Hi all,
>>
>> Can someone tell me what this means and if it's expected? It's
>> happening during an "asadmin start-domain --upgrade" call in the
>> current workspace and in b37 from the last nightly build:
>>
>> "Cannot start bundle org.apache.felix.bundlerepository [244] because
>> its start level is 1, which is greater than the framework's start
>> level of 0."
>>
>> This is for issue http://java.net/jira/browse/GLASSFISH-15441 -- I've
>> run the upgrade over and over and see the same error about once every
>> 10 or more tries. The full list of errors is attached, but there is
>> an example below. Since I can't reproduce it repeatedly, it's hard to
>> get more info. When I *do* get this to happen, there are no errors in
>> the server log -- the errors are all in the asadmin output.
>>
>> Note that this is happening during server shutdown.
>>
>> Thanks,
>> Bobby
>>
>> --------------
>>
>> Error while starting bundle:
>> file:/Users/bobby/work/ws/v3/distributions/glassfish/target/glassfish3/glassfish/modules/autostart/osgi-jta.jar:
>> org.osgi.framework.BundleException: Cannot start bundle
>> org.glassfish.osgi-jta [253] because its start level is 1, which is
>> greater than the framework's start level of 0.
>> org.osgi.framework.BundleException: Cannot start bundle
>> org.glassfish.osgi-jta [253] because its start level is 1, which is
>> greater than the framework's start level of 0.
>> at
>> org.apache.felix.framework.Felix.startBundle(Felix.java:1690)
>> at
>> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:922)
>> at
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:1136)
>> at
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:1122)
>> at
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1115)
>> at
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:433)
>> at
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:241)
>>