Spring configuration for plugins

39 views
Skip to first unread message

Jürgen Schmied

unread,
Dec 16, 2014, 10:04:15 AM12/16/14
to java...@googlegroups.com
Hi!

I try to configure the plugins from context.xml:
----
    <bean id="simonManager" class="org.javasimon.spring.ManagerFactoryBean">
        <property name="callbacks">
            <list>
                <bean class="org.javasimon.callback.timeline.TimelineCallback">
                    <constructor-arg index="0" value="10" />
                    <constructor-arg index="1" value="60000" />
                </bean>
                <bean class="org.javasimon.callback.calltree.CallTreeCallback">
                    <constructor-arg value="200" />
                </bean>
            </list>
        </property>
    </bean>

    <bean id="monitoringInterceptor" class="org.javasimon.spring.MonitoringInterceptor" >
        <constructor-arg ref="simonManager"/>
    </bean>

    <aop:config>
        <aop:pointcut id="allRMIServicePointcut" expression="execution(* xxxxxxx.*.*Service.*(..))" />
        <aop:advisor advice-ref="monitoringInterceptor" pointcut-ref="allRMIServicePointcut" />
    </aop:config>
---
    <servlet>
        <servlet-name>SimonConsoleServlet</servlet-name>
        <servlet-class>org.javasimon.console.SimonConsoleServlet</servlet-class>
        <init-param>
            <param-name>url-prefix</param-name>
            <param-value>/javasimon-console</param-value>
        </init-param>
        <init-param>
            <param-name>plugin-classes</param-name>
            <param-value>org.javasimon.console.plugin.TimelineDetailPlugin,org.javasimon.console.plugin.CallTreeDetailPlugin</param-value>
        </init-param>
    </servlet>
----

everything works, but the Timeline and Calltree are not shown in the webconsole. Do I miss something?

Thanks!

Juergen

Gérald

unread,
Dec 16, 2014, 11:57:45 AM12/16/14
to java...@googlegroups.com
You need to register the corresponding callbacks in the simon manager:

// TimelineCallback 10 buckets of 1 minute each
SimonManager.callback().addCallback(new TimelineCallback(10, 60000L));
// CallTreeCallback
SimonManager.callback().addCallback(new CallTreeCallback(50));

Gérald

Jürgen Schmied

unread,
Dec 16, 2014, 2:28:17 PM12/16/14
to java...@googlegroups.com
> You need to register the corresponding callbacks in the simon manager

I think the bean configuration does exactly this: it creates the two callback objects and initializes the ManagerFactoryBean with them.
Additionally it gives the ManagerFactoryBean to MonitoringInterceptor. The spring log shows the Objects are created.

Where sholud I put the SimonManager.callback().addCallback instead?

Juergen

Gérald

unread,
Dec 16, 2014, 3:17:39 PM12/16/14
to java...@googlegroups.com
You're right, your callback declaration is alright, I missed that part of your code at first read.
Can you see your Simons in the web console?
   No -> the console servlet is not plugged on the same Simon manager instance.
   Yes -> check whether JavaScript resources are properly loaded using FireFox+FireBug or Chrome Dev Tools and the network panel. Are there 404 errors on JavaScript loading?

Gérald

Jürgen Schmied

unread,
Dec 16, 2014, 4:32:14 PM12/16/14
to java...@googlegroups.com
Yes I see the Simons and thair values everything works but the plugins.
The *.js for the plugins is not loaded (net event tried, no 404).
Can I enable debug messages somehow?

--
You received this message because you are subscribed to the Google Groups "javasimon" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javasimon+...@googlegroups.com.
To post to this group, send email to java...@googlegroups.com.
Visit this group at http://groups.google.com/group/javasimon.
For more options, visit https://groups.google.com/d/optout.

Jürgen Schmied

unread,
Dec 16, 2014, 4:33:19 PM12/16/14
to java...@googlegroups.com
> the console servlet is not plugged on the same Simon manager instance.
How can i check if there is more than one Simon manager instance?

Thanks!

juergen

Gérald

unread,
Dec 17, 2014, 3:30:33 AM12/17/14
to java...@googlegroups.com
What returns the HTTP request to /data/plugins.json?
What version are you using?

We should add log to tell which plugins are effectively loaded.

Gerald

Gérald

unread,
Dec 17, 2014, 4:24:14 AM12/17/14
to java...@googlegroups.com
Don't look further, there is a bug in the Servlet code.
The fix is on the way.

Gérald

Richard Richter

unread,
Dec 17, 2014, 4:29:48 AM12/17/14
to java...@googlegroups.com
Hello

I owe the project (and Gerald) some release, so after this fix we'll
release 4.0.1 before Christmas. :-)

Cheers

Virgo

Gérald

unread,
Dec 17, 2014, 4:35:37 AM12/17/14
to java...@googlegroups.com


Le mercredi 17 décembre 2014 10:29:48 UTC+1, Virgo47 a écrit :
Hello

I owe the project (and Gerald) some release, so after this fix we'll
release 4.0.1 before Christmas. :-)

Cheers

Virgo

On Wed, Dec 17, 2014 at 10:24 AM, Gérald <gerald....@gmail.com> wrote:
> Don't look further, there is a bug in the Servlet code.
> The fix is on the way.
>
> Gérald
>
> Le mercredi 17 décembre 2014 09:30:33 UTC+1, Gérald a écrit :
>>
>> What returns the HTTP request to /data/plugins.json?
>> What version are you using?
>>
>> We should add log to tell which plugins are effectively loaded.
>>
>> Gerald
>>
>> Le mardi 16 décembre 2014 22:33:19 UTC+1, Jürgen Schmied a écrit :
>>>
>>> > the console servlet is not plugged on the same Simon manager instance.
>>> How can i check if there is more than one Simon manager instance?
>>>
>>> Thanks!
>>>
>>> juergen
>>>
>>>
> --
> You received this message because you are subscribed to the Google Groups
> "javasimon" group.
> To unsubscribe from this group and stop receiving emails from it, send an

Jürgen Schmied

unread,
Dec 17, 2014, 4:48:15 AM12/17/14
to java...@googlegroups.com
Version 3.5.2 (still use Java 6)
I debugged into SimonConsoleServlet.init(). The plugin classes are loaded by the frontend (I use embedded).

data/plugins.json gives [] back.

The Webapp doesn't try to load javasimon-timelinePlugin.js.

The ManagerFactoryBean.getObject() registers the callbacks too.

During Runtime the CompositeCallback calls both registered callbacks on all actions.

But I noticed: there are 2 instances of SimonConsolePluginManager. One instance gets the addPlugins() and the second instance is asked for the registed plugins ...

How can that be?

Jürgen Schmied

unread,
Dec 17, 2014, 5:03:53 AM12/17/14
to java...@googlegroups.com
Is there any possibility to fix the 3.x branch? We - and possibly other people are using still Java6 ...

Thanks!

Richard Richter

unread,
Dec 17, 2014, 5:07:54 AM12/17/14
to java...@googlegroups.com
Jurgen

I understand your pain, I have been using Java 6 quite recently as
well. But personally I don't support 3.x branch anymore. If you want,
you can fork it, do the necessary changes and create pull request. I'd
merge it and release 3.5.x bugfix release then, I can handle that
much. :-)

Cheers

Virgo

Gérald

unread,
Dec 17, 2014, 5:10:56 AM12/17/14
to java...@googlegroups.com
@Richard There's no 3.5.x tag/branch in GitHub

@Jurgen The console and the spring config  use the same Simon manager, else you wouldn't have any Simon data in the console. What you're saying is really strange, the plugin manager is a final attribute of SimonConsoleRequestProcessor.

Gérald

Richard Richter

unread,
Dec 17, 2014, 5:11:06 AM12/17/14
to java...@googlegroups.com

Richard Richter

unread,
Dec 17, 2014, 6:26:34 AM12/17/14
to java...@googlegroups.com
Hi Jurgen

Are you allowed to test SNAPSHOT too? I backported a couple more of
older fixes that are only in master and if you can give it a twist
before I release non-SNAPSHOT 3.5.3, it would be cool.

BTW: I dropped jdbc41 from version-3.5 branch, it doesn't make sense
for people stuck on Java 6 anyway.

Virgo

Richard Richter

unread,
Dec 17, 2014, 7:14:24 AM12/17/14
to java...@googlegroups.com
Hi

To let you know:
- Snapshot of 3.5.3 is up, e.g. console webapp here:
https://oss.sonatype.org/content/repositories/snapshots/org/javasimon/javasimon-console-webapp/3.5.3-SNAPSHOT/
(that is Maven Central snapshot repo)
- Release version of 4.0.1 is also available.

Virgo
Reply all
Reply to author
Forward
0 new messages