Hi, I probably should have replied to myself a while back, but I managed to figure this out.
Although I had installed JRE 7 and JDK 7, I had only switched my system defaults to use JRE 7, my JAVA_HOME was still pointing at version 6. After I used 'alternatives' to switch to JDK7, everything worked correctly. I think that the actual error message indicating the problem was lost in stderr because I was running collectd using an initscript. Thanks, Dan Scott On 31 October 2013 13:56, Franklin, Dave <dave.frank...@arrisi.com> wrote: > 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-boun...@verplant.org [mailto: > collectd-boun...@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**** >
_______________________________________________ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd