[
https://jira.jboss.org/jira/browse/JBOSGI-295?page=com.atlassian.jira.plu...
]
Thomas Diesler edited comment on JBOSGI-295 at 2/25/10 2:53 AM:
----------------------------------------------------------------
Done.
public ExportedPackageHelper(BundleContext context)
{
if (context == null)
throw new IllegalArgumentException("Null context");
ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
if (sref != null)
packageAdmin = (PackageAdmin)context.getService(sref);
}
The ExportedPackageHelper should be constructed with the system bundle context which
should be available as soon as the framework was started.
The BC of a B does not become available until the B is started. We do this here
public void startInternal() throws BundleException
{
// This bundle's state is set to STARTING
// A bundle event of type BundleEvent.STARTING is fired
createBundleContext();
changeState(STARTING);
was (Author: thomas.diesler(a)jboss.com):
Done.
public ExportedPackageHelper(BundleContext context)
{
if (context == null)
throw new IllegalArgumentException("Null context");
ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
if (sref != null)
packageAdmin = (PackageAdmin)context.getService(sref);
}
The ExportedPackageHelper should be constructed with the system bundle context which
should be available as soon as the framework was started.
NullPointerException in ExportedPackageHelper constructor
---------------------------------------------------------
Key: JBOSGI-295
URL:
https://jira.jboss.org/jira/browse/JBOSGI-295
Project: JBoss OSGi
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: jboss-osgi-spi
Reporter: Andreas Scheerer
Priority: Minor
Fix For: JBossOSGi 1.0.0 Beta7
In case of a null BundleContext the constructor
org.jboss.osgi.spi.util.ExportedPackageHelper.ExportedPackageHelper(BundleContext) throws
a NullPointerException. I think an IllegalStateException should be thrown instead.
Currently this NullPointerException occurs when the EmbeddedBundle.start() method is
called for a bundle having a higher startlevel than the active framework start level. In
this case the expression bundle.getBundleContext() will return null (passed to the
ExportedPackageHelper) even if the bundle.start() was invoked before.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira