Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Exception java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.moveFile(Ljava/io/File;Ljava/io/File;)

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Exception java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.moveFile(Ljava/io/File;Ljava/io/File;)

    Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.moveFile(Ljava/io/File;Ljava/io/File


    a program of mine is making a call to this method . It was working fine till before few days. and now it is throwing this exception.
    Since the exception is from an apache FileUtils class,it cant be any problem with my program also. So what could be the possible cause for this?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Exception java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.moveFile(Ljava/io/File;Ljava/io/File;)

    Could the program be executed with a different definition of the class than it was compiled with?
    The one used for compilation had the method, the one for execution did not.

    Read the API doc for the error message.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Exception java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.moveFile(Ljava/io/File;Ljava/io/File;)

    Quote Originally Posted by Norm View Post
    Could the program be executed with a different definition of the class than it was compiled with?
    The one used for compilation had the method, the one for execution did not.

    Read the API doc for the error message.





    But my doubt is, the code I am executing is that of a standard tool which is installed in the cluster since a long time.
    How can execution with a different definition of the class happen after compiling?

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Exception java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.moveFile(Ljava/io/File;Ljava/io/File;)

    How can execution with a different definition of the class happen after compiling?
    The code was compiled with jarFileA and executed with jarFileB which has a different definition for the class.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Exception java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.moveFile(Ljava/io/File;Ljava/io/File;)

    ok ,got it Norm. Thank you. I will get back in case I get any doubts further.

  6. #6
    Junior Member
    Join Date
    Jan 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Exception java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.moveFile(Ljava/io/File;Ljava/io/File;)

    I have seen a similar issue with sqoop... but i dont know if that could help you

Similar Threads

  1. need help with 'org.apache.commons.net.ftp.FTPClient'
    By rtumatt in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: May 22nd, 2013, 07:02 PM
  2. Uploading File to server ( Apache.commons.net)
    By quirell in forum Java Networking
    Replies: 5
    Last Post: November 11th, 2012, 11:06 PM
  3. problem while sending email using org.apache.commons.mail.*
    By gurleen in forum Java Theory & Questions
    Replies: 2
    Last Post: September 10th, 2012, 11:21 AM
  4. Replies: 3
    Last Post: March 7th, 2012, 05:54 AM
  5. OSGI - missing imported package=org.apache.commons.collections
    By rcbandit in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 17th, 2012, 11:36 AM

Tags for this Thread