4

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.

5 Answers5

3

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

FatherMathew
  • 960
  • 12
  • 15
3

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/

2

For those who's still getting this error using most recent versions of org.apache.poi (ex, 4.1.1, 4.1.2) and have Maven: In my case my POM.xml had:

<dependency>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-io</artifactId>
  <version>1.3.2</version>
</dependency>

I overrided with

<dependency>
  <groupId>commons-io</groupId>
  <artifactId>commons-io</artifactId>
  <version>2.7</version>
</dependency>

And everything gone well.

Mauricio Zárate
  • 440
  • 1
  • 4
  • 8
1

which version of commons.io.jar you are using? isSymlink(java.io.File) method was introduced since 2.0 version, so your commons.io.jar should have version greater than 2.0.

Garry
  • 4,493
  • 3
  • 28
  • 48
  • Actually I have two files commons-io.jar and commons-io-2.4.jar. both are linked. commons-io.jar --> commons-io-2.4.jar. In both the jar files i can see the FileUtils.class – Bhargavi Enuturla Jul 03 '15 at 04:52
  • @bhargaviEnuturla.... I suggest you to keep one, since adding same jar multiple times to your classpath may also cause issues. Keep the latest one and try again. – Garry Jul 03 '15 at 05:35
  • I have deleted the commons-io.jar but still i am getting the same error. Thank you – Bhargavi Enuturla Jul 03 '15 at 07:14
1

you need to change your mapred.site.xml file. copy "mapred-site.xml.template" to mapred-site.xml

Follow below link and change mapred-site.xml and yarn.site.xml

https://www.tutorialspoint.com/sqoop/sqoop_installation.htm

Arun Sharma
  • 443
  • 4
  • 6