[
https://issues.apache.org/jira/browse/FELIX-3414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13252372#comment-13252372
]
Bert Jacobs commented on FELIX-3414:
------------------------------------
I believe I've seen a similar problem when I use FileInstall on Equinox.
Due to the changes in FELIX-2066 the component calls refreshPackages on a
number of bundles. The refresh happens in another thread (per the OSGi spec),
but the FileInstall component does not wait until the refresh is complete.
Result: the bundle states are inconsistent, and the startBundle calls later on
will trigger all sorts of errors.
This might be fixed by registering a FrameworkListener and then blocking the
DirectoryWatcher thread untill a PACKAGES_REFRESHED event is received. This
might be unpredictable though, as we don't know if this event will ever happen,
just as we can't conclude that the refresh failed if an ERROR event happens
because some other framework component might have failed.
The best approach is for the refresh to happen through the OSGi 4.3
FrameworkWiring service: this service allows one to pass FrameworkListeners to
correctly signal if the operation completed or failed. This does break
compatibility with older Felix and Equinox versions, but I believe it's either
that or the improved refresh which must be thrown out.
> BundleException: Unable to acquire global lock for resolve
> ----------------------------------------------------------
>
> Key: FELIX-3414
> URL: https://issues.apache.org/jira/browse/FELIX-3414
> Project: Felix
> Issue Type: Bug
> Components: File Install
> Affects Versions: fileinstall-3.2.0
> Environment: Windows 7. org.apache.felix.framework:4.0.2
> Reporter: Leon
>
> After trying to use latest org.apache.felix.fileinstall-3.2.0 I always get
> the following error. The bundle that fails it not always the same. It
> changes.Downgrading back to org.apache.felix.fileinstall-3.1.10 always works
> fine.
> Installed
> C:\Users\user\install\versions\strategy-server-1.0-SNAPSHOT\instances\1-a\strategies\example-1.0-SNAPSHOT.jar
> ...
> Error while starting bundle:
> file:/C:/Users/user/install/versions/strategy-server-1.0-SNAPSHOT/instances/1-a/strategies/example-1.0-SNAPSHOT.jar:
> org.osgi.framework.BundleException: Unable to acquire global lock for
> resolve.
> org.osgi.framework.BundleException: Unable to acquire global lock for resolve.
> at
> org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3832)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
> at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1232)
> at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1206)
> at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:491)
> at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:219)
> at
> org.apache.felix.fileinstall.internal.FileInstall.updated(FileInstall.java:247)
> at
> org.apache.felix.fileinstall.internal.FileInstall.start(FileInstall.java:150)
> at
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:641)
> at org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
> at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
> at
> org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
> at java.lang.Thread.run(Thread.java:662)
> [2012-03-29
> 23:24:37,788][INFO][FelixDispatchQueue][server.osgi.StrategyEngineHost]
> FrameworkEvent: org.apache.felix.framework [0] PACKAGES_REFRESHED null
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira