Hi Jeff,

Thank you for the reply. Your analysis led me to looking at the jar file's source
code and eventually I found a problem that I'm not sure even is a problem:
the underlying queryAvailablePerfMetric takes an int, instead of Integer.
This is not a problem when I call it from Java code - it's taken care of by
auto-boxing. However somehow it was a problem when I call it from Jython.
It seems like Jython is looking for a method with Integer signature and it
doesn't find it. However, I'm curious why Jython is even in the picture because
in this particular case, it's Java code calling Java code. But anyway, as soon
as I replaced int with Integer in the underlying call and re-complied the jar,
everything worked.


On Tue, Jun 19, 2012 at 8:22 PM, Jeff Emanuel <jemanuel@frii.com> wrote:

You don't include the stack trace, so I'm guessing that
PerformanceManager.queryAvailablePerfMetric calls VimPortType.queryAvailablePerfMetric
and the implementation of
VimPortType doesn't match what
was used when compiling PerformanceManager.

On 6/19/2012 7:13 PM, jlist9 wrote:

I'm getting a strange error. There is a method in a Java class (in a jar file) that has this signature:

public PerfMetricId[] queryAvailablePerfMetric(ManagedEntity entity, Calendar beginTime, Calendar endTime, Integer intervalId)

However, when I call it with perfMgr.queryAvailablePerfMetric(entity, None, None, 0)

I get this error at run time:

NoSuchMethodError: java.lang.NoSuchMethodError: com.vmware.vim25.VimPortType.queryAvailablePerfMetric(Lcom/vmware/vim25/ManagedObjectReference;Lcom/vmware/vim25/ManagedObjectReference;Ljava/util/Calendar;Ljava/util/Calendar;I)[Lcom/vmware/vim25/PerfMetricId;

I'm curious about two things:
1. entity should be of ManagedEntity type, and the instance I pass into the method is an instance of ManagedEntity. However, the error message shows ManagedObjectReference, which is different.
2. I see a repetition of Lcom/vmware/vim25/ManagedObjectReference in the error message. If it means the method expects two arguments of that type, it would be incorrect.

I can call some other methods of the same object OK. It is a valid object. Could this be a Jython bug?