[prev in list] [next in list] [prev in thread] [next in thread] 

List:       collectd
Subject:    Re: [collectd] Java plugin - Cannot find the API class	"org.collectd.api.Collectd"
From:       "Franklin, Dave" <Dave.Franklin () arrisi ! com>
Date:       2013-10-31 13:56:25
Message-ID: 986EDD78DEC0BF41BE0A92446CEEBD5146C9EA19 () ATLEXMBX4 ! ARRS ! ARRISI ! com
[Download RAW message or body]

[Attachment #2 (text/plain)]

A few things I can think of off the top of my head:

It would be interesting to see what the log output is with DEBUG cranked up - it \
should show all the JVM args passed in before the JVM is created. Also I see you're \
logged in as root - is collectd running with sufficient permissions? Can you confirm \
the class is actually in the jar file: jar tf \
/usr/share/collectd/java/collectd-api.jar

=D

Dave Franklin
Principal Software Engineer
Arris Group, Inc. - T1-9
900 Chelmsford Street
Lowell, MA 01851




From: collectd-bounces@verplant.org [mailto:collectd-bounces@verplant.org] On Behalf \
                Of Dan Scott
Sent: Wednesday, September 18, 2013 9:37 AM
To: collectd@verplant.org
Subject: [collectd] Java plugin - Cannot find the API class \
"org.collectd.api.Collectd"

Hi,

I'm running collectd 5.04 on AWS:

collectd-5.0.4-1.19.amzn1.x86_64
collectd-java-5.0.4-1.19.amzn1.x86_64

I'm trying to get the java plugin working to monitor tomcat. I have a config file as \
follows:

LoadPlugin java

<Plugin "java">
        JVMARG "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"


        LoadPlugin "org.collectd.java.GenericJMX"
        <Plugin "GenericJMX">
# Heap memory usage
<MBean "memory-heap">
  ObjectName "java.lang:type=Memory"
  InstancePrefix "memory-heap"
  <Value>
    Type "jmx_memory"
    Table true
    Attribute "HeapMemoryUsage"
  </Value>
</MBean>

    <Connection>
      Host "localhost"
      ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:17264/jmxrmi"
      Collect "memory_pool"
    </Connection>
    </Plugin>
</Plugin>

The log file says: Cannot find the API class "org.collectd.api.Collectd". Please set \
the correct class path using 'JVMArg "-Djava.class.path=..."'

But as you can see, I already have this line added. The jar files exist and contain \
the correct classes:

[root@localhost ~]# rpm -ql collectd-java
/etc/collectd.d/java.conf
/usr/lib64/collectd/java.so
/usr/share/collectd/java/collectd-api.jar
/usr/share/collectd/java/generic-jmx.jar

Can anyone help?

Thanks,

Dan Scott


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">A \
few things I can think of off the top of my head:<o:p></o:p></span></p> <p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">It \
would be interesting to see what the log output is with DEBUG cranked up - it should \
show all the JVM args passed in before the JVM is created. <o:p></o:p></span></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Also \
I see you're logged in as root - is collectd running with sufficient permissions? \
<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Can \
you confirm the class is actually in the jar file: jar tf \
/usr/share/collectd/java/collectd-api.jar <o:p></o:p></span></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">=D<o:p></o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Dave \
Franklin<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Principal \
Software Engineer<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Arris \
Group, Inc. - T1-9<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">900 \
Chelmsford Street<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Lowell, \
MA 01851<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> \
collectd-bounces@verplant.org [mailto:collectd-bounces@verplant.org] <b>On Behalf Of \
</b>Dan Scott<br> <b>Sent:</b> Wednesday, September 18, 2013 9:37 AM<br>
<b>To:</b> collectd@verplant.org<br>
<b>Subject:</b> [collectd] Java plugin - Cannot find the API class \
&quot;org.collectd.api.Collectd&quot;<o:p></o:p></span></p> <p \
class="MsoNormal"><o:p>&nbsp;</o:p></p> <div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I'm running collectd 5.04 on AWS:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">collectd-5.0.4-1.19.amzn1.x86_64<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">collectd-java-5.0.4-1.19.amzn1.x86_64<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I'm trying to get the java plugin working to monitor tomcat. I \
have a config file as follows:<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">LoadPlugin java<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">&lt;Plugin &quot;java&quot;&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &nbsp; JVMARG \
&quot;-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar&quot;<o:p></o:p></p>
 </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &nbsp; LoadPlugin \
&quot;org.collectd.java.GenericJMX&quot;<o:p></o:p></p> </div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; &nbsp; &lt;Plugin \
&quot;GenericJMX&quot;&gt;<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"># Heap memory usage<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&lt;MBean &quot;memory-heap&quot;&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; ObjectName \
&quot;java.lang:type=Memory&quot;<o:p></o:p></p> </div>
<div>
<p class="MsoNormal">&nbsp; InstancePrefix &quot;memory-heap&quot;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &lt;Value&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; Type &quot;jmx_memory&quot;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; Table true<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; Attribute \
&quot;HeapMemoryUsage&quot;<o:p></o:p></p> </div>
<div>
<p class="MsoNormal">&nbsp; &lt;/Value&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&lt;/MBean&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;Connection&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; Host &quot;localhost&quot;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; ServiceURL \
&quot;service:jmx:rmi:///jndi/rmi://localhost:17264/jmxrmi&quot;<o:p></o:p></p> \
</div> <div>
<p class="MsoNormal">&nbsp; &nbsp; &nbsp; Collect \
&quot;memory_pool&quot;<o:p></o:p></p> </div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;/Connection&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp; &nbsp; &lt;/Plugin&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">&lt;/Plugin&gt;<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">The log file says:&nbsp;Cannot find the API class \
&quot;org.collectd.api.Collectd&quot;. Please set the correct class path using \
'JVMArg &quot;-Djava.class.path=...&quot;'<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">But as you can see, I already have this line added. The jar \
files exist and contain the correct classes:<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">[root@localhost ~]# rpm -ql collectd-java<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">/etc/collectd.d/java.conf<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">/usr/lib64/collectd/java.so<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">/usr/share/collectd/java/collectd-api.jar<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">/usr/share/collectd/java/generic-jmx.jar<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Can anyone help?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Dan Scott<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>



_______________________________________________
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd

--===============2065048523==--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic