This discussion is archived
5 Replies Latest reply: Mar 2, 2010 12:10 AM by 843810 RSS

NoSuchMethodError? Works on a other computer??

843810 Newbie
Currently Being Moderated
Dear All,

I have a frustrating problem and maby you can help me.

When I deploy a jar (java -jar executable.jar) I get the error 'NoSuchMethodError'

If i deploy the same jar on an other computer it works fine.
I have this with multiple jars.

All classes are present within the jars.

Java version : 1.6.0_17 (but I had it with a previous versions!!!)

classpath = .;C:\Java\jdk1.6.0_07\lib\comm.jar;C:\aJile\Runtime_cldc;C:\Program Files\Java\jre6\lib\ext\

WindowsXP version 2002, service pack 3.

I hope you can help me.

With kind regards

Arnoud
  • 1. Re: NoSuchMethodError? Works on a other computer??
    800560 Newbie
    Currently Being Moderated
    citroenie wrote:
    Dear All,

    I have a frustrating problem and maby you can help me.

    When I deploy a jar (java -jar executable.jar) I get the error 'NoSuchMethodError'

    If i deploy the same jar on an other computer it works fine.
    I have this with multiple jars.

    All classes are present within the jars.

    Java version : 1.6.0_17 (but I had it with a previous versions!!!)

    classpath = .;C:\Java\jdk1.6.0_07\lib\comm.jar;C:\aJile\Runtime_cldc;C:\Program Files\Java\jre6\lib\ext\
    This classpath setting is irrevelent. When you use "java -jar ..." the system classpath is ignored. The only classpath used is the Class-Path entry in a jar manifest.

    If your jar works on one computer but not on others, there must be something different about those computers. If you copy and paste the full, exact error message, you may get some help. You should always copy and paste the error message when asking for help.
  • 2. Re: NoSuchMethodError? Works on a other computer??
    843810 Newbie
    Currently Being Moderated
    Thanks for your reply.

    I shoud indeed post the whole error :

    This is the console dump :


    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    H:\>c:

    C:\>java -jar sample1.jar
    Exception in thread "main" java.lang.NoSuchMethodError: com.ib.client.EClientSocket.<init>(Lcom/ib/client/EWrapper;)V
    at Main.<init>(Main.java:12)
    at Main.main(Main.java:45)

    C:\>


    But if I start the same Jar on an other computer, it wil work.
    The method which isn't found is included in the jar.

    Other Jars fail also. With the same error (NosuchMethodError) but with other Methods...

    Someone seens this problem before?

    With kind regards

    Arnoud
  • 3. Re: NoSuchMethodError? Works on a other computer??
    800560 Newbie
    Currently Being Moderated
    citroenie wrote:
    C:\>java -jar sample1.jar
    Exception in thread "main" java.lang.NoSuchMethodError: com.ib.client.EClientSocket.<init>(Lcom/ib/client/EWrapper;)V
    at Main.<init>(Main.java:12)
    at Main.main(Main.java:45)
    I haven't every seen anything like this but here's some ideas.

    What does sample1.jar have in its manifest for the Class-Path entry? Have you done "jar tf sample1.jar" and verified that com/ib/client/EClientSocket.class exists in the jar? Is it possible that the com/ib/client/EClientSocket.class file that is found is not the one you think?

    Have you tried extracting the classes from the jar on the target computer and running outside the jar?

    If you do "java -version" do you get an appropriate version?

    It is a curious problem.
  • 4. Re: NoSuchMethodError? Works on a other computer??
    843810 Newbie
    Currently Being Moderated
    Thanks for your reply.

    I don't think is the problem with the Jar, because it works on other computers, and I have the same problem with different jars which doesn't use any of the classes (libraries) used by this jar.

    When I star the jar from the source in Eclipse I get the exact same problem. (And so do other programs). So i'm really stuck and can't use java anymore..

    I think its a windows configuration problems of such kind. I really don't know.

    But here the info you requested. Maby It give you enough info to help me with my problem.


    //------------------

    C:\>jar tf sample1.jar
    META-INF/
    META-INF/MANIFEST.MF
    com/
    com/ib/
    com/ib/client/
    com/ib/client/Contract.class
    com/ib/client/ContractDetails.class
    com/ib/client/EClientErrors$CodeMsgPair.class
    com/ib/client/EClientErrors.class
    com/ib/client/EClientSocket.class
    com/ib/client/EReader.class
    com/ib/client/EWrapper.class
    com/ib/client/Execution.class
    com/ib/client/Order.class
    Main.class

    C:\>java -jar sample1.jar
    Exception in thread "main" java.lang.NoSuchMethodError: com.ib.client.EClientSocket.<init>(Lcom/ib/client/EWrapper;)V
    at Main.<init>(Main.java:12)
    at Main.main(Main.java:45)

    C:\>java -version
    java version "1.6.0_17"
    Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)

    C:\>

    C:\>

    Does someone have a idea? Please help...

    With kind regards

    Arnoud

    Edited by: citroenie on Mar 1, 2010 11:43 PM
  • 5. Re: NoSuchMethodError? Works on a other computer??
    843810 Newbie
    Currently Being Moderated
    PROBLEM SOLVED...

    Thanks for giving me some suggestions.

    When the problem occurred I updated java just to be sure that java itself wasn't the problem. But the problem stayed.

    I now completely removed all packages which where java related and all other JRE's (all previous updates) and a JDK.

    Just installed the latest release on my new "clean" computer and now it works...

    I really don't know what the problem was, but my computer can run Java programs again :-D


    With kind regards

    Arnoud