[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] is this a service tracker bug?

Matt, please open a bug against Equinox->Framework. I have reproduced, it appears to be related to lazy activation. If you remove the Eclipse-LazyStart header from Bundle A then it works.

This is an interesting corner case we may need to get a clarification from OSGi on. I assume the old content of the bundle will not have access to a BundleContext. What does it mean to get wired to old pending removal content of a bundle that is lazy activated? The classes may be in an invalid state if they cannot have access to a BundleContext.

Tom



Inactive hide details for BJ Hargrave---01/25/2008 12:10:27 PM---But you should not have to refresh. That is the whole point ofBJ Hargrave---01/25/2008 12:10:27 PM---But you should not have to refresh. That is the whole point of importing


From:

BJ Hargrave/Austin/IBM@IBMUS

To:

Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

Date:

01/25/2008 12:10 PM

Subject:

Re: [equinox-dev] is this a service tracker bug?




But you should not have to refresh. That is the whole point of importing
the package which is exported. So that A' can import it from A which is
where B imports it from.

I think the IllegalStateException is is a bug in Equinox.
--

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargrave@xxxxxxxxxx

office: +1 386 848 1781
mobile: +1 386 848 3788




From:
Mark <javamark@xxxxxxxxx>
To:
"Equinox development mailing list" <equinox-dev@xxxxxxxxxxx>
Date:
2008-01-25 13:06
Subject:
Re: [equinox-dev] is this a service tracker bug?



I see - It's in an IllegalState until you refresh

On 25/01/2008, Mark < javamark@xxxxxxxxx> wrote:
Try adding:

Import-Package: bundlea.service

to the Bundle A manifest.

=========================================================
I just tried the suggestion above - but it blows up?

Framework is launched.

id    State       Bundle
0    ACTIVE      org.eclipse.osgi_3.3.1.R33x_v20070828
1    ACTIVE      bundleA_1.0.0
2    ACTIVE      bundleB_1.0.0

osgi> stop 1
removedService

osgi> update 1

osgi> ss

Framework is launched.

id    State       Bundle
0    ACTIVE      org.eclipse.osgi_3.3.1.R33x_v20070828
1    INSTALLED   bundleA_1.0.0
2    ACTIVE      bundleB_1.0.0

osgi> start 1
org.osgi.framework.BundleException: Exception in bundlea.Activator.start()
of bundle bundleA.
   at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1018)
   at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:974)
   at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
   at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:260)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:150)
   at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:291)
   at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:276)
   at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:218)
   at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalStateException: The state indicates the bundle
is resolved
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureMessage(AbstractBundle.java:1376)
   at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
   at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
   at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
   at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:417)
   at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340)
   at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:37)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:396)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
   at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   at bundlea.Activator.start(Activator.java:12)
   at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:999)
   at java.security.AccessController.doPrivileged(Native Method)
   at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:993)
   ... 14 more
Nested Exception:
java.lang.IllegalStateException: The state indicates the bundle is
resolved
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureMessage(AbstractBundle.java:1376)
   at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
   at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
   at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
   at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:417)
   at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340)
   at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:37)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:396)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
   at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   at bundlea.Activator.start(Activator.java:12)
   at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:999)
   at java.security.AccessController.doPrivileged(Native Method)
   at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:993)
   at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:974)
   at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
   at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:260)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:150)
   at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:291)
   at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:276)
   at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:218)
   at java.lang.Thread.run(Thread.java:595)
Nested Exception:
java.lang.IllegalStateException: The state indicates the bundle is
resolved
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureMessage(AbstractBundle.java:1376)
   at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
   at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
   at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
   at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:417)
   at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340)
   at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:37)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:396)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
   at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
   at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   at bundlea.Activator.start(Activator.java:12)
   at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:999)
   at java.security.AccessController.doPrivileged(Native Method)
   at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:993)
   at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:974)
   at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
   at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
   at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:260)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:150)
   at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:291)
   at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:276)
   at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:218)
   at java.lang.Thread.run(Thread.java:595)



On 25/01/2008, BJ Hargrave < hargrave@xxxxxxxxxx> wrote:

Try adding:

Import-Package: bundlea.service

to the Bundle A manifest.

Then when bundle A is updated to A', A' will import the package from A
which is where bundle B is importing it. So bundle B can "see" the service
from A' since it implements the interface from A. (This follows from Tom
Watson's explanation.)

See
http://www.osgi.org/blog/2007/04/importance-of-exporting-nd-importing.html
--

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargrave@xxxxxxxxxx

office: +1 386 848 1781
mobile: +1 386 848 3788





_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev

GIF image

GIF image