java - noSuchMethod exception

Posted on 2007-08-06
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 ?
Question by:aquasw
    LVL 14

    Accepted Solution

    That error usually happens when the library you were using when you compiled your code is a different version than the library that you use when you run your code. Check to make sure that the JAR containing the gov.nist.javax.sip.message.SIPMessage class is the same version on both machines. If they aren't, and you can't make them the same, you'll have to try to find a different method to call that'll have the same effect, if you can.
    LVL 26

    Assisted Solution

    try copying the jar file from windows to the linux.  Also make sure the CLASSPATH var in Linux has this jar preceding other jar files!
    LVL 26

    Expert Comment

    basically the problem could be incorrect version of the library in CLASSPATH as said by CPColin!
    LVL 2

    Expert Comment

    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now