Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-1938

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • iPOJO-1.4.0
    • iPOJO-1.6.0
    • iPOJO
    • None

    Description

      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.

      Attachments

        1. checkMissingDataKeyAttribute.diff
          0.8 kB
          Pierre Bourret

        Activity

          People

            clement.escoffier Clement Escoffier
            clement.escoffier Clement Escoffier
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: