[ 
https://issues.apache.org/jira/browse/FELIX-1040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700036#action_12700036
 ] 

Thomas Diesler commented on FELIX-1040:
---------------------------------------

I investigated this a little further. Here is a Hudson build that shows the 
issue

http://jbmuc.dyndns.org:8280/hudson/job/jbossosgi-matrix/52/

It only occurs in one of 24 test runs

The log of the bad run says 

2009-04-17 00:25:27,402 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START 
org.jboss.test.osgi.jbosgi39.OSGI39TestCase.testVerifyUnresolved
2009-04-17 00:25:27,403 DEBUG [org.jboss.kernel.KernelFactory] Starting JBoss 
Kernel construction...
...
2009-04-17 00:25:27,833 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
OSGi Integration Felix - null
2009-04-17 00:25:27,856 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Installed bundle: org.apache.felix.log
2009-04-17 00:25:27,873 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Installed bundle: org.jboss.osgi.common
2009-04-17 00:25:27,896 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Installed bundle: org.jboss.osgi.service.logging
2009-04-17 00:25:27,899 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 1.0 -> org.osgi.service.log -> 0
2009-04-17 00:25:27,899 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 1.0 -> org.osgi.framework -> 0
2009-04-17 00:25:27,910 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Started bundle: org.apache.felix.log
2009-04-17 00:25:27,914 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 2.0 -> org.osgi.service.log -> 0
2009-04-17 00:25:27,914 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 2.0 -> org.osgi.framework -> 0
2009-04-17 00:25:27,914 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 2.0 -> org.osgi.util.tracker -> 0
2009-04-17 00:25:27,914 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Started bundle: org.jboss.osgi.common
2009-04-17 00:25:27,918 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 3.0 -> org.jboss.logging -> 0
2009-04-17 00:25:27,918 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 3.0 -> org.osgi.service.log -> 0
2009-04-17 00:25:27,919 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 3.0 -> org.osgi.framework -> 0
2009-04-17 00:25:27,919 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 3.0 -> org.osgi.util.tracker -> 0
2009-04-17 00:25:27,926 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Started bundle: org.jboss.osgi.service.logging
2009-04-17 00:25:27,927 INFO  [org.jboss.osgi.service.logging] BundleEvent 
STARTED
2009-04-17 00:25:27,957 INFO  [jbosgi37-bundleA] BundleEvent INSTALLED
2009-04-17 00:25:27,960 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 4.0 -> org.osgi.service.log -> 0
2009-04-17 00:25:27,960 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 4.0 -> org.osgi.framework -> 0
2009-04-17 00:25:27,960 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 4.0 -> org.jboss.osgi.common.log -> 2.0
2009-04-17 00:25:27,961 INFO  [jbosgi37-bundleA] BundleEvent RESOLVED
2009-04-17 00:25:27,971 INFO  [jbosgi37-bundleA] Bundle-SymbolicName: 
[jbosgi37-bundleA]
2009-04-17 00:25:27,972 INFO  [jbosgi37-bundleA] ServiceEvent REGISTERED
2009-04-17 00:25:27,972 INFO  [jbosgi37-bundleA] BundleEvent STARTED
2009-04-17 00:25:27,973 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END 
org.jboss.test.osgi.jbosgi39.OSGI39TestCase.testVerifyUnresolved

Please note, that it installs jbosgi37-bundleA instead of the expected 
jbosgi39-bundleB

A good log would look like this

2009-04-17 00:17:51,367 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### START 
org.jboss.test.osgi.jbosgi39.OSGI39TestCase.testVerifyUnresolved
2009-04-17 00:17:51,409 DEBUG [org.jboss.kernel.KernelFactory] Starting JBoss 
Kernel construction...
...
2009-04-17 00:17:53,841 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
OSGi Integration Felix - null
2009-04-17 00:17:54,121 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Installed bundle: org.apache.felix.log
2009-04-17 00:17:54,129 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Installed bundle: org.jboss.osgi.common
2009-04-17 00:17:54,136 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Installed bundle: org.jboss.osgi.service.logging
2009-04-17 00:17:54,141 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 1.0 -> org.osgi.service.log -> 0
2009-04-17 00:17:54,141 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 1.0 -> org.osgi.framework -> 0
2009-04-17 00:17:54,159 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Started bundle: org.apache.felix.log
2009-04-17 00:17:54,161 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 2.0 -> org.osgi.service.log -> 0
2009-04-17 00:17:54,161 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 2.0 -> org.osgi.util.tracker -> 0
2009-04-17 00:17:54,161 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 2.0 -> org.osgi.framework -> 0
2009-04-17 00:17:54,161 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Started bundle: org.jboss.osgi.common
2009-04-17 00:17:54,162 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 3.0 -> org.osgi.service.log -> 0
2009-04-17 00:17:54,162 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 3.0 -> org.osgi.util.tracker -> 0
2009-04-17 00:17:54,162 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 3.0 -> org.osgi.framework -> 0
2009-04-17 00:17:54,162 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 3.0 -> org.jboss.logging -> 0
2009-04-17 00:17:54,172 INFO  [org.jboss.osgi.felix.framework.FelixIntegration] 
Started bundle: org.jboss.osgi.service.logging
2009-04-17 00:17:54,172 INFO  [org.jboss.osgi.service.logging] BundleEvent 
STARTED
2009-04-17 00:17:54,179 INFO  [jbosgi39-bundleB] BundleEvent INSTALLED
2009-04-17 00:17:54,190 INFO  [jbosgi39-bundleX] BundleEvent INSTALLED
2009-04-17 00:17:54,191 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 4.0 -> org.jboss.test.osgi.jbosgi39.bundleX -> 5.0
2009-04-17 00:17:54,191 DEBUG [org.jboss.osgi.felix.framework.FelixLogger] 
WIRE: 4.0 -> org.osgi.framework -> 0
2009-04-17 00:17:54,191 INFO  [jbosgi39-bundleX] BundleEvent RESOLVED
2009-04-17 00:17:54,191 INFO  [jbosgi39-bundleB] BundleEvent RESOLVED
2009-04-17 00:17:54,193 INFO  [jbosgi39-bundleB] ServiceEvent REGISTERED
2009-04-17 00:17:54,194 INFO  [jbosgi39-bundleB] ServiceEvent UNREGISTERING
2009-04-17 00:17:54,194 INFO  [jbosgi39-bundleB] BundleEvent STARTED
2009-04-17 00:17:54,194 INFO  [jbosgi39-bundleB] BundleEvent STOPPED
2009-04-17 00:17:54,194 INFO  [jbosgi39-bundleB] BundleEvent UNINSTALLED
2009-04-17 00:17:54,197 INFO  [org.apache.felix.framework] FrameworkEvent 
PACKAGES REFRESHED
2009-04-17 00:17:54,198 INFO  [jbosgi39-bundleX] BundleEvent UNINSTALLED
2009-04-17 00:17:54,199 DEBUG [org.jboss.osgi.spi.junit.OSGiTest] ### END 
org.jboss.test.osgi.jbosgi39.OSGI39TestCase.testVerifyUnresolved

The exception on jbosgi39-bundleB.start() is unfortunately not logged however.

------------------------

What's interesting about the bad run is that jbosgi37-bundleA was installed 
(and not uninstalled) by the previous test. 

Both tests boot their own instance of Felix with

     org.osgi.framework.storage.clean=onFirstInit

One possible explanation could be that the content of felix-cache somehow leaks 
from the jbosgi37 to the jbosgi39 testrun.

In any case, I'd say it is a bug that 

    Bundle bundleB = sysContext.installBundle("jbosgi39-bundleB.jar"); 

erroneously installs "jbosgi37-bundleA.jar"


> Bundle may start with unresolved packages
> -----------------------------------------
>
>                 Key: FELIX-1040
>                 URL: https://issues.apache.org/jira/browse/FELIX-1040
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: felix-1.6.0
>            Reporter: Thomas Diesler
>         Attachments: jbosgi39-bundleB.jar, jbosgi39-bundleX.jar
>
>
> After an upgrade to felix-1.6.0 I see one of my test cases failing that 
> explicitly tests that a bundle cannot be started if an import is not 
> satisfied.
> junit.framework.AssertionFailedError: Unresolved constraint expected
>       at junit.framework.Assert.fail(Assert.java:47)
>       at 
> org.jboss.test.osgi.jbosgi39.OSGI39TestCase.testVerifyUnresolved(OSGI39TestCase.java:59)
>    public void testVerifyUnresolved() throws Exception
>    {
>       OSGiFramework framework = getBootstrapProvider().getFramework();
>       BundleContext sysContext = framework.getSystemBundleContext();
>       
>       Bundle bundleB = 
> sysContext.installBundle(getTestArchiveURL("jbosgi39-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("jbosgi39-bundleX.jar").toExternalForm());
>       
>       bundleB.start();
>       
>       assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
>       assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
>       bundleB.uninstall();
>       bundleX.uninstall();
>    }
> Unfortunately, the test only fails rarely. I attached the test bundles.
> The sources are here 
> https://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/

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

Reply via email to