You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Thomas Diesler (JIRA)" <ji...@apache.org> on 2009/03/05 08:51:56 UTC

[jira] Created: (FELIX-972) Bundle gets wired to an already uninstalled bundle

Bundle gets wired to an already uninstalled bundle
--------------------------------------------------

                 Key: FELIX-972
                 URL: https://issues.apache.org/jira/browse/FELIX-972
             Project: Felix
          Issue Type: Bug
    Affects Versions: felix-1.4.1
            Reporter: Thomas Diesler


It seems that the order on uninstall matters

B, X - is ok
X, B - fails 

/**
 * [JBOSGI-39] Bundle undeploy does not clean up properly
 * 
 * https://jira.jboss.org/jira/browse/JBOSGI-39
 * 
 * Bundle B depends on bundle X.
 * 
 * B ---> X 
 * 
 * @author thomas.diesler@jboss.com
 * @since 04-Mar-2009
 */
public class OSGI39EmbeddedTestCase extends IntegrationTest
{
   static OSGiBootstrapProvider bootProvider;
   
   @Override
   protected OSGiBootstrapProvider getBootstrapProvider()
   {
      if (bootProvider == null)
         bootProvider = createBootstrapProvider();
      
      return bootProvider;
   }

   public void testFirstRun() throws Exception
   {
      installBBeforeX();
   }

   public void testSecondRun() throws Exception
   {
      installBBeforeX();
   }

   private void installBBeforeX() throws Exception
   {
      OSGiFramework framework = getBootstrapProvider().getFramework();
      BundleContext sysContext = framework.getSystemBundleContext();
      
      Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
      assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
      
      try
      {
         bundleB.start();
         fail("Unresolved constraint expected");
      }
      catch (BundleException ex)
      {
         // expected
      }
      
      Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
      
      bundleB.start();
      
      assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());

      // Uninstall X before B
      bundleX.uninstall();
      bundleB.uninstall();
   }

Test set: org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase
-------------------------------------------------------------------------------
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.989 sec <<< FAILURE!
testSecondRun(org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase)  Time elapsed: 0.015 sec  <<< FAILURE!
junit.framework.AssertionFailedError: Unresolved constraint expected
	at junit.framework.Assert.fail(Assert.java:47)
	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.installBBeforeX(OSGI39EmbeddedTestCase.java:79)
	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun(OSGI39EmbeddedTestCase.java:65)


2009-03-05 08:42:00,284 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 1.0
2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.osgi.framework -> 0
2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 2.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
2009-03-05 08:42:04,187 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
2009-03-05 08:42:04,194 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun
2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 3.0
2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.osgi.framework -> 0
2009-03-05 08:42:04,203 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-972) Bundle gets wired to an already uninstalled bundle

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679217#action_12679217 ] 

Richard S. Hall commented on FELIX-972:
---------------------------------------

Yes, that is correct, but in theory the framework could be smart enough to monitor this situation and notice that B was uninstalled, so that it could remove both B and X. However, the spec does not require this and Felix does not do this.

I think we can close this bug, right?

> Bundle gets wired to an already uninstalled bundle
> --------------------------------------------------
>
>                 Key: FELIX-972
>                 URL: https://issues.apache.org/jira/browse/FELIX-972
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions: felix-1.4.1
>            Reporter: Thomas Diesler
>
> It seems that the order on uninstall matters
> B, X - is ok
> X, B - fails 
> /**
>  * [JBOSGI-39] Bundle undeploy does not clean up properly
>  * 
>  * https://jira.jboss.org/jira/browse/JBOSGI-39
>  * 
>  * Bundle B depends on bundle X.
>  * 
>  * B ---> X 
>  * 
>  * @author thomas.diesler@jboss.com
>  * @since 04-Mar-2009
>  */
> public class OSGI39EmbeddedTestCase extends IntegrationTest
> {
>    static OSGiBootstrapProvider bootProvider;
>    
>    @Override
>    protected OSGiBootstrapProvider getBootstrapProvider()
>    {
>       if (bootProvider == null)
>          bootProvider = createBootstrapProvider();
>       
>       return bootProvider;
>    }
>    public void testFirstRun() throws Exception
>    {
>       installBBeforeX();
>    }
>    public void testSecondRun() throws Exception
>    {
>       installBBeforeX();
>    }
>    private void installBBeforeX() throws Exception
>    {
>       OSGiFramework framework = getBootstrapProvider().getFramework();
>       BundleContext sysContext = framework.getSystemBundleContext();
>       
>       Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
>       assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
>       
>       try
>       {
>          bundleB.start();
>          fail("Unresolved constraint expected");
>       }
>       catch (BundleException ex)
>       {
>          // expected
>       }
>       
>       Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
>       
>       bundleB.start();
>       
>       assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
>       assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
>       // Uninstall X before B
>       bundleX.uninstall();
>       bundleB.uninstall();
>    }
> Test set: org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase
> -------------------------------------------------------------------------------
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.989 sec <<< FAILURE!
> testSecondRun(org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase)  Time elapsed: 0.015 sec  <<< FAILURE!
> junit.framework.AssertionFailedError: Unresolved constraint expected
> 	at junit.framework.Assert.fail(Assert.java:47)
> 	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.installBBeforeX(OSGI39EmbeddedTestCase.java:79)
> 	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun(OSGI39EmbeddedTestCase.java:65)
> 2009-03-05 08:42:00,284 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 1.0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.osgi.framework -> 0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 2.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,187 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
> 2009-03-05 08:42:04,194 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 3.0
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.osgi.framework -> 0
> 2009-03-05 08:42:04,203 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-972) Bundle gets wired to an already uninstalled bundle

Posted by "Thomas Diesler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679114#action_12679114 ] 

Thomas Diesler commented on FELIX-972:
--------------------------------------

Here is the test in our testsuite

https://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39EmbeddedTestCase.java

> Bundle gets wired to an already uninstalled bundle
> --------------------------------------------------
>
>                 Key: FELIX-972
>                 URL: https://issues.apache.org/jira/browse/FELIX-972
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions: felix-1.4.1
>            Reporter: Thomas Diesler
>
> It seems that the order on uninstall matters
> B, X - is ok
> X, B - fails 
> /**
>  * [JBOSGI-39] Bundle undeploy does not clean up properly
>  * 
>  * https://jira.jboss.org/jira/browse/JBOSGI-39
>  * 
>  * Bundle B depends on bundle X.
>  * 
>  * B ---> X 
>  * 
>  * @author thomas.diesler@jboss.com
>  * @since 04-Mar-2009
>  */
> public class OSGI39EmbeddedTestCase extends IntegrationTest
> {
>    static OSGiBootstrapProvider bootProvider;
>    
>    @Override
>    protected OSGiBootstrapProvider getBootstrapProvider()
>    {
>       if (bootProvider == null)
>          bootProvider = createBootstrapProvider();
>       
>       return bootProvider;
>    }
>    public void testFirstRun() throws Exception
>    {
>       installBBeforeX();
>    }
>    public void testSecondRun() throws Exception
>    {
>       installBBeforeX();
>    }
>    private void installBBeforeX() throws Exception
>    {
>       OSGiFramework framework = getBootstrapProvider().getFramework();
>       BundleContext sysContext = framework.getSystemBundleContext();
>       
>       Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
>       assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
>       
>       try
>       {
>          bundleB.start();
>          fail("Unresolved constraint expected");
>       }
>       catch (BundleException ex)
>       {
>          // expected
>       }
>       
>       Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
>       
>       bundleB.start();
>       
>       assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
>       assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
>       // Uninstall X before B
>       bundleX.uninstall();
>       bundleB.uninstall();
>    }
> Test set: org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase
> -------------------------------------------------------------------------------
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.989 sec <<< FAILURE!
> testSecondRun(org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase)  Time elapsed: 0.015 sec  <<< FAILURE!
> junit.framework.AssertionFailedError: Unresolved constraint expected
> 	at junit.framework.Assert.fail(Assert.java:47)
> 	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.installBBeforeX(OSGI39EmbeddedTestCase.java:79)
> 	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun(OSGI39EmbeddedTestCase.java:65)
> 2009-03-05 08:42:00,284 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 1.0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.osgi.framework -> 0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 2.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,187 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
> 2009-03-05 08:42:04,194 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 3.0
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.osgi.framework -> 0
> 2009-03-05 08:42:04,203 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-972) Bundle gets wired to an already uninstalled bundle

Posted by "Thomas Diesler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-972?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Diesler resolved FELIX-972.
----------------------------------

    Resolution: Won't Fix

> Bundle gets wired to an already uninstalled bundle
> --------------------------------------------------
>
>                 Key: FELIX-972
>                 URL: https://issues.apache.org/jira/browse/FELIX-972
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions: felix-1.4.1
>            Reporter: Thomas Diesler
>
> It seems that the order on uninstall matters
> B, X - is ok
> X, B - fails 
> /**
>  * [JBOSGI-39] Bundle undeploy does not clean up properly
>  * 
>  * https://jira.jboss.org/jira/browse/JBOSGI-39
>  * 
>  * Bundle B depends on bundle X.
>  * 
>  * B ---> X 
>  * 
>  * @author thomas.diesler@jboss.com
>  * @since 04-Mar-2009
>  */
> public class OSGI39EmbeddedTestCase extends IntegrationTest
> {
>    static OSGiBootstrapProvider bootProvider;
>    
>    @Override
>    protected OSGiBootstrapProvider getBootstrapProvider()
>    {
>       if (bootProvider == null)
>          bootProvider = createBootstrapProvider();
>       
>       return bootProvider;
>    }
>    public void testFirstRun() throws Exception
>    {
>       installBBeforeX();
>    }
>    public void testSecondRun() throws Exception
>    {
>       installBBeforeX();
>    }
>    private void installBBeforeX() throws Exception
>    {
>       OSGiFramework framework = getBootstrapProvider().getFramework();
>       BundleContext sysContext = framework.getSystemBundleContext();
>       
>       Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
>       assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
>       
>       try
>       {
>          bundleB.start();
>          fail("Unresolved constraint expected");
>       }
>       catch (BundleException ex)
>       {
>          // expected
>       }
>       
>       Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
>       
>       bundleB.start();
>       
>       assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
>       assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
>       // Uninstall X before B
>       bundleX.uninstall();
>       bundleB.uninstall();
>    }
> Test set: org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase
> -------------------------------------------------------------------------------
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.989 sec <<< FAILURE!
> testSecondRun(org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase)  Time elapsed: 0.015 sec  <<< FAILURE!
> junit.framework.AssertionFailedError: Unresolved constraint expected
> 	at junit.framework.Assert.fail(Assert.java:47)
> 	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.installBBeforeX(OSGI39EmbeddedTestCase.java:79)
> 	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun(OSGI39EmbeddedTestCase.java:65)
> 2009-03-05 08:42:00,284 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 1.0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.osgi.framework -> 0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 2.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,187 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
> 2009-03-05 08:42:04,194 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 3.0
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.osgi.framework -> 0
> 2009-03-05 08:42:04,203 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-972) Bundle gets wired to an already uninstalled bundle

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679116#action_12679116 ] 

Stuart McCulloch commented on FELIX-972:
----------------------------------------

At first glance this appears to follow the OSGi spec - see 4.3.11 Uninstalling Bundles:

  "Once this method returns, the state of the OSGi Service Platform must be the same as if the bundle had never been installed, unless:
   • The uninstalled bundle has exported any packages (via its Export-Package manifest header)
   • The uninstalled bundle was selected by the Framework as the exporter of these packages.

   If none of the old exports are used, then the old exports must be removed. Otherwise, all old exports must remain available
   for existing bundles and future resolves until the refreshPackages method is called or the Framework is restarted."

B uninstalled before X:

  B has no exports in use and uninstalls completely, X now has no exports in use so it also uninstalls completely

X uninstalled before B

  X has exported packages in use by B so these are kept available until a refresh, B has no exports in use and uninstalls completely

So according to the spec there will be a difference depending on the order you uninstall bundles UNTIL you call refresh.


> Bundle gets wired to an already uninstalled bundle
> --------------------------------------------------
>
>                 Key: FELIX-972
>                 URL: https://issues.apache.org/jira/browse/FELIX-972
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions: felix-1.4.1
>            Reporter: Thomas Diesler
>
> It seems that the order on uninstall matters
> B, X - is ok
> X, B - fails 
> /**
>  * [JBOSGI-39] Bundle undeploy does not clean up properly
>  * 
>  * https://jira.jboss.org/jira/browse/JBOSGI-39
>  * 
>  * Bundle B depends on bundle X.
>  * 
>  * B ---> X 
>  * 
>  * @author thomas.diesler@jboss.com
>  * @since 04-Mar-2009
>  */
> public class OSGI39EmbeddedTestCase extends IntegrationTest
> {
>    static OSGiBootstrapProvider bootProvider;
>    
>    @Override
>    protected OSGiBootstrapProvider getBootstrapProvider()
>    {
>       if (bootProvider == null)
>          bootProvider = createBootstrapProvider();
>       
>       return bootProvider;
>    }
>    public void testFirstRun() throws Exception
>    {
>       installBBeforeX();
>    }
>    public void testSecondRun() throws Exception
>    {
>       installBBeforeX();
>    }
>    private void installBBeforeX() throws Exception
>    {
>       OSGiFramework framework = getBootstrapProvider().getFramework();
>       BundleContext sysContext = framework.getSystemBundleContext();
>       
>       Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
>       assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
>       
>       try
>       {
>          bundleB.start();
>          fail("Unresolved constraint expected");
>       }
>       catch (BundleException ex)
>       {
>          // expected
>       }
>       
>       Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
>       
>       bundleB.start();
>       
>       assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
>       assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
>       // Uninstall X before B
>       bundleX.uninstall();
>       bundleB.uninstall();
>    }
> Test set: org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase
> -------------------------------------------------------------------------------
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.989 sec <<< FAILURE!
> testSecondRun(org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase)  Time elapsed: 0.015 sec  <<< FAILURE!
> junit.framework.AssertionFailedError: Unresolved constraint expected
> 	at junit.framework.Assert.fail(Assert.java:47)
> 	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.installBBeforeX(OSGI39EmbeddedTestCase.java:79)
> 	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun(OSGI39EmbeddedTestCase.java:65)
> 2009-03-05 08:42:00,284 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 1.0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.osgi.framework -> 0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 2.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,187 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
> 2009-03-05 08:42:04,194 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 3.0
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.osgi.framework -> 0
> 2009-03-05 08:42:04,203 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-972) Bundle gets wired to an already uninstalled bundle

Posted by "Thomas Diesler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679213#action_12679213 ] 

Thomas Diesler commented on FELIX-972:
--------------------------------------

So even if B is the only importer and B also gets uninstalled. You could then install C which would potentially get imports wired to packages from the already uninstalled X?

If I read the spec correctly, this would be the case, right? 

> Bundle gets wired to an already uninstalled bundle
> --------------------------------------------------
>
>                 Key: FELIX-972
>                 URL: https://issues.apache.org/jira/browse/FELIX-972
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions: felix-1.4.1
>            Reporter: Thomas Diesler
>
> It seems that the order on uninstall matters
> B, X - is ok
> X, B - fails 
> /**
>  * [JBOSGI-39] Bundle undeploy does not clean up properly
>  * 
>  * https://jira.jboss.org/jira/browse/JBOSGI-39
>  * 
>  * Bundle B depends on bundle X.
>  * 
>  * B ---> X 
>  * 
>  * @author thomas.diesler@jboss.com
>  * @since 04-Mar-2009
>  */
> public class OSGI39EmbeddedTestCase extends IntegrationTest
> {
>    static OSGiBootstrapProvider bootProvider;
>    
>    @Override
>    protected OSGiBootstrapProvider getBootstrapProvider()
>    {
>       if (bootProvider == null)
>          bootProvider = createBootstrapProvider();
>       
>       return bootProvider;
>    }
>    public void testFirstRun() throws Exception
>    {
>       installBBeforeX();
>    }
>    public void testSecondRun() throws Exception
>    {
>       installBBeforeX();
>    }
>    private void installBBeforeX() throws Exception
>    {
>       OSGiFramework framework = getBootstrapProvider().getFramework();
>       BundleContext sysContext = framework.getSystemBundleContext();
>       
>       Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
>       assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
>       
>       try
>       {
>          bundleB.start();
>          fail("Unresolved constraint expected");
>       }
>       catch (BundleException ex)
>       {
>          // expected
>       }
>       
>       Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
>       
>       bundleB.start();
>       
>       assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
>       assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
>       // Uninstall X before B
>       bundleX.uninstall();
>       bundleB.uninstall();
>    }
> Test set: org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase
> -------------------------------------------------------------------------------
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.989 sec <<< FAILURE!
> testSecondRun(org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase)  Time elapsed: 0.015 sec  <<< FAILURE!
> junit.framework.AssertionFailedError: Unresolved constraint expected
> 	at junit.framework.Assert.fail(Assert.java:47)
> 	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.installBBeforeX(OSGI39EmbeddedTestCase.java:79)
> 	at org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun(OSGI39EmbeddedTestCase.java:65)
> 2009-03-05 08:42:00,284 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 1.0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 1.0 -> org.osgi.framework -> 0
> 2009-03-05 08:42:04,173 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 2.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,187 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testFirstRun
> 2009-03-05 08:42:04,194 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleB -> 3.0
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.jboss.test.osgi.jbosgi38.bundleX -> 2.0
> 2009-03-05 08:42:04,200 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] WIRE: 3.0 -> org.osgi.framework -> 0
> 2009-03-05 08:42:04,203 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END org.jboss.test.osgi.jbosgi39.OSGI39EmbeddedTestCase.testSecondRun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.