Look into the code, this error only happens when the following 2 conditions
are met:
1) One notification has not notificationType associated, Eagle framework
uses default notification type "email", while
2) Notification type email is not initialized in alertNotifications table

check out

private Map<String, NotificationPlugin>
pluginsForPolicy(AlertDefinitionAPIEntity policy) throws Exception{

... ...

if(notificationType == null){
    LOG.warn("notificationType is null so use default notification
type email for this policy  " + policy);
    notifications.put(NotificationConstants.EMAIL_NOTIFICATION,
plugins.get(NotificationConstants.EMAIL_NOTIFICATION));
}

Please check with log, if that is the root cause, it is
straightforward to fix that.

I saw https://issues.apache.org/jira/browse/EAGLE-228, let me know if
you want me to fix that.


For documentation of how user creates new plugin and deploy it, we
need that in eagle site.


Thanks

Edward



On Sun, Apr 10, 2016 at 2:45 AM, Chen, Hao <hao.ch...@ebay.com> wrote:

> I know it’s because notification plugin is not correctly, so my question
> is:
>
> 1) Is there any doc/guide to help user to know how to setup the
> notification plugin or metadata ?
> 2) Even not set, the notification system should  have some default
> behavior but not just throw exception.
>
> Thanks,
> Hao
>
>
> On 4/9/16, 9:30 PM, "Senthil Kumar" <senthilec...@gmail.com> wrote:
>
> >Here is the Piece of Code which Triggers Notifications:
> >
> >for(NotificationPlugin plugin : plugins){
> >try {
> >LOG.info("execute notification plugin " + plugin);
> >plugin.onAlert(entity);
> >}catch(Exception ex){
> >LOG.error("fail invoking plugin's onAlert, continue ", ex);
> >}
> >
> >Code throws exception here.. Seems to be the Plugin is Not Loaded or
> >Initialized Properly ..
> >
> >
> >What was the Notification Type used in  this Test Case ?
> >
> >--Senthil
> >
> >On Sat, Apr 9, 2016 at 6:52 PM, Liangfei.Su <suliang...@gmail.com> wrote:
> >
> >> Looks like you don't have notification initialized?
> >>
> >> On Sat, Apr 9, 2016 at 7:29 PM, Hao Chen <h...@apache.org> wrote:
> >>
> >> > NotificationPluginManager seems not very stable, any docs/guideline
> for
> >> > this part?
> >> >
> >> > 68771 [Thread-11-AlertNotificationExecutor_8] ERROR
> >> > org.apache.eagle.notification.plugin.NotificationPluginManagerImpl -
> fail
> >> > invoking plugin's onAlert, continue
> >> > java.lang.NullPointerException: null
> >> > at
> >> >
> >> >
> >>
> org.apache.eagle.notification.plugin.NotificationPluginManagerImpl.notifyAlert(NotificationPluginManagerImpl.java:83)
> >> > ~[eagle-topology-0.3.0-incubating-assembly.jar:na]
> >> > at
> >> >
> >> >
> >>
> org.apache.eagle.alert.notification.AlertNotificationExecutor.processAlerts(AlertNotificationExecutor.java:98)
> >> > [eagle-topology-0.3.0-incubating-assembly.jar:na]
> >> > at
> >> >
> >> >
> >>
> org.apache.eagle.alert.notification.AlertNotificationExecutor.flatMap(AlertNotificationExecutor.java:93)
> >> > [eagle-topology-0.3.0-incubating-assembly.jar:na]
> >> > at
> >> >
> >> >
> >>
> org.apache.eagle.datastream.storm.JavaStormBoltWrapper.execute(JavaStormBoltWrapper.scala:38)
> >> > [eagle-topology-0.3.0-incubating-assembly.jar:na]
> >> > at
> >> >
> >> >
> >>
> backtype.storm.daemon.executor$fn__4722$tuple_action_fn__4724.invoke(executor.clj:633)
> >> > [storm-core-0.9.4.jar:0.9.4]
> >> > at
> >> >
> >> >
> >>
> backtype.storm.daemon.executor$mk_task_receiver$fn__4645.invoke(executor.clj:401)
> >> > [storm-core-0.9.4.jar:0.9.4]
> >> > at
> >> >
> >> >
> >>
> backtype.storm.disruptor$clojure_handler$reify__1446.onEvent(disruptor.clj:58)
> >> > [storm-core-0.9.4.jar:0.9.4]
> >> > at
> >> >
> >> >
> >>
> backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:125)
> >> > [storm-core-0.9.4.jar:0.9.4]
> >> > at
> >> >
> >> >
> >>
> backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99)
> >> > [storm-core-0.9.4.jar:0.9.4]
> >> > at
> >> >
> >> >
> >>
> backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80)
> >> > [storm-core-0.9.4.jar:0.9.4]
> >> > at
> >> >
> >> >
> >>
> backtype.storm.daemon.executor$fn__4722$fn__4734$fn__4781.invoke(executor.clj:748)
> >> > [storm-core-0.9.4.jar:0.9.4]
> >> > at backtype.storm.util$async_loop$fn__458.invoke(util.clj:463)
> >> > [storm-core-0.9.4.jar:0.9.4]
> >> > at clojure.lang.AFn.run(AFn.java:24)
> >> > [eagle-topology-0.3.0-incubating-assembly.jar:na]
> >> > at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]
> >> >
> >> > Thanks,
> >> > Hao
> >> >
> >>
>

Reply via email to