[ https://issues.apache.org/jira/browse/FELIX-4443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zaid updated FELIX-4443: ------------------------- Description: I am trying to use ipojo API to create a component type. I am embedding Felix framework and I load my component bundle to the framework. In my bundle I have the following class: public class PlainHelloImpl implements PlainHello{ @Override public void sayHello() { System.out.println("Plainly Hello :D"); } public PlainHelloImpl() { System.out.println("in contructor"); } public void start() { System.out.println("Hello, this is the plain hello component start method"); } public void stop() { System.out.println("Bye, this is the plain hello component stop method"); } } and below is my activator where the error occurs: public class Activator implements BundleActivator { public static BundleContext bundleContext; public void start(BundleContext context) throws Exception { System.out.println("Plain Hello iPOJO Bundle Started!"); bundleContext=context; PrimitiveComponentType x= new PrimitiveComponentType() .setBundleContext(context) .setClassName(PlainHelloImpl.class.getName()) .setValidateMethod("start") .setInvalidateMethod("stop") .addService(new Service()) ; x.start(); ComponentInstance i = x.createInstance(); //ERROR HERE i.start(); System.out.println("and we are done!"); } public void stop(BundleContext context) throws Exception { context = null; System.out.println("Plain Hello iPOJO Bundle Stopped!"); } } In my java application, I have the following code: Map config= new HashMap(); // Create a configuration property map. //Map config = new HashMap(); config.put(Constants.FRAMEWORK_STORAGE_CLEAN, Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); // Create host activator; m_activator = new HostActivator(); List list = new ArrayList(); list.add(m_activator); config.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list); try { // Now create an instance of the framework with // our configuration properties. m_felix = new Felix(config); // Now start Felix instance. m_felix.start(); } catch (Exception ex) { System.err.println("Could not create framework: " + ex); ex.printStackTrace(); } // Register the application's context as an OSGi service! BundleContext bundleContext1 = m_felix.getBundleContext(); //starting ipojo required bundles Bundle coreBundle = bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Dropbox\\feasibility-codes\\ipojo\\ipojo-distribution-1.11.0\\bundle\\org.apache.felix.ipojo-1.11.0.jar"); coreBundle.start(); if(coreBundle.getState()== Bundle.ACTIVE) System.out.println("Core Bundle is Active!"); Bundle compositeBundle = bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Dropbox\\feasibility-codes\\ipojo\\ipojo-distribution-1.11.0\\bundle\\org.apache.felix.ipojo.composite-1.6.0.jar"); compositeBundle.start(); if(compositeBundle.getState()== Bundle.ACTIVE) System.out.println("Composite Bundle is Active!"); Bundle apiBundle = bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Dropbox\\feasibility-codes\\ipojo\\ipojo-distribution-1.11.0\\bundle\\org.apache.felix.ipojo.api-1.6.0.jar"); apiBundle.start(); if(apiBundle.getState()== Bundle.ACTIVE) System.out.println("API Bundle is Active!"); //HERE I start my bundle Bundle plainIPOJOBundle = bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Desktop\\plugins\\Manipulated_PlainHelloiPOJO.jar"); plainIPOJOBundle.start(); As you see, at the very end, I start my bundle. This shows me the following error: [ERROR] : [plainhelloipojo.PlainHelloImpl-0] createInstance -> Cannot invoke the constructor (method not found) : plainhelloipojo.PlainHelloImpl.<init>(org.apache.felix.ipojo.InstanceManager) java.lang.NoSuchMethodException: plainhelloipojo.PlainHelloImpl.<init>(org.apache.felix.ipojo.InstanceManager) at java.lang.Class.getConstructor0(Class.java:2715) at java.lang.Class.getDeclaredConstructor(Class.java:1987) at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:726) at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:923) at org.apache.felix.ipojo.util.Callback.call(Callback.java:233) at org.apache.felix.ipojo.util.Callback.call(Callback.java:193) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:162) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java) at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:536) at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:418) at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:179) at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:319) at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:240) at org.apache.felix.ipojo.api.ComponentType.createInstance(ComponentType.java:79) at plainhelloipojo.Activator.start(Activator.java:38) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146) at org.apache.felix.framework.Felix.startBundle(Felix.java:2064) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942) at embedder.HostApplication.<init>(HostApplication.java:82) at embedder.Embedder.main(Embedder.java:12) [ERROR] plainhelloipojo.PlainHelloImpl : Cannot create a POJO instance, the POJO constructor cannot be found Exception in thread "main" org.osgi.framework.BundleException: Activator start error in bundle PlainHelloiPOJO [4]. at org.apache.felix.framework.Felix.activateBundle(Felix.java:2196) at org.apache.felix.framework.Felix.startBundle(Felix.java:2064) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942) at embedder.HostApplication.<init>(HostApplication.java:82) at embedder.Embedder.main(Embedder.java:12) Caused by: org.apache.felix.ipojo.ConfigurationException: The configuration is not correct for the type plainhelloipojo.PlainHelloImpl : Cannot create a POJO instance, the POJO constructor cannot be found at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:328) at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:240) at org.apache.felix.ipojo.api.ComponentType.createInstance(ComponentType.java:79) at plainhelloipojo.Activator.start(Activator.java:38) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146) ... 5 more Caused by: org.apache.felix.ipojo.ConfigurationException: Cannot create a POJO instance, the POJO constructor cannot be found at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:191) at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:319) ... 10 more Caused by: java.lang.RuntimeException: Cannot create a POJO instance, the POJO constructor cannot be found at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:766) at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:923) at org.apache.felix.ipojo.util.Callback.call(Callback.java:233) at org.apache.felix.ipojo.util.Callback.call(Callback.java:193) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:162) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java) at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:536) at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:418) at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:179) ... 11 more Caused by: java.lang.NoSuchMethodException: plainhelloipojo.PlainHelloImpl.<init>(org.apache.felix.ipojo.InstanceManager) at java.lang.Class.getConstructor0(Class.java:2715) at java.lang.Class.getDeclaredConstructor(Class.java:1987) at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:726) ... 20 more Now, here's the weird behavior: This works fine (no errors): PrimitiveComponentType x= new PrimitiveComponentType() .setBundleContext(context) .setClassName(PlainHelloImpl.class.getName()) .addService(new Service()) // Provide the Foo service ; x.start(); ComponentInstance i = x.createInstance(); i.start(); This however doesn't work (shows the error): PrimitiveComponentType x= new PrimitiveComponentType() .setBundleContext(context) .setClassName(PlainHelloImpl.class.getName()) .setValidateMethod("start") .setInvalidateMethod("stop") .addService(new Service()) // Provide the Foo service ; x.start(); ComponentInstance i = x.createInstance(); i.start(); This also shows the error: PrimitiveComponentType x= new PrimitiveComponentType() .setBundleContext(context) .setClassName(PlainHelloImpl.class.getName()) ; x.start(); ComponentInstance i = x.createInstance(); i.start(); and many other scenarios show the error. The only case that does not show my error is when I provide a component name, bundle context, and service. was: I am trying to use ipojo API to create a component type. I am embedding Felix framework and I load my component bundle to the framework. In my bundle I have the following class: public class PlainHelloImpl implements PlainHello{ @Override public void sayHello() { System.out.println("Plainly Hello :D"); } public PlainHelloImpl() { System.out.println("in contructor"); } public void start() { System.out.println("Hello, this is the plain hello component start method"); } public void stop() { System.out.println("Bye, this is the plain hello component stop method"); } } and below is my activator where the error occurs: public class Activator implements BundleActivator { public static BundleContext bundleContext; public void start(BundleContext context) throws Exception { System.out.println("Plain Hello iPOJO Bundle Started!"); bundleContext=context; PrimitiveComponentType x= new PrimitiveComponentType() .setBundleContext(context) .setClassName(PlainHelloImpl.class.getName()) .setValidateMethod("start") .setInvalidateMethod("stop") .addService(new Service()) ; x.start(); ComponentInstance i = x.createInstance(); //ERROR HERE i.start(); System.out.println("and we are done!"); } public void stop(BundleContext context) throws Exception { context = null; System.out.println("Plain Hello iPOJO Bundle Stopped!"); } } In my java application, I have the following code: Map config= new HashMap(); // Create a configuration property map. //Map config = new HashMap(); config.put(Constants.FRAMEWORK_STORAGE_CLEAN, Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); // Create host activator; m_activator = new HostActivator(); List list = new ArrayList(); list.add(m_activator); config.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list); try { // Now create an instance of the framework with // our configuration properties. m_felix = new Felix(config); // Now start Felix instance. m_felix.start(); } catch (Exception ex) { System.err.println("Could not create framework: " + ex); ex.printStackTrace(); } // Register the application's context as an OSGi service! BundleContext bundleContext1 = m_felix.getBundleContext(); //starting ipojo required bundles Bundle coreBundle = bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Dropbox\\EBTIC\\ADERE\\feasibility-codes\\ipojo\\ipojo-distribution-1.11.0\\bundle\\org.apache.felix.ipojo-1.11.0.jar"); coreBundle.start(); if(coreBundle.getState()== Bundle.ACTIVE) System.out.println("Core Bundle is Active!"); Bundle compositeBundle = bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Dropbox\\EBTIC\\ADERE\\feasibility-codes\\ipojo\\ipojo-distribution-1.11.0\\bundle\\org.apache.felix.ipojo.composite-1.6.0.jar"); compositeBundle.start(); if(compositeBundle.getState()== Bundle.ACTIVE) System.out.println("Composite Bundle is Active!"); Bundle apiBundle = bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Dropbox\\EBTIC\\ADERE\\feasibility-codes\\ipojo\\ipojo-distribution-1.11.0\\bundle\\org.apache.felix.ipojo.api-1.6.0.jar"); apiBundle.start(); if(apiBundle.getState()== Bundle.ACTIVE) System.out.println("API Bundle is Active!"); //HERE I start my bundle Bundle plainIPOJOBundle = bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Desktop\\plugins\\Manipulated_PlainHelloiPOJO.jar"); plainIPOJOBundle.start(); As you see, at the very end, I start my bundle. This shows me the following error: [ERROR] : [plainhelloipojo.PlainHelloImpl-0] createInstance -> Cannot invoke the constructor (method not found) : plainhelloipojo.PlainHelloImpl.<init>(org.apache.felix.ipojo.InstanceManager) java.lang.NoSuchMethodException: plainhelloipojo.PlainHelloImpl.<init>(org.apache.felix.ipojo.InstanceManager) at java.lang.Class.getConstructor0(Class.java:2715) at java.lang.Class.getDeclaredConstructor(Class.java:1987) at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:726) at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:923) at org.apache.felix.ipojo.util.Callback.call(Callback.java:233) at org.apache.felix.ipojo.util.Callback.call(Callback.java:193) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:162) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java) at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:536) at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:418) at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:179) at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:319) at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:240) at org.apache.felix.ipojo.api.ComponentType.createInstance(ComponentType.java:79) at plainhelloipojo.Activator.start(Activator.java:38) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146) at org.apache.felix.framework.Felix.startBundle(Felix.java:2064) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942) at embedder.HostApplication.<init>(HostApplication.java:82) at embedder.Embedder.main(Embedder.java:12) [ERROR] plainhelloipojo.PlainHelloImpl : Cannot create a POJO instance, the POJO constructor cannot be found Exception in thread "main" org.osgi.framework.BundleException: Activator start error in bundle PlainHelloiPOJO [4]. at org.apache.felix.framework.Felix.activateBundle(Felix.java:2196) at org.apache.felix.framework.Felix.startBundle(Felix.java:2064) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942) at embedder.HostApplication.<init>(HostApplication.java:82) at embedder.Embedder.main(Embedder.java:12) Caused by: org.apache.felix.ipojo.ConfigurationException: The configuration is not correct for the type plainhelloipojo.PlainHelloImpl : Cannot create a POJO instance, the POJO constructor cannot be found at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:328) at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:240) at org.apache.felix.ipojo.api.ComponentType.createInstance(ComponentType.java:79) at plainhelloipojo.Activator.start(Activator.java:38) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146) ... 5 more Caused by: org.apache.felix.ipojo.ConfigurationException: Cannot create a POJO instance, the POJO constructor cannot be found at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:191) at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:319) ... 10 more Caused by: java.lang.RuntimeException: Cannot create a POJO instance, the POJO constructor cannot be found at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:766) at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:923) at org.apache.felix.ipojo.util.Callback.call(Callback.java:233) at org.apache.felix.ipojo.util.Callback.call(Callback.java:193) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:162) at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java) at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:536) at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:418) at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:179) ... 11 more Caused by: java.lang.NoSuchMethodException: plainhelloipojo.PlainHelloImpl.<init>(org.apache.felix.ipojo.InstanceManager) at java.lang.Class.getConstructor0(Class.java:2715) at java.lang.Class.getDeclaredConstructor(Class.java:1987) at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:726) ... 20 more Now, here's the weird behavior: This works fine (no errors): PrimitiveComponentType x= new PrimitiveComponentType() .setBundleContext(context) .setClassName(PlainHelloImpl.class.getName()) .addService(new Service()) // Provide the Foo service ; x.start(); ComponentInstance i = x.createInstance(); i.start(); This however doesn't work (shows the error): PrimitiveComponentType x= new PrimitiveComponentType() .setBundleContext(context) .setClassName(PlainHelloImpl.class.getName()) .setValidateMethod("start") .setInvalidateMethod("stop") .addService(new Service()) // Provide the Foo service ; x.start(); ComponentInstance i = x.createInstance(); i.start(); This also shows the error: PrimitiveComponentType x= new PrimitiveComponentType() .setBundleContext(context) .setClassName(PlainHelloImpl.class.getName()) ; x.start(); ComponentInstance i = x.createInstance(); i.start(); and many other scenarios show the error. The only case that does not show my error is when I provide a component name, bundle context, and service. Summary: Using iPOJO API shows different behavior (Only works when adding a service only) (was: Using iPOJO API shows different behavior (Only works when adding a service)) > Using iPOJO API shows different behavior (Only works when adding a service > only) > -------------------------------------------------------------------------------- > > Key: FELIX-4443 > URL: https://issues.apache.org/jira/browse/FELIX-4443 > Project: Felix > Issue Type: Bug > Components: iPOJO > Affects Versions: ipojo-runtime-1.11.1 > Environment: Windows 64 Operating System, eclipse, java > Reporter: Zaid > Labels: ipojo > > I am trying to use ipojo API to create a component type. I am embedding Felix > framework and I load my component bundle to the framework. > In my bundle I have the following class: > public class PlainHelloImpl implements PlainHello{ > @Override > public void sayHello() { > System.out.println("Plainly Hello :D"); > > } > > public PlainHelloImpl() > { > System.out.println("in contructor"); > } > > public void start() > { > > System.out.println("Hello, this is the plain hello component > start method"); > } > public void stop() > { > System.out.println("Bye, this is the plain hello component stop > method"); > } > } > and below is my activator where the error occurs: > public class Activator implements BundleActivator { > > public static BundleContext bundleContext; > public void start(BundleContext context) throws Exception { > > > System.out.println("Plain Hello iPOJO Bundle Started!"); > bundleContext=context; > > > PrimitiveComponentType x= new PrimitiveComponentType() > .setBundleContext(context) > .setClassName(PlainHelloImpl.class.getName()) > .setValidateMethod("start") > .setInvalidateMethod("stop") > .addService(new Service()) ; > > x.start(); > > ComponentInstance i = x.createInstance(); //ERROR HERE > i.start(); > > > System.out.println("and we are done!"); > > } > public void stop(BundleContext context) throws Exception { > > context = null; > System.out.println("Plain Hello iPOJO Bundle Stopped!"); > > > } > > } > In my java application, I have the following code: > Map config= new HashMap(); > > // Create a configuration property map. > //Map config = new HashMap(); > config.put(Constants.FRAMEWORK_STORAGE_CLEAN, > Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); > // Create host activator; > m_activator = new HostActivator(); > List list = new ArrayList(); > list.add(m_activator); > config.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, list); > > try > { > // Now create an instance of the framework with > // our configuration properties. > m_felix = new Felix(config); > // Now start Felix instance. > m_felix.start(); > } > catch (Exception ex) > { > System.err.println("Could not create framework: " + ex); > ex.printStackTrace(); > } > // Register the application's context as an OSGi service! > BundleContext bundleContext1 = m_felix.getBundleContext(); > > //starting ipojo required bundles > Bundle coreBundle = > bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Dropbox\\feasibility-codes\\ipojo\\ipojo-distribution-1.11.0\\bundle\\org.apache.felix.ipojo-1.11.0.jar"); > coreBundle.start(); > if(coreBundle.getState()== Bundle.ACTIVE) > System.out.println("Core Bundle is Active!"); > > Bundle compositeBundle = > bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Dropbox\\feasibility-codes\\ipojo\\ipojo-distribution-1.11.0\\bundle\\org.apache.felix.ipojo.composite-1.6.0.jar"); > compositeBundle.start(); > if(compositeBundle.getState()== Bundle.ACTIVE) > System.out.println("Composite Bundle is Active!"); > > Bundle apiBundle = > bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Dropbox\\feasibility-codes\\ipojo\\ipojo-distribution-1.11.0\\bundle\\org.apache.felix.ipojo.api-1.6.0.jar"); > apiBundle.start(); > if(apiBundle.getState()== Bundle.ACTIVE) > System.out.println("API Bundle is Active!"); > > > > //HERE I start my bundle > Bundle plainIPOJOBundle = > bundleContext1.installBundle("file:C:\\Users\\zaid.almahmoud\\Desktop\\plugins\\Manipulated_PlainHelloiPOJO.jar"); > plainIPOJOBundle.start(); > > As you see, at the very end, I start my bundle. This shows me the following > error: > [ERROR] : [plainhelloipojo.PlainHelloImpl-0] createInstance -> Cannot invoke > the constructor (method not found) : > plainhelloipojo.PlainHelloImpl.<init>(org.apache.felix.ipojo.InstanceManager) > java.lang.NoSuchMethodException: > plainhelloipojo.PlainHelloImpl.<init>(org.apache.felix.ipojo.InstanceManager) > at java.lang.Class.getConstructor0(Class.java:2715) > at java.lang.Class.getDeclaredConstructor(Class.java:1987) > at > org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:726) > at > org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:923) > at org.apache.felix.ipojo.util.Callback.call(Callback.java:233) > at org.apache.felix.ipojo.util.Callback.call(Callback.java:193) > at > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86) > at > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:162) > at > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java) > at > org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:536) > at > org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:418) > at > org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:179) > at > org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:319) > at > org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:240) > at > org.apache.felix.ipojo.api.ComponentType.createInstance(ComponentType.java:79) > at plainhelloipojo.Activator.start(Activator.java:38) > at > org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) > at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146) > at org.apache.felix.framework.Felix.startBundle(Felix.java:2064) > at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955) > at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942) > at embedder.HostApplication.<init>(HostApplication.java:82) > at embedder.Embedder.main(Embedder.java:12) > [ERROR] plainhelloipojo.PlainHelloImpl : Cannot create a POJO instance, the > POJO constructor cannot be found > Exception in thread "main" org.osgi.framework.BundleException: Activator > start error in bundle PlainHelloiPOJO [4]. > at org.apache.felix.framework.Felix.activateBundle(Felix.java:2196) > at org.apache.felix.framework.Felix.startBundle(Felix.java:2064) > at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955) > at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942) > at embedder.HostApplication.<init>(HostApplication.java:82) > at embedder.Embedder.main(Embedder.java:12) > Caused by: org.apache.felix.ipojo.ConfigurationException: The configuration > is not correct for the type plainhelloipojo.PlainHelloImpl : Cannot create a > POJO instance, the POJO constructor cannot be found > at > org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:328) > at > org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:240) > at > org.apache.felix.ipojo.api.ComponentType.createInstance(ComponentType.java:79) > at plainhelloipojo.Activator.start(Activator.java:38) > at > org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) > at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146) > ... 5 more > Caused by: org.apache.felix.ipojo.ConfigurationException: Cannot create a > POJO instance, the POJO constructor cannot be found > at > org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:191) > at > org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:319) > ... 10 more > Caused by: java.lang.RuntimeException: Cannot create a POJO instance, the > POJO constructor cannot be found > at > org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:766) > at > org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:923) > at org.apache.felix.ipojo.util.Callback.call(Callback.java:233) > at org.apache.felix.ipojo.util.Callback.call(Callback.java:193) > at > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86) > at > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__M_stateChanged(LifecycleCallbackHandler.java:162) > at > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java) > at > org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:536) > at > org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:418) > at > org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:179) > ... 11 more > Caused by: java.lang.NoSuchMethodException: > plainhelloipojo.PlainHelloImpl.<init>(org.apache.felix.ipojo.InstanceManager) > at java.lang.Class.getConstructor0(Class.java:2715) > at java.lang.Class.getDeclaredConstructor(Class.java:1987) > at > org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:726) > ... 20 more > Now, here's the weird behavior: > This works fine (no errors): > PrimitiveComponentType x= new PrimitiveComponentType() > .setBundleContext(context) > .setClassName(PlainHelloImpl.class.getName()) > .addService(new Service()) // Provide the Foo service > ; > > x.start(); > > ComponentInstance i = x.createInstance(); > i.start(); > This however doesn't work (shows the error): > PrimitiveComponentType x= new PrimitiveComponentType() > .setBundleContext(context) > .setClassName(PlainHelloImpl.class.getName()) > .setValidateMethod("start") > .setInvalidateMethod("stop") > .addService(new Service()) // Provide the Foo service > ; > > x.start(); > > ComponentInstance i = x.createInstance(); > i.start(); > This also shows the error: > PrimitiveComponentType x= new PrimitiveComponentType() > .setBundleContext(context) > .setClassName(PlainHelloImpl.class.getName()) > ; > > x.start(); > > ComponentInstance i = x.createInstance(); > i.start(); > and many other scenarios show the error. The only case that does not show my > error is when I provide a component name, bundle context, and service. -- This message was sent by Atlassian JIRA (v6.2#6252)