Closed lingpri closed 4 years ago
@lingpri The problem is that you are trying to inject a SlackClient
instance in the SlackEventNotification
constructor:
https://github.com/Graylog2/graylog-plugin-integrations/pull/575/files#diff-b505e0eebc5d106c7d5e05bbf9ac78eaR69
In line 51 in SlackClient
you try to inject the SlackEventNotificationConfig
. That doesn't work because there is no binding for it. (and there cannot be one)
In line 90 of SlackEventNotification
you already create a new SlackClient
instance, passing in the SlackEventNotificationConfig
you got from theEventNotificationContext
. So to fix the binding error, you can just remove the injection of the SlackClient
in line 69 in SlackEventNotification
.
@lingpri The problem is that you are trying to inject a
SlackClient
instance in theSlackEventNotification
constructor: https://github.com/Graylog2/graylog-plugin-integrations/pull/575/files#diff-b505e0eebc5d106c7d5e05bbf9ac78eaR69In line 51 in
SlackClient
you try to inject theSlackEventNotificationConfig
. That doesn't work because there is no binding for it. (and there cannot be one)In line 90 of
SlackEventNotification
you already create a newSlackClient
instance, passing in theSlackEventNotificationConfig
you got from theEventNotificationContext
. So to fix the binding error, you can just remove the injection of theSlackClient
in line 69 inSlackEventNotification
.
when I follow your advice , I'm able to start the graylog server. In SlackEventNotification.java I didn't want to write the line,
SlackClient slackClient = new SlackClient(config);
defeats the purpose of dependency injection. I will try refactoring the code.
GuiceError while adding a notification type.
addNotificationType(SlackEventNotificationConfig.TYPE_NAME, SlackEventNotificationConfig.class, SlackEventNotification.class, SlackEventNotification.Factory.class);