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.NoSuchMethodErro r: gov.nist.javax.sip.message .SIPMessag e.getConta ctHeader() Lgov/nist/ javax/sip/ header/Con tact;
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 ?
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.NoSuchMethodErro
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 ?
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 .SIPMessag e
error: Class names, 'gov.nist.javax.sip.messag e.SIPMessa ge', are only accepted if annotation processing is explicitly requested
1 error
[root@43-mng ~]#
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
error: Class names, 'gov.nist.javax.sip.messag
1 error
[root@43-mng ~]#
javap is the decompiler. Just run the command i gave
ASKER
this is what I have got
[root@43-mng bin]# ./javap gov.nist.javax.sip.message
ERROR:Could not find gov.nist.javax.sip.message
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
ASKER
[root@43-mng lib]# /usr/java/jdk1.6.0_02/bin/
ERROR:Could not find gov.nist.javax.sip.message
[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 .SIPMessag e
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
ASKER
/usr/java/jdk1.6.0_02/bin/ javap -classpath /usr/tmp/workspaces/uris/r unner/thir dparty/lib /jain-sip- 1.2.jar gov.nist.javax.sip.message .SIPMessag e
ASKER
[root@43-mng lib]#
[root@43-mng lib]# /usr/java/jdk1.6.0_02/bin/ javap -classpath /usr/tmp/workspaces/uris/r unner/thir dparty/lib /jain-sip- 1.2.jar gov.nist.javax.sip.message .SIPMessag e
ERROR:Could not find gov.nist.javax.sip.message .SIPMessag e
[root@43-mng lib]#
[root@43-mng lib]# /usr/java/jdk1.6.0_02/bin/
ERROR:Could not find gov.nist.javax.sip.message
[root@43-mng lib]#
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
[root@43-mng /]#
[root@43-mng /]# /usr/java/jdk1.6.0_02/bin/ jar -tf /usr/tmp/workspaces/uris/r er/thirdpa rty/lib/ja in-sip-1.2 .jar | grep SIPMessage
jain-sip/javadoc/gov/nist/ javax/sip/ message/SI PMessage.h tml
jain-sip/javadoc/gov/nist/ javax/sip/ message/cl ass-use/SI PMessage.h tml
jain-sip/javadoc/gov/nist/ javax/sip/ parser/SIP MessageLis tener.html
jain-sip/javadoc/gov/nist/ javax/sip/ parser/cla ss-use/SIP MessageLis tener.html
jain-sip/src/gov/nist/java x/sip/mess age/SIPMes sage.java
jain-sip/src/gov/nist/java x/sip/pars er/SIPMess ageListene r.java
[root@43-mng /]#
[root@43-mng /]# /usr/java/jdk1.6.0_02/bin/
jain-sip/javadoc/gov/nist/
jain-sip/javadoc/gov/nist/
jain-sip/javadoc/gov/nist/
jain-sip/javadoc/gov/nist/
jain-sip/src/gov/nist/java
jain-sip/src/gov/nist/java
[root@43-mng /]#
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
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
OK. Glad you're sorted out
javap gov.nist.javax.sip.message
on Linux and post the result