You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "François Fornaciari (Created JIRA)" <ji...@apache.org> on 2011/10/18 20:21:10 UTC

[jira] [Created] (FELIX-3172) Error when calling BundleContext.register(Class, Object, Dictionary)

Error when calling BundleContext.register(Class, Object, Dictionary)
--------------------------------------------------------------------

                 Key: FELIX-3172
                 URL: https://issues.apache.org/jira/browse/FELIX-3172
             Project: Felix
          Issue Type: Bug
          Components: iPOJO
    Affects Versions: iPOJO-1.8.0
         Environment: Java 1.6, Apache Felix 4.0.1
            Reporter: François Fornaciari


I have an error when I try to call the simple BundleContext.register(Class, Object, Dictionary) method (note the type of the first argument).
It seems that the new signature of the BundleContext.register() method is not recognised by the IPojoContext.

This simple example reproduces the issue:

@Component
@Instantiate
public class Test{
	
	public Test(BundleContext bundleContext) {
		bundleContext.registerService(String.class, "test", null);
	}

}

With the following trace:

g! [ERROR]  : [com.fornacif.osgi.manager.internal.Manager-0] createInstance -> Cannot invoke the constructor method - the constructor throws an except
ion : org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistr
ation;
java.lang.AbstractMethodError: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi
/framework/ServiceRegistration;
        at com.fornacif.osgi.manager.internal.Manager.<init>(Manager.java:12)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:656)
        at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
        at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
        at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
        at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
        at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
        at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
        at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
        at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
        at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
        at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
        at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
        at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
        at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
        at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
        at java.lang.Thread.run(Unknown Source)
[ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
java.lang.RuntimeException: Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerS
ervice(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
        at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:696)
        at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
        at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
        at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
        at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
        at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
        at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
        at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
        at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
        at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
        at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
        at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
        at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
        at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
        at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
        at java.lang.Thread.run(Unknown Source)
[ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
[ERROR] iPOJO Instance Creator : A matching factory was found for {component=com.fornacif.osgi.manager.internal.Manager, instance.name=com.fornacif.os
gi.manager.internal.Manager-0}, but the instantiation failed : The configuration is not correct for the type com.fornacif.osgi.manager.internal.Manage
r : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;
Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Assigned] (FELIX-3172) Error when calling BundleContext.register(Class, Object, Dictionary)

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

Clement Escoffier reassigned FELIX-3172:
----------------------------------------

    Assignee: Clement Escoffier
    
> Error when calling BundleContext.register(Class, Object, Dictionary)
> --------------------------------------------------------------------
>
>                 Key: FELIX-3172
>                 URL: https://issues.apache.org/jira/browse/FELIX-3172
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.8.0
>         Environment: Java 1.6, Apache Felix 4.0.1
>            Reporter: François Fornaciari
>            Assignee: Clement Escoffier
>
> I have an error when I try to call the simple BundleContext.register(Class, Object, Dictionary) method (note the type of the first argument).
> It seems that the new signature of the BundleContext.register() method is not recognised by the IPojoContext.
> This simple example reproduces the issue:
> @Component
> @Instantiate
> public class Test{
> 	
> 	public Test(BundleContext bundleContext) {
> 		bundleContext.registerService(String.class, "test", null);
> 	}
> }
> With the following trace:
> g! [ERROR]  : [com.fornacif.osgi.manager.internal.Manager-0] createInstance -> Cannot invoke the constructor method - the constructor throws an except
> ion : org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistr
> ation;
> java.lang.AbstractMethodError: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi
> /framework/ServiceRegistration;
>         at com.fornacif.osgi.manager.internal.Manager.<init>(Manager.java:12)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:656)
>         at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
>         at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
>         at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
>         at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
>         at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
>         at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
>         at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>         at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>         at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>         at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
>         at java.lang.Thread.run(Unknown Source)
> [ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
> jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
> java.lang.RuntimeException: Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerS
> ervice(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
>         at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:696)
>         at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
>         at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
>         at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
>         at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
>         at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
>         at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
>         at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>         at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>         at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>         at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
>         at java.lang.Thread.run(Unknown Source)
> [ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
> jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
> [ERROR] iPOJO Instance Creator : A matching factory was found for {component=com.fornacif.osgi.manager.internal.Manager, instance.name=com.fornacif.os
> gi.manager.internal.Manager-0}, but the instantiation failed : The configuration is not correct for the type com.fornacif.osgi.manager.internal.Manage
> r : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;
> Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Resolved] (FELIX-3172) Error when calling BundleContext.register(Class, Object, Dictionary)

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

Clement Escoffier resolved FELIX-3172.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: ipojo-core-1.8.2

Fixed in trunk.
Implements the new API
Updates service registration to avoid the cast issue
Propagates changes to iPOJO Service Context (and implementations)
Configures the maven-compiler-plugin to generate 1.4 bytecode (same trick as for the Felix framework)

Could you check ?

Thanks
                
> Error when calling BundleContext.register(Class, Object, Dictionary)
> --------------------------------------------------------------------
>
>                 Key: FELIX-3172
>                 URL: https://issues.apache.org/jira/browse/FELIX-3172
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.8.0
>         Environment: Java 1.6, Apache Felix 4.0.1
>            Reporter: François Fornaciari
>            Assignee: Clement Escoffier
>             Fix For: ipojo-core-1.8.2
>
>
> I have an error when I try to call the simple BundleContext.register(Class, Object, Dictionary) method (note the type of the first argument).
> It seems that the new signature of the BundleContext.register() method is not recognised by the IPojoContext.
> This simple example reproduces the issue:
> @Component
> @Instantiate
> public class Test{
> 	
> 	public Test(BundleContext bundleContext) {
> 		bundleContext.registerService(String.class, "test", null);
> 	}
> }
> With the following trace:
> g! [ERROR]  : [com.fornacif.osgi.manager.internal.Manager-0] createInstance -> Cannot invoke the constructor method - the constructor throws an except
> ion : org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistr
> ation;
> java.lang.AbstractMethodError: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi
> /framework/ServiceRegistration;
>         at com.fornacif.osgi.manager.internal.Manager.<init>(Manager.java:12)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:656)
>         at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
>         at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
>         at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
>         at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
>         at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
>         at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
>         at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>         at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>         at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>         at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
>         at java.lang.Thread.run(Unknown Source)
> [ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
> jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
> java.lang.RuntimeException: Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerS
> ervice(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
>         at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:696)
>         at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
>         at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
>         at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
>         at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
>         at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
>         at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
>         at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>         at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>         at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>         at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
>         at java.lang.Thread.run(Unknown Source)
> [ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
> jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
> [ERROR] iPOJO Instance Creator : A matching factory was found for {component=com.fornacif.osgi.manager.internal.Manager, instance.name=com.fornacif.os
> gi.manager.internal.Manager-0}, but the instantiation failed : The configuration is not correct for the type com.fornacif.osgi.manager.internal.Manage
> r : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;
> Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (FELIX-3172) Error when calling BundleContext.register(Class, Object, Dictionary)

Posted by "Clement Escoffier (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131429#comment-13131429 ] 

Clement Escoffier commented on FELIX-3172:
------------------------------------------

Hi,

Weird error as it should compile using Java 5 and the ServiceReference<S> class from OSGi Core 4.3. Will update the whole trunk and check.

The snapshot is available from https://repository.apache.org/content/repositories/snapshots/org/apache/felix/org.apache.felix.ipojo/1.9.0-SNAPSHOT/org.apache.felix.ipojo-1.9.0-20111020.073814-3.jar

                
> Error when calling BundleContext.register(Class, Object, Dictionary)
> --------------------------------------------------------------------
>
>                 Key: FELIX-3172
>                 URL: https://issues.apache.org/jira/browse/FELIX-3172
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.8.0
>         Environment: Java 1.6, Apache Felix 4.0.1
>            Reporter: François Fornaciari
>            Assignee: Clement Escoffier
>             Fix For: ipojo-core-1.8.2
>
>
> I have an error when I try to call the simple BundleContext.register(Class, Object, Dictionary) method (note the type of the first argument).
> It seems that the new signature of the BundleContext.register() method is not recognised by the IPojoContext.
> This simple example reproduces the issue:
> @Component
> @Instantiate
> public class Test{
> 	
> 	public Test(BundleContext bundleContext) {
> 		bundleContext.registerService(String.class, "test", null);
> 	}
> }
> With the following trace:
> g! [ERROR]  : [com.fornacif.osgi.manager.internal.Manager-0] createInstance -> Cannot invoke the constructor method - the constructor throws an except
> ion : org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistr
> ation;
> java.lang.AbstractMethodError: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi
> /framework/ServiceRegistration;
>         at com.fornacif.osgi.manager.internal.Manager.<init>(Manager.java:12)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:656)
>         at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
>         at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
>         at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
>         at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
>         at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
>         at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
>         at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>         at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>         at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>         at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
>         at java.lang.Thread.run(Unknown Source)
> [ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
> jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
> java.lang.RuntimeException: Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerS
> ervice(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
>         at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:696)
>         at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
>         at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
>         at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
>         at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
>         at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
>         at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
>         at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>         at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>         at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>         at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
>         at java.lang.Thread.run(Unknown Source)
> [ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
> jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
> [ERROR] iPOJO Instance Creator : A matching factory was found for {component=com.fornacif.osgi.manager.internal.Manager, instance.name=com.fornacif.os
> gi.manager.internal.Manager-0}, but the instantiation failed : The configuration is not correct for the type com.fornacif.osgi.manager.internal.Manage
> r : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;
> Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (FELIX-3172) Error when calling BundleContext.register(Class, Object, Dictionary)

Posted by "François Fornaciari (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131356#comment-13131356 ] 

François Fornaciari commented on FELIX-3172:
--------------------------------------------

Thanks Clément for fixing this issue.

Unfortunately, after having updated all Felix projects from the trunk, I can't build the iPOJO modules due to compilation errors and specially the core module.
I tried while Maven 2 or 3.

Below one of the error I have : 
[ERROR] D:\dev\programs\felix\ipojo\core\src\main\java\org\apache\felix\ipojo\IPojoContext.java:[268,44] error: type ServiceReference does not take pa
rameters

It's been a while I didn't compile iPOJO modules from trunk so I don't know if my configuration is ok.
Any idea ?

Otherwise, is there a location where I can find the snapshot artifact?
                
> Error when calling BundleContext.register(Class, Object, Dictionary)
> --------------------------------------------------------------------
>
>                 Key: FELIX-3172
>                 URL: https://issues.apache.org/jira/browse/FELIX-3172
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.8.0
>         Environment: Java 1.6, Apache Felix 4.0.1
>            Reporter: François Fornaciari
>            Assignee: Clement Escoffier
>             Fix For: ipojo-core-1.8.2
>
>
> I have an error when I try to call the simple BundleContext.register(Class, Object, Dictionary) method (note the type of the first argument).
> It seems that the new signature of the BundleContext.register() method is not recognised by the IPojoContext.
> This simple example reproduces the issue:
> @Component
> @Instantiate
> public class Test{
> 	
> 	public Test(BundleContext bundleContext) {
> 		bundleContext.registerService(String.class, "test", null);
> 	}
> }
> With the following trace:
> g! [ERROR]  : [com.fornacif.osgi.manager.internal.Manager-0] createInstance -> Cannot invoke the constructor method - the constructor throws an except
> ion : org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistr
> ation;
> java.lang.AbstractMethodError: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi
> /framework/ServiceRegistration;
>         at com.fornacif.osgi.manager.internal.Manager.<init>(Manager.java:12)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:656)
>         at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
>         at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
>         at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
>         at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
>         at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
>         at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
>         at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>         at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>         at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>         at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
>         at java.lang.Thread.run(Unknown Source)
> [ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
> jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
> java.lang.RuntimeException: Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerS
> ervice(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
>         at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:696)
>         at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
>         at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
>         at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
>         at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
>         at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
>         at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
>         at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>         at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>         at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>         at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
>         at java.lang.Thread.run(Unknown Source)
> [ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
> jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
> [ERROR] iPOJO Instance Creator : A matching factory was found for {component=com.fornacif.osgi.manager.internal.Manager, instance.name=com.fornacif.os
> gi.manager.internal.Manager-0}, but the instantiation failed : The configuration is not correct for the type com.fornacif.osgi.manager.internal.Manage
> r : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;
> Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (FELIX-3172) Error when calling BundleContext.register(Class, Object, Dictionary)

Posted by "François Fornaciari (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131840#comment-13131840 ] 

François Fornaciari commented on FELIX-3172:
--------------------------------------------

Replacing the iPOJO core bundle (1.8.0) by the trunk version (1.9.0-SNAPSHOT) fixed the issue.

Thanks.
                
> Error when calling BundleContext.register(Class, Object, Dictionary)
> --------------------------------------------------------------------
>
>                 Key: FELIX-3172
>                 URL: https://issues.apache.org/jira/browse/FELIX-3172
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.8.0
>         Environment: Java 1.6, Apache Felix 4.0.1
>            Reporter: François Fornaciari
>            Assignee: Clement Escoffier
>             Fix For: ipojo-core-1.8.2
>
>
> I have an error when I try to call the simple BundleContext.register(Class, Object, Dictionary) method (note the type of the first argument).
> It seems that the new signature of the BundleContext.register() method is not recognised by the IPojoContext.
> This simple example reproduces the issue:
> @Component
> @Instantiate
> public class Test{
> 	
> 	public Test(BundleContext bundleContext) {
> 		bundleContext.registerService(String.class, "test", null);
> 	}
> }
> With the following trace:
> g! [ERROR]  : [com.fornacif.osgi.manager.internal.Manager-0] createInstance -> Cannot invoke the constructor method - the constructor throws an except
> ion : org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistr
> ation;
> java.lang.AbstractMethodError: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi
> /framework/ServiceRegistration;
>         at com.fornacif.osgi.manager.internal.Manager.<init>(Manager.java:12)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:656)
>         at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
>         at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
>         at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
>         at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
>         at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
>         at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
>         at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>         at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>         at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>         at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
>         at java.lang.Thread.run(Unknown Source)
> [ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
> jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
> java.lang.RuntimeException: Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerS
> ervice(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
>         at org.apache.felix.ipojo.InstanceManager.createObject(InstanceManager.java:696)
>         at org.apache.felix.ipojo.InstanceManager.getPojoObject(InstanceManager.java:844)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:156)
>         at org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)
>         at org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:471)
>         at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:353)
>         at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:166)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:301)
>         at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:238)
>         at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:343)
>         at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:89)
>         at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
>         at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
>         at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>         at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:682)
>         at java.lang.Thread.run(Unknown Source)
> [ERROR] com.fornacif.osgi.manager.internal.Manager : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipo
> jo.IPojoContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
> [ERROR] iPOJO Instance Creator : A matching factory was found for {component=com.fornacif.osgi.manager.internal.Manager, instance.name=com.fornacif.os
> gi.manager.internal.Manager-0}, but the instantiation failed : The configuration is not correct for the type com.fornacif.osgi.manager.internal.Manage
> r : Cannot create a POJO instance, the POJO constructor has thrown an exception: org.apache.felix.ipojo.IPojoContext.registerService(Ljava/lang/Class;
> Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira