[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

java - noSuchMethod exception

Posted on 2007-08-06
13
Medium Priority
?
337 Views
Last Modified: 2013-12-29
Hi Experts

I get very strange noSuchMethod exception.
I am using jainSip. the code works fine on my windows machine.
when I ran it on my linux machine, I'm getting this exception
java.lang.NoSuchMethodError: gov.nist.javax.sip.message.SIPMessage.getContactHeader()Lgov/nist/javax/sip/header/Contact;

it is important to mention that another methods on the same class are working in linux and windows (I checked that getMethod method are working).
but this specific method - noSuchMethod , is not working...
does any one know why ?
0
Comment
Question by:aquasw
  • 7
  • 6
13 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 19639099
Are you sure you're running the same binaries on each platform? Run

javap gov.nist.javax.sip.message.SIPMessage

on Linux and post the result
0
 

Author Comment

by:aquasw
ID: 19639133
Yes
I am sure, it is the same binaries
I copied it with ftp

what is javap ???

I tried to use javac

[root@43-mng ~]# javac gov.nist.javax.sip.message.SIPMessage
error: Class names, 'gov.nist.javax.sip.message.SIPMessage', are only accepted if annotation processing is explicitly requested
1 error
[root@43-mng ~]#
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 19639152
javap is the decompiler. Just run the command i gave
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:aquasw
ID: 19639225

this is what I have got

[root@43-mng bin]# ./javap gov.nist.javax.sip.message.SIPMessage
ERROR:Could not find gov.nist.javax.sip.message.SIPMessage

but... in my case, I handle in the classes in different way.
my class path is created after I run the program.
it's framework that ran another class.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 19639235
You need to put SIPMessage in the classpath for that to work
0
 

Author Comment

by:aquasw
ID: 19639280

[root@43-mng lib]# /usr/java/jdk1.6.0_02/bin/javap gov.nist.javax.sip.message.SIPMessage
ERROR:Could not find gov.nist.javax.sip.message.SIPMessage
[root@43-mng lib]#

I want to mention that the classpath issue in my pogram is handled while running the program
it's framework that execute framework

when I typed javap, there was no any classpath variable environment

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 19639321
>>I want to mention that the classpath issue in my pogram is handled while running the program
it's framework that execute framework

Yes, you said. You need to put the jar that class is in into the classpath

javap -classpath some-sip-jar.jar gov.nist.javax.sip.message.SIPMessage
0
 

Author Comment

by:aquasw
ID: 19639407
/usr/java/jdk1.6.0_02/bin/javap -classpath /usr/tmp/workspaces/uris/runner/thirdparty/lib/jain-sip-1.2.jar gov.nist.javax.sip.message.SIPMessage
0
 

Author Comment

by:aquasw
ID: 19639409
[root@43-mng lib]#
[root@43-mng lib]# /usr/java/jdk1.6.0_02/bin/javap -classpath /usr/tmp/workspaces/uris/runner/thirdparty/lib/jain-sip-1.2.jar gov.nist.javax.sip.message.SIPMessage
ERROR:Could not find gov.nist.javax.sip.message.SIPMessage
[root@43-mng lib]#
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 1500 total points
ID: 19639459
OK. Can you do

[root@43-mng lib]# /usr/java/jdk1.6.0_02/bin/jar tf /usr/tmp/workspaces/uris/runner/thirdparty/lib/jain-sip-1.2.jar
| grep SIPMessage
0
 

Author Comment

by:aquasw
ID: 19639488
[root@43-mng /]#
[root@43-mng /]# /usr/java/jdk1.6.0_02/bin/jar -tf /usr/tmp/workspaces/uris/rer/thirdparty/lib/jain-sip-1.2.jar  | grep SIPMessage
jain-sip/javadoc/gov/nist/javax/sip/message/SIPMessage.html
jain-sip/javadoc/gov/nist/javax/sip/message/class-use/SIPMessage.html
jain-sip/javadoc/gov/nist/javax/sip/parser/SIPMessageListener.html
jain-sip/javadoc/gov/nist/javax/sip/parser/class-use/SIPMessageListener.html
jain-sip/src/gov/nist/javax/sip/message/SIPMessage.java
jain-sip/src/gov/nist/javax/sip/parser/SIPMessageListener.java
[root@43-mng /]#
0
 

Author Comment

by:aquasw
ID: 19639538
CEHJ

thank for your help

we solved the problem
we missed this jar file
concurrent.jar

and we also take the latest jain sip jar file

Thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 19639557
:-)

OK. Glad you're sorted out
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month18 days, 22 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question