java - noSuchMethod exception

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 ?
aquaswAsked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
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
 
CEHJCommented:
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
 
aquaswAuthor Commented:
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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
CEHJCommented:
javap is the decompiler. Just run the command i gave
0
 
aquaswAuthor Commented:

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
 
CEHJCommented:
You need to put SIPMessage in the classpath for that to work
0
 
aquaswAuthor Commented:

[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
 
CEHJCommented:
>>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
 
aquaswAuthor Commented:
/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
 
aquaswAuthor Commented:
[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
 
aquaswAuthor Commented:
[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
 
aquaswAuthor Commented:
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
 
CEHJCommented:
:-)

OK. Glad you're sorted out
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.