You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Clement Escoffier (JIRA)" <ji...@apache.org> on 2009/12/11 14:29:18 UTC

[jira] Created: (FELIX-1938) Bad error message when an Event Subscriber does not set the data type and data key

Bad error message when an Event Subscriber does not set the data type and data key
----------------------------------------------------------------------------------

                 Key: FELIX-1938
                 URL: https://issues.apache.org/jira/browse/FELIX-1938
             Project: Felix
          Issue Type: Bug
          Components: iPOJO
    Affects Versions: iPOJO-1.4.0
            Reporter: Clement Escoffier



The event admin handler should do a better job in reporting error. Especially the following subscriber (missing the data_key attribute):
@Subscriber(name = "tdmEventSubscriber-1", topics = "tdmEventTopic", data_type = "java.lang.String")
 public void receive(String msg) {
        System.out.println("[DATA RECEIVER] Receive event on tdmEventTopic : " + msg);
 }

will throw this exception:
-> [ERROR] de.akquinet.gomobile.ea.test.SubscriberTest : Cannot find callback method receive(org.osgi.service.event.Event)
[ERROR] IPOJO-Extender : An error occurs when analyzing the content or starting the management of 17
java.lang.IllegalStateException: Cannot find callback method receive(org.osgi.service.event.Event)
	at org.apache.felix.ipojo.IPojoFactory.computeDescription(IPojoFactory.java:673)
	at org.apache.felix.ipojo.IPojoFactory.computeFactoryState(IPojoFactory.java:700)
	at org.apache.felix.ipojo.ComponentFactory.addedService(ComponentFactory.java:358)
	at org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:709)
	at org.apache.felix.ipojo.util.Tracker$Tracked.trackInitialServices(Tracker.java:595)
	at org.apache.felix.ipojo.util.Tracker.open(Tracker.java:203)
	at org.apache.felix.ipojo.ComponentFactory.starting(ComponentFactory.java:235)
	at org.apache.felix.ipojo.IPojoFactory.start(IPojoFactory.java:574)
	at org.apache.felix.ipojo.Extender.createAbstractFactory(Extender.java:426)
	at org.apache.felix.ipojo.Extender.parse(Extender.java:264)
	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:669)
	at java.lang.Thread.run(Thread.java:637)


The handler has detected a problem but try to use a wrong method (receiver(Event) instead of reporting the bad configuration and rejecting it.

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


[jira] Resolved: (FELIX-1938) Bad error message when an Event Subscriber does not set the data type and data key

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

Clement Escoffier resolved FELIX-1938.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: iPOJO-1.6.0
         Assignee: Clement Escoffier

Fixed at revision 890035.
I applied the patch and modified it slightly.

Now, the error message is:
-> [ERROR] de.akquinet.gomobile.ea.test.SubscriberTest : Missing attribute in component configuration : data-key
[ERROR] IPOJO-Extender : An error occurs when analyzing the content or starting the management of 17
java.lang.IllegalStateException: Missing attribute in component configuration : data-key
	at org.apache.felix.ipojo.IPojoFactory.computeDescription(IPojoFactory.java:684)
	at org.apache.felix.ipojo.IPojoFactory.computeFactoryState(IPojoFactory.java:711)
	at org.apache.felix.ipojo.ComponentFactory.addedService(ComponentFactory.java:358)
	at org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:709)
	at org.apache.felix.ipojo.util.Tracker$Tracked.trackInitialServices(Tracker.java:595)
	at org.apache.felix.ipojo.util.Tracker.open(Tracker.java:203)
	at org.apache.felix.ipojo.ComponentFactory.starting(ComponentFactory.java:235)
	at org.apache.felix.ipojo.IPojoFactory.start(IPojoFactory.java:582)
	at org.apache.felix.ipojo.Extender.createAbstractFactory(Extender.java:430)
	at org.apache.felix.ipojo.Extender.parse(Extender.java:264)
	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:673)
	at java.lang.Thread.run(Thread.java:637)


which make more sense.

Thanks !

Clement

> Bad error message when an Event Subscriber does not set the data type and data key
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-1938
>                 URL: https://issues.apache.org/jira/browse/FELIX-1938
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0
>            Reporter: Clement Escoffier
>            Assignee: Clement Escoffier
>             Fix For: iPOJO-1.6.0
>
>         Attachments: checkMissingDataKeyAttribute.diff
>
>
> The event admin handler should do a better job in reporting error. Especially the following subscriber (missing the data_key attribute):
> @Subscriber(name = "tdmEventSubscriber-1", topics = "tdmEventTopic", data_type = "java.lang.String")
>  public void receive(String msg) {
>         System.out.println("[DATA RECEIVER] Receive event on tdmEventTopic : " + msg);
>  }
> will throw this exception:
> -> [ERROR] de.akquinet.gomobile.ea.test.SubscriberTest : Cannot find callback method receive(org.osgi.service.event.Event)
> [ERROR] IPOJO-Extender : An error occurs when analyzing the content or starting the management of 17
> java.lang.IllegalStateException: Cannot find callback method receive(org.osgi.service.event.Event)
> 	at org.apache.felix.ipojo.IPojoFactory.computeDescription(IPojoFactory.java:673)
> 	at org.apache.felix.ipojo.IPojoFactory.computeFactoryState(IPojoFactory.java:700)
> 	at org.apache.felix.ipojo.ComponentFactory.addedService(ComponentFactory.java:358)
> 	at org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:709)
> 	at org.apache.felix.ipojo.util.Tracker$Tracked.trackInitialServices(Tracker.java:595)
> 	at org.apache.felix.ipojo.util.Tracker.open(Tracker.java:203)
> 	at org.apache.felix.ipojo.ComponentFactory.starting(ComponentFactory.java:235)
> 	at org.apache.felix.ipojo.IPojoFactory.start(IPojoFactory.java:574)
> 	at org.apache.felix.ipojo.Extender.createAbstractFactory(Extender.java:426)
> 	at org.apache.felix.ipojo.Extender.parse(Extender.java:264)
> 	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:669)
> 	at java.lang.Thread.run(Thread.java:637)
> The handler has detected a problem but try to use a wrong method (receiver(Event) instead of reporting the bad configuration and rejecting it.

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


[jira] Closed: (FELIX-1938) Bad error message when an Event Subscriber does not set the data type and data key

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

Clement Escoffier closed FELIX-1938.
------------------------------------


Version released.

> Bad error message when an Event Subscriber does not set the data type and data key
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-1938
>                 URL: https://issues.apache.org/jira/browse/FELIX-1938
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0
>            Reporter: Clement Escoffier
>            Assignee: Clement Escoffier
>             Fix For: iPOJO-1.6.0
>
>         Attachments: checkMissingDataKeyAttribute.diff
>
>
> The event admin handler should do a better job in reporting error. Especially the following subscriber (missing the data_key attribute):
> @Subscriber(name = "tdmEventSubscriber-1", topics = "tdmEventTopic", data_type = "java.lang.String")
>  public void receive(String msg) {
>         System.out.println("[DATA RECEIVER] Receive event on tdmEventTopic : " + msg);
>  }
> will throw this exception:
> -> [ERROR] de.akquinet.gomobile.ea.test.SubscriberTest : Cannot find callback method receive(org.osgi.service.event.Event)
> [ERROR] IPOJO-Extender : An error occurs when analyzing the content or starting the management of 17
> java.lang.IllegalStateException: Cannot find callback method receive(org.osgi.service.event.Event)
> 	at org.apache.felix.ipojo.IPojoFactory.computeDescription(IPojoFactory.java:673)
> 	at org.apache.felix.ipojo.IPojoFactory.computeFactoryState(IPojoFactory.java:700)
> 	at org.apache.felix.ipojo.ComponentFactory.addedService(ComponentFactory.java:358)
> 	at org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:709)
> 	at org.apache.felix.ipojo.util.Tracker$Tracked.trackInitialServices(Tracker.java:595)
> 	at org.apache.felix.ipojo.util.Tracker.open(Tracker.java:203)
> 	at org.apache.felix.ipojo.ComponentFactory.starting(ComponentFactory.java:235)
> 	at org.apache.felix.ipojo.IPojoFactory.start(IPojoFactory.java:574)
> 	at org.apache.felix.ipojo.Extender.createAbstractFactory(Extender.java:426)
> 	at org.apache.felix.ipojo.Extender.parse(Extender.java:264)
> 	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:669)
> 	at java.lang.Thread.run(Thread.java:637)
> The handler has detected a problem but try to use a wrong method (receiver(Event) instead of reporting the bad configuration and rejecting it.

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


[jira] Commented: (FELIX-1938) Bad error message when an Event Subscriber does not set the data type and data key

Posted by "Pierre Bourret (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789394#action_12789394 ] 

Pierre Bourret commented on FELIX-1938:
---------------------------------------

Right ! The subscriber configuration parser do not check that if the data-type attribute is provided, the data-key attribute is set. The handler consider that a subscriber configured in this manner is not a data-subscriber beacause the data-key is not set, and so try to find the classical event callback (the one that receive org.osgi.service.event.Event).

The attached patch should fix this. Because of a lack of time, it has not been tested, so please send feedback :)

> Bad error message when an Event Subscriber does not set the data type and data key
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-1938
>                 URL: https://issues.apache.org/jira/browse/FELIX-1938
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0
>            Reporter: Clement Escoffier
>
> The event admin handler should do a better job in reporting error. Especially the following subscriber (missing the data_key attribute):
> @Subscriber(name = "tdmEventSubscriber-1", topics = "tdmEventTopic", data_type = "java.lang.String")
>  public void receive(String msg) {
>         System.out.println("[DATA RECEIVER] Receive event on tdmEventTopic : " + msg);
>  }
> will throw this exception:
> -> [ERROR] de.akquinet.gomobile.ea.test.SubscriberTest : Cannot find callback method receive(org.osgi.service.event.Event)
> [ERROR] IPOJO-Extender : An error occurs when analyzing the content or starting the management of 17
> java.lang.IllegalStateException: Cannot find callback method receive(org.osgi.service.event.Event)
> 	at org.apache.felix.ipojo.IPojoFactory.computeDescription(IPojoFactory.java:673)
> 	at org.apache.felix.ipojo.IPojoFactory.computeFactoryState(IPojoFactory.java:700)
> 	at org.apache.felix.ipojo.ComponentFactory.addedService(ComponentFactory.java:358)
> 	at org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:709)
> 	at org.apache.felix.ipojo.util.Tracker$Tracked.trackInitialServices(Tracker.java:595)
> 	at org.apache.felix.ipojo.util.Tracker.open(Tracker.java:203)
> 	at org.apache.felix.ipojo.ComponentFactory.starting(ComponentFactory.java:235)
> 	at org.apache.felix.ipojo.IPojoFactory.start(IPojoFactory.java:574)
> 	at org.apache.felix.ipojo.Extender.createAbstractFactory(Extender.java:426)
> 	at org.apache.felix.ipojo.Extender.parse(Extender.java:264)
> 	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:669)
> 	at java.lang.Thread.run(Thread.java:637)
> The handler has detected a problem but try to use a wrong method (receiver(Event) instead of reporting the bad configuration and rejecting it.

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


[jira] Updated: (FELIX-1938) Bad error message when an Event Subscriber does not set the data type and data key

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

Pierre Bourret updated FELIX-1938:
----------------------------------

    Attachment: checkMissingDataKeyAttribute.diff

The patch that checks the presence of the data-key attribute when the data-type attribute is provided.

> Bad error message when an Event Subscriber does not set the data type and data key
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-1938
>                 URL: https://issues.apache.org/jira/browse/FELIX-1938
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0
>            Reporter: Clement Escoffier
>         Attachments: checkMissingDataKeyAttribute.diff
>
>
> The event admin handler should do a better job in reporting error. Especially the following subscriber (missing the data_key attribute):
> @Subscriber(name = "tdmEventSubscriber-1", topics = "tdmEventTopic", data_type = "java.lang.String")
>  public void receive(String msg) {
>         System.out.println("[DATA RECEIVER] Receive event on tdmEventTopic : " + msg);
>  }
> will throw this exception:
> -> [ERROR] de.akquinet.gomobile.ea.test.SubscriberTest : Cannot find callback method receive(org.osgi.service.event.Event)
> [ERROR] IPOJO-Extender : An error occurs when analyzing the content or starting the management of 17
> java.lang.IllegalStateException: Cannot find callback method receive(org.osgi.service.event.Event)
> 	at org.apache.felix.ipojo.IPojoFactory.computeDescription(IPojoFactory.java:673)
> 	at org.apache.felix.ipojo.IPojoFactory.computeFactoryState(IPojoFactory.java:700)
> 	at org.apache.felix.ipojo.ComponentFactory.addedService(ComponentFactory.java:358)
> 	at org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:709)
> 	at org.apache.felix.ipojo.util.Tracker$Tracked.trackInitialServices(Tracker.java:595)
> 	at org.apache.felix.ipojo.util.Tracker.open(Tracker.java:203)
> 	at org.apache.felix.ipojo.ComponentFactory.starting(ComponentFactory.java:235)
> 	at org.apache.felix.ipojo.IPojoFactory.start(IPojoFactory.java:574)
> 	at org.apache.felix.ipojo.Extender.createAbstractFactory(Extender.java:426)
> 	at org.apache.felix.ipojo.Extender.parse(Extender.java:264)
> 	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:669)
> 	at java.lang.Thread.run(Thread.java:637)
> The handler has detected a problem but try to use a wrong method (receiver(Event) instead of reporting the bad configuration and rejecting it.

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