title: JNI call to Java function returning an Object results in NoSuchMethodError
body: <p>I have a Java function which returns a singleton instance of a Class</p>
  
  <pre><code>public static synchronized MyClass getInstance() throws MyClassException{
      if (instance == NULL){
          // create
      } 
      return instance;
  }
  </code></pre>
  
  <p>I want to call this through C++ code, but when I do, it returns a NoSuchMethodError.</p>
  
  <pre><code>cls = jenv-&gt;FindClass("MyClass");
  if (cls == NULL)
  {
  //error handling
  }
  mid = jenv-&gt;GetStaticMethodID(cls, "getInstance", "()LMyClass");
  if (mid == NULL)
  {
  //error handling
  }
  </code></pre>
  
  <p>When I run:</p>
  
  <pre><code>javap -s -p on MyClass, I get the signature:
  public static synchronized MyClass getInstance()   throws MyClassException;
  Signature: ()LMyClass; 
  </code></pre>
  
  <p>If I change the function signature to void in the Java class, the GetStaticMethodID call works as expected.</p>
  
  <p>Do I need to setup a jobject to expect the return value from the call? </p>
  
  <p>Is this possible without calling GetStaticMethodID first?</p>