Buggy code:
@ RunWith ( JUnit4TestRunner . class ) public class ASMMultiBundleTest extends AbstractIntegrationTest { private void checkInterceptorLog ( String [ ] expected , List < String > log ) { } @ Test public void multiBundleTest ( ) throws Exception { Bundle bundlea = context ( ) . getBundleByName ( "org.apache.aries.blueprint.testbundlea" ) ; assertNotNull ( bundlea ) ; bundlea . start ( ) ; Bundle bundleb = context ( ) . getBundleByName ( "org.apache.aries.blueprint.testbundleb" ) ; assertNotNull ( bundleb ) ; bundleb . start ( ) ; BlueprintContainer beanContainer = Helper . getBlueprintContainerForBundle ( context ( ) , "org.apache.aries.blueprint.testbundleb" ) ; assertNotNull ( beanContainer ) ; Object obj1 = beanContainer . getComponentInstance ( "TestBeanA" ) ; assertTrue ( ( obj1 instanceof TestBean ) ) ; TestBean testBeanA = ( ( TestBean ) ( obj1 ) ) ; Assert . assertEquals ( "RED" , testBeanA . getRed ( ) ) ; Assert . assertEquals ( "GREEN" , testBeanA . getGreen ( ) ) ; Assert . assertEquals ( "BLUE" , testBeanA . getBlue ( ) ) ; Object obj2 = beanContainer . getComponentInstance ( "TestBeanB" ) ; assertTrue ( ( obj2 instanceof TestBean ) ) ; TestBean testBeanB = ( ( TestBean ) ( obj2 ) ) ; Assert . assertEquals ( "ONE_VALUE" , testBeanB . getRed ( ) ) ; Assert . assertEquals ( "GREEN" , testBeanB . getGreen ( ) ) ; Assert . assertEquals ( "BLUE" , testBeanB . getBlue ( ) ) ; Object obj3 = beanContainer . getComponentInstance ( "TestBeanC" ) ; assertTrue ( ( obj3 instanceof TestBean ) ) ; TestBean testBeanC = ( ( TestBean ) ( obj3 ) ) ; BlueprintContainer handlerContainer = Helper . getBlueprintContainerForBundle ( context ( ) , "org.apache.aries.blueprint.testbundlea" ) ; assertNotNull ( handlerContainer ) ; Object ns1 = handlerContainer . getComponentInstance ( "NSHandlerOne" ) ; assertTrue ( ( ns1 instanceof NSHandlerOne ) ) ; Object ns2 = handlerContainer . getComponentInstance ( "NSHandlerTwo" ) ; assertTrue ( ( ns2 instanceof NSHandlerTwo ) ) ; NSHandlerTwo nstwo = ( ( NSHandlerTwo ) ( ns2 ) ) ; List < String > log = nstwo . getLog ( ) ; checkInterceptorLog ( new String [ ] { "PRECALL:TestBeanC:methodToInvoke:[RED]:" , "POSTCALL[true]:TestBeanC:methodToInvoke:[RED]:" , "PRECALL:TestBeanC:methodToInvoke:[BLUE]:" , "POSTCALL[false]:TestBeanC:methodToInvoke:[BLUE]:" } , log ) ; RuntimeException re = null ; try { testBeanC . methodToInvoke ( "GREEN" ) ; } catch ( RuntimeException e ) { re = e ; } assertNotNull ( "invocation<seq2seq4repair_space>of<seq2seq4repair_space>Green<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>cause<seq2seq4repair_space>an<seq2seq4repair_space>exception<seq2seq4repair_space>as<seq2seq4repair_space>expected" , re ) ; log = nstwo . getLog ( ) ; checkInterceptorLog ( new String [ ] { "PRECALL:TestBeanC:methodToInvoke:[RED]:" , "POSTCALL[true]:TestBeanC:methodToInvoke:[RED]:" , "PRECALL:TestBeanC:methodToInvoke:[BLUE]:" , "POSTCALL[false]:TestBeanC:methodToInvoke:[BLUE]:" , "PRECALL:TestBeanC:methodToInvoke:[GREEN]:" , "POSTCALLEXCEPTION[java.lang.RuntimeException:<seq2seq4repair_space>MATCHED<seq2seq4repair_space>ON<seq2seq4repair_space>GREEN<seq2seq4repair_space>(GREEN)]:TestBeanC:methodToInvoke:[GREEN]:" } , log ) ; Object obj4 = beanContainer . getComponentInstance ( "ProcessedBean" ) ; assertTrue ( ( obj4 instanceof ProcessableBean ) ) ; ProcessableBean pb = ( ( ProcessableBean ) ( obj4 ) ) ; Object bp = beanContainer . getComponentInstance ( "http:////ns.handler.three//BeanProcessor" ) ; assertNotNull ( bp ) ; assertTrue ( ( bp instanceof BeanProcessor ) ) ; assertEquals ( 1 , pb . getProcessedBy ( ) . size ( ) ) ; assertEquals ( pb . getProcessedBy ( ) . get ( 0 ) , bp ) ; assertEquals ( pb . getProcessedBy ( BEFORE_INIT ) . get ( 0 ) , bp ) ; assertEquals ( pb . getProcessedBy ( AFTER_INIT ) . get ( 0 ) , bp ) ; <START_BUG> Object objOther = beanContainer . getComponentInstance ( "PlaceHolerTestBean" ) ; <END_BUG> assertTrue ( ( objOther instanceof OtherBean ) ) ; assertEquals ( "test1value" , ( ( OtherBean ) ( objOther ) ) . getTestValue ( ) ) ; } @ Configuration public static Option [ ] configuration ( ) { } }

Fix:
Object objOther = beanContainer . getComponentInstance ( "PlaceHolderTestBean" ) ;