Link to home
Start Free TrialLog in
Avatar of aquasw
aquasw

asked on

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 ?
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of aquasw
aquasw

ASKER

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 ~]#
javap is the decompiler. Just run the command i gave
Avatar of aquasw

ASKER


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.
You need to put SIPMessage in the classpath for that to work
Avatar of aquasw

ASKER


[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

>>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
Avatar of aquasw

ASKER

/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
Avatar of aquasw

ASKER

[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]#
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aquasw

ASKER

[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 /]#
Avatar of aquasw

ASKER

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
:-)

OK. Glad you're sorted out