• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with calling constructor from JNI code

 
Sri Harsha Yenuganti
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • 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?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Type signatures are case-sensitive: ()v -> ()V .
 
Sri Harsha Yenuganti
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • 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>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic