• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Problem with calling constructor from JNI code

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have no error when I am trying to call any method of the "Ursa_Routing_Output" object from the JNI code. But I am getting this error when calling the constructor.

Problem with the Empty constructor
Exception in thread "Thread-23" java.lang.NoSuchMethodError: <init>
at com.comail.jni.UVSdk.getRPO(Native Method)



The corresponding methods in the Java class are :





The corresponding class signatures generated through javap are :

public com.comail.pojo.Ursa_Routing_Output();
Signature: ()V

public java.lang.String getAreaCommitment();
Signature: ()Ljava/lang/String;


The code is able to find the class and its other methods. But it is not able to locate the constructor.

Can any one help me to locate the problem?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Type signatures are case-sensitive: ()v -> ()V .
 
Sri Harsha Yenuganti
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ernest Friedman-Hill wrote:Type signatures are case-sensitive: ()v -> ()V .




ThankYou Friedman.. It worked !!

I do have another issue in the same class for the parameterized constructor ... As that is similar I will post it here only ..


Signature generated from javap :
(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;IIJILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIILjava/lang/String;Ljava/lang/String;)V


I have just copy pasted the signature into this GetMethodID function :





But I am getting the error :

Problem with the constructor
Exception in thread "Thread-23" java.lang.NoSuchMethodError: <init>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic