Buggy code:
public class ConfigurationAdminMBeanTest extends AbstractIntegrationTest { @ Configuration public static Option [ ] configuration ( ) { } @ Before public void doSetUp ( ) throws Exception { } @ Ignore ( "ManagedServiceFactory<seq2seq4repair_space>tests<seq2seq4repair_space>failing..<seq2seq4repair_space>" + "Some<seq2seq4repair_space>issues<seq2seq4repair_space>surrounding<seq2seq4repair_space>creating<seq2seq4repair_space>a<seq2seq4repair_space>factory<seq2seq4repair_space>configuration<seq2seq4repair_space>and<seq2seq4repair_space>then<seq2seq4repair_space>retrieving<seq2seq4repair_space>by<seq2seq4repair_space>pid<seq2seq4repair_space>to<seq2seq4repair_space>update..<seq2seq4repair_space>Needs<seq2seq4repair_space>investigation" ) @ Test @ SuppressWarnings ( "unchecked" ) public void testMBeanInterface ( ) throws Exception { ConfigurationAdminMBean mbean = getMBean ( OBJECTNAME , ConfigurationAdminMBean . class ) ; assertNotNull ( mbean ) ; Bundle a = getBundle ( "org.apache.aries.jmx.test.bundlea" ) ; assertNotNull ( a ) ; Bundle b = getBundle ( "org.apache.aries.jmx.test.bundleb" ) ; assertNotNull ( b ) ; ServiceTracker trackerA = new ServiceTracker ( bundleContext , InterfaceA . class . getName ( ) , null ) ; trackerA . open ( ) ; InterfaceA managedServiceA = ( ( InterfaceA ) ( trackerA . getService ( ) ) ) ; assertNotNull ( managedServiceA ) ; Filter filter = bundleContext . createFilter ( ( ( "(" + ( Constants . SERVICE_PID ) ) + "=jmx.test.B.factory)" ) ) ; ServiceTracker trackerMSF = new ServiceTracker ( bundleContext , filter , null ) ; trackerMSF . open ( ) ; MSF managedFactory = ( ( MSF ) ( trackerMSF . getService ( ) ) ) ; assertNotNull ( managedFactory ) ; ServiceTracker tracker = new ServiceTracker ( bundleContext , ConfigurationAdmin . class . getName ( ) , null ) ; tracker . open ( ) ; ConfigurationAdmin configAdmin = ( ( ConfigurationAdmin ) ( tracker . getService ( ) ) ) ; assertNotNull ( configAdmin ) ; assertNull ( managedServiceA . getConfig ( ) ) ; TabularData data = mbean . getProperties ( "org.apache.aries.jmx.test.ServiceA" ) ; assertEquals ( 0 , data . size ( ) ) ; PropertyData < String > p1 = PropertyData . newInstance ( "A1" , "first" ) ; data . put ( p1 . toCompositeData ( ) ) ; PropertyData < Integer > p2 = PropertyData . newInstance ( "A2" , 2 ) ; data . put ( p2 . toCompositeData ( ) ) ; mbean . update ( "org.apache.aries.jmx.test.ServiceA" , data ) ; Thread . sleep ( 1000 ) ; Dictionary < String , Object > config = managedServiceA . getConfig ( ) ; assertNotNull ( config ) ; assertEquals ( 3 , config . size ( ) ) ; assertEquals ( "org.apache.aries.jmx.test.ServiceA" , config . get ( Constants . SERVICE_PID ) ) ; assertEquals ( "first" , config . get ( "A1" ) ) ; assertEquals ( 2 , config . get ( "A2" ) ) ; <START_BUG> mbean . delete ( "org.apache.aries.jmx.test.ServiceA" , a . getLocation ( ) ) ; <END_BUG> Thread . sleep ( 1000 ) ; assertNull ( managedServiceA . getConfig ( ) ) ; String cpid = mbean . createFactoryConfiguration ( "jmx.test.B.factory" ) ; assertNotNull ( cpid ) ; assertTrue ( cpid . contains ( "jmx.test.B.factory" ) ) ; TabularData fConfig = mbean . getProperties ( cpid ) ; assertNotNull ( fConfig ) ; assertEquals ( 0 , fConfig . values ( ) . size ( ) ) ; PropertyData < String > prop1 = PropertyData . newInstance ( "B1" , "value1" ) ; fConfig . put ( prop1 . toCompositeData ( ) ) ; PropertyData < Boolean > prop2 = PropertyData . newInstance ( "B2" , true ) ; fConfig . put ( prop2 . toCompositeData ( ) ) ; mbean . update ( cpid , fConfig ) ; Thread . sleep ( 1000 ) ; InterfaceB configured = managedFactory . getConfigured ( cpid ) ; assertNotNull ( configured ) ; config = configured . getConfig ( ) ; assertNotNull ( config ) ; assertTrue ( ( ( config . size ( ) ) >= 4 ) ) ; assertEquals ( "jmx.test.B.factory" , config . get ( SERVICE_FACTORYPID ) ) ; assertEquals ( cpid , config . get ( Constants . SERVICE_PID ) ) ; assertEquals ( "value1" , config . get ( "B1" ) ) ; assertEquals ( "true" , config . get ( "B2" ) ) ; assertEquals ( "jmx.test.B.factory" , mbean . getFactoryPid ( cpid ) ) ; mbean . delete ( cpid ) ; Thread . sleep ( 1000 ) ; assertNull ( managedFactory . getConfigured ( cpid ) ) ; data = mbean . getProperties ( "org.apache.aries.jmx.test.ServiceA" ) ; assertEquals ( 0 , data . size ( ) ) ; p1 = PropertyData . newInstance ( "A1" , "a1Value" ) ; data . put ( p1 . toCompositeData ( ) ) ; mbean . update ( "org.apache.aries.jmx.test.ServiceA" , data ) ; Thread . sleep ( 1000 ) ; config = managedServiceA . getConfig ( ) ; assertNotNull ( config ) ; assertEquals ( 2 , config . size ( ) ) ; assertEquals ( "org.apache.aries.jmx.test.ServiceA" , config . get ( Constants . SERVICE_PID ) ) ; assertEquals ( "a1Value" , config . get ( "A1" ) ) ; String [ ] [ ] configurations = mbean . getConfigurations ( "(A1=a1Value)" ) ; assertNotNull ( configurations ) ; assertEquals ( 1 , configurations . length ) ; assertEquals ( "org.apache.aries.jmx.test.ServiceA" , configurations [ 0 ] [ 0 ] ) ; assertEquals ( a . getLocation ( ) , configurations [ 0 ] [ 1 ] ) ; mbean . deleteConfigurations ( "(A1=a1Value)" ) ; Thread . sleep ( 1000 ) ; assertNull ( managedServiceA . getConfig ( ) ) ; trackerA . close ( ) ; trackerMSF . close ( ) ; tracker . close ( ) ; } }

Fix:
mbean . deleteForLocation ( "org.apache.aries.jmx.test.ServiceA" , a . getLocation ( ) ) ;