Problem running application alongwith ERMA monitors
Forum » General / Help Requests » Problem running application alongwith ERMA monitors
Started by: ab777ab777
On: 1218040448|%e %b %Y, %H:%M %Z|agohover
Number of posts: 6
rss icon RSS: New posts
Problem running application alongwith ERMA monitors
ab777ab777 1218040448|%e %b %Y, %H:%M %Z|agohover

I want to use the functionality provided by ERMA monitors. I created a sample Java application and hooked the erma monitor APIs into it. Also, I configured ERMA using the steps provided by you.

But, I am not completely clear from the documentation. So, when I ran the application, I got this exception:

Exception in thread "main" java.lang.IllegalStateException: processorFactory is null
at com.orbitz.monitoring.api.MonitoringEngine.startup(MonitoringEngine.java:89)
at ErmaTest.main(ErmaTest.java:24)
ErmaTest.java: 24 has MonitoringEngine.getInstance().startup();

Can you please help me in using the monitor functionality and viewing the captured events at the processor side. Do I need to hook some additional code in the application besides calling the monitoringEngine startup/shutdown and monitor APIs.

Thanks

unfold Problem running application alongwith ERMA monitors by ab777ab777, 1218040448|%e %b %Y, %H:%M %Z|agohover
Re: Problem running application alongwith ERMA monitors
smullinssmullins 1218046668|%e %b %Y, %H:%M %Z|agohover

Hi ab777,
You're getting that error because you haven't specified the processor factory for your MonitoringEngine. You need to do something like this:

ProcessGroup pg = new ProcessGroup(someMonitorProcessor);
SimpleMonitorProcessorFactory factory = new SimpleMonitorProcessorFactory(new ProcessGroup[] {pg});
MonitoringEngine.getInstance().setProcessorFactory(factory);

If it helps, you may want to look at the unit tests for these classes to get a clearer picture for how they work together. Think of a ProcessGroup as a way to route Monitors to a set of MonitorProcessors.

unfold Re: Problem running application alongwith ERMA monitors by smullinssmullins, 1218046668|%e %b %Y, %H:%M %Z|agohover
Re: Problem running application alongwith ERMA monitors
ab777ab777 1218056155|%e %b %Y, %H:%M %Z|agohover

Thanks for the suggestion.

Am I missing something on the documentation page, as I didn't find the above code. One more thing: how to initialize "someMonitorProcessor" above? Its an error when I create an instance of MonitorProcessor.

What else do I need to do to observe the captured events? I have the following:
1) Test application alongwith monitors
2) In the same project, I have configured ERMA
3) I assume I need to run the MonitorProcessor in a different project right?

Thank you very much

unfold Re: Problem running application alongwith ERMA monitors by ab777ab777, 1218056155|%e %b %Y, %H:%M %Z|agohover
Re: Problem running application alongwith ERMA monitors
smullinssmullins 1218057128|%e %b %Y, %H:%M %Z|agohover

Typically, we configure ERMA via Spring wiring. That's where we create our ProcessGroups and MonitorProcessors. How have you configured ERMA for your project?

The above code was an example of how to configure the processor factory programatically, if you don't use Spring for dependency injection.

MonitorProcessors are passed into the ProcessGroups and are designed to consume Monitors and process them in some way. An example would be the LoggingMonitorProcessor which as it receives Monitors from the MonitoringEngine it will log them out.

unfold Re: Problem running application alongwith ERMA monitors by smullinssmullins, 1218057128|%e %b %Y, %H:%M %Z|agohover
Re: Problem running application alongwith ERMA monitors
ab777ab777 1218058539|%e %b %Y, %H:%M %Z|agohover

I am getting your idea now. Can you please help me out.

I am trying the following:

. I have configured the ERMA in a xml file using the steps given on the link: http://erma.wikidot.com/configuring-erma-using-spring
. I have a simple Java application in the same project that uses the ERMA monitor APIs. But when I called MonitoringEngine.getInstance().startup() in my application, it was giving the error: processorFactory is null. Is there anything else that I need to do in my application?

Do I need to run the MonitorProcessor in a separate project.

Do let me know if you need any other information related to my code. I will appreciate that.

Thanks

unfold Re: Problem running application alongwith ERMA monitors by ab777ab777, 1218058539|%e %b %Y, %H:%M %Z|agohover
Re: Problem running application alongwith ERMA monitors
mokeefemokeefe 1218554899|%e %b %Y, %H:%M %Z|agohover

If you have configured ERMA using Spring wiring, including the MonitoringEngineManager bean, then you shouldn't need to call MonitoringEngine.getInstance().startup() within your application.

Could you post your xml here and we'll review it?

unfold Re: Problem running application alongwith ERMA monitors by mokeefemokeefe, 1218554899|%e %b %Y, %H:%M %Z|agohover
New post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License