Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoSuchMethodError : org.apache.commons.io.FileUtils.isSymLink(Ljava/io/File;)Z

Tags:

java

hadoop

sqoop

I am getting this error while importing the data using sqoop(master machine) from oracle db which is in different machine(i.e., slave machine). I have replaced the commons.io.jar file also.

like image 765
Bhargavi Enuturla Avatar asked Oct 16 '25 17:10

Bhargavi Enuturla


2 Answers

This is nothing related to any particular library. This is a general exception in java

The problem is quite simple. The method was available at Compile time but not at run time.

One of the reasons can be that you are using the wrong version of the commons library. Just open that jar file in any zip viewer and go to that particular location where that class can be found, the location will be something like org/apache/commons/io/FileUtils and decompile that class using some class decompiler and check whether that method which the ie isSymLink(Ljava/io/File;)Z compiler is complaining is available in that class.

It can also happen that the method is there but the method signature is different

like image 118
FatherMathew Avatar answered Oct 18 '25 05:10

FatherMathew


Maybe I'm late, but just faced the same issue and could solve it. The solution for me is to indicate in the weblogic.xml that your jar must override the same existing in weblogic:

<weblogic-web-app ...>
<container-descriptor>
    <prefer-application-packages>
        <package-name>org.apache.commons*</package-name>
    </prefer-application-packages>
</container-descriptor>

Regards, Jose.

Source: https://mycodingexperience.wordpress.com/2016/01/31/determine-run-time-jar-being-used/

like image 33
JoseAróstegui Avatar answered Oct 18 '25 06:10

JoseAróstegui