Coherence mbeans not visable

classic Classic list List threaded Threaded
10 messages Options
Mark Dollemore Mark Dollemore
Reply | Threaded
Open this post in threaded view
|

Coherence mbeans not visable

I am attempting to use Jolokia agent(WAR) with apache tomcat and Oracle Coherence. It was my understanding that the agent would attempt to discover all mbean servers and make all mbeans available.
However, I can only see native mbeans and no coherence mbeans when using the http://localhost:8080/jolokia/list/ command.

Is there something I am missing here?

any help much appreciated.

thanks

Mark
roland roland
Reply | Threaded
Open this post in threaded view
|

Re: Coherence mbeans not visable

Unfortunately there is no standard way for detecting all created MBeanServers. Therefore Jolokia has so called 'ServerDetectors' which detect the environment it is running and then uses custom lookup mechanisms for each server. See e.g. https://github.com/rhuss/jolokia/blob/master/agent/core/src/main/java/org/jolokia/detector/WeblogicDetector.java#L52-L68

So if Coherence uses a custom server a CoherenceDetector would need to be added which detects the Coherence specific detector.

Unfortunately I'm quite busy these days, but I'm open to pull request. Feel free to submit one on GitHub.

Sorry for now. (Maybe there is a way to configure Coherence which MBeanServer it should use ?)
... roland
Mark Dollemore Mark Dollemore
Reply | Threaded
Open this post in threaded view
|

Re: Coherence mbeans not visable

Hi Roland,

Thanks for getting back to me, the issue was resolved by installing the JVM agent on the Coherence java process rather than tomcat. All mbeans are now visible.

However, I am unable to wildcard on nodeId in the following type of query;-

 http://dlonapcohs01:7001/jolokia/read/Coherence:type=Platform,Domain=java.lang,subType=Memory,nodeId=4/HeapMemoryUsage/max

{
timestamp: 1460040924,
status: 200,
request: {
mbean: "Coherence:Domain=java.lang,nodeId=4,subType=Memory,type=Platform",
path: "max",
attribute: "HeapMemoryUsage",
type: "read"
},
value: 1908932608
}

The above works as expected and returns the HeapMemoryUsage/max attribute for nodeId 4. But if I try to retrieve this from all nodeId's, as below this fails.

http://dlonapcohs01:7001/jolokia/read/Coherence:type=Platform,Domain=java.lang,subType=Memory,nodeId=*/HeapMemoryUsage/max

{
timestamp: 1460042378,
status: 200,
request: {
mbean: "Coherence:Domain=java.lang,nodeId=*,subType=Memory,type=Platform",
path: "max",
attribute: "HeapMemoryUsage",
type: "read"
},
value: null
}

If I drop the /max attribute from the query, I get all attributes for all nodeId's returned.

What am I missing here, this is the last piece of the puzzle and its driving me mad...

Thanks

Mark
roland roland
Reply | Threaded
Open this post in threaded view
|

Re: Coherence mbeans not visable

Sorry, I have no coherence installation at hand. Can you post the result what you get without a 'max' path ? (i.e. the list ?)
... roland
roland roland
Reply | Threaded
Open this post in threaded view
|

Re: Coherence mbeans not visable

The point is, that you need to specify the path for the whole return value, not only the leaf object.

See https://github.com/rhuss/jolokia/issues/106#issuecomment-45207078 for more details.
... roland
Mark Dollemore Mark Dollemore
Reply | Threaded
Open this post in threaded view
|

Re: Coherence mbeans not visable

Hi Roland,

I have looked at the suggested post, but I dont believe it is relevant in that I am specifying my full path.

Below is the output with the max attribute dropped from the query;-

http://dlonapcohs01:7001/jolokia/read/Coherence:type=Platform,Domain=java.lang,subType=Memory,nodeId=*/HeapMemoryUsage/
{
timestamp: 1460043404,
status: 200,
request: {
mbean: "Coherence:Domain=java.lang,nodeId=*,subType=Memory,type=Platform",
attribute: "HeapMemoryUsage",
type: "read"
},
value: {
Coherence:Domain=java.lang,nodeId=4,subType=Memory,type=Platform: {
HeapMemoryUsage: {
max: 1908932608,
committed: 1908932608,
init: 2147483648,
used: 964838616
}
},
Coherence:Domain=java.lang,nodeId=15,subType=Memory,type=Platform: {
HeapMemoryUsage: {
max: 10627186688,
committed: 10627186688,
init: 10737418240,
used: 3747525568
}
},
Coherence:Domain=java.lang,nodeId=27,subType=Memory,type=Platform: {
HeapMemoryUsage: {
max: 10631643136,
committed: 10631643136,
init: 10737418240,
used: 2518096536
}
},
........
roland roland
Reply | Threaded
Open this post in threaded view
|

Re: Coherence mbeans not visable

No, you don't specify the full path with "max", the full path would e.g. "Coherence:Domain=java.lang,nodeId=4,subType=Memory,type=Platform/HeapMemoryUsage/max", i.e. everything starting from top of value. The path is always from top of the value object.

Hence you need a path with wildcards, too as described in this issue.

Please try

http://dlonapcohs01:7001/jolokia/read/Coherence:type=Platform,Domain=java.lang,subType=Memory,nodeId=*/HeapMemoryUsage/*/*/max
... roland
Mark Dollemore Mark Dollemore
Reply | Threaded
Open this post in threaded view
|

Re: Coherence mbeans not visable

Hi Roland,

Fantastic that works, not sure I would have ever worked that out without your help.

Your help is very much appreciated.

Thanks

Mark

Mark Dollemore Mark Dollemore
Reply | Threaded
Open this post in threaded view
|

Re: Coherence mbeans not visable

Sorry Roland one further question;

It doesn't appear to be possible to retireve multiple attributes using wildcards in this fashion , see below;-

Is there a way to achieve this?

http://dlonapcohs01:7001/jolokia/read/Coherence:type=Platform,Domain=java.lang,subType=Memory,nodeId=*/HeapMemoryUsage/*/*/max,used

{
timestamp: 1460044589,
status: 200,
request: {
mbean: "Coherence:Domain=java.lang,nodeId=*,subType=Memory,type=Platform",
path: "*/*/max,used",
attribute: "HeapMemoryUsage",
type: "read"
},
value: null
}
roland roland
Reply | Threaded
Open this post in threaded view
|

Re: Coherence mbeans not visable

Sorry, applying multiple paths is not possible. You could use multiple attributes like "HeapMemoryUsage,NonHeapMemoryUsage" instead of "MemoryUsage", but only a single path.

However, if your are able to switch to POST requests (instead of GET), you could do a bulk request with two Jolokia request objects, each with a different path. Look for "Bulk requests" in the reference manual if this is an option for you.
... roland