简体   繁体   English

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

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

I am getting this error while importing the data using sqoop(master machine) from oracle db which is in different machine(ie, slave machine).使用sqoop(主机)从不同机器(即从机)中的oracle db导入数据时出现此错误。 I have replaced the commons.io.jar file also.我也替换了 commons.io.jar 文件。

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.xml 中指出您的 jar 必须覆盖 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/资料来源: https : //mycodingexperience.wordpress.com/2016/01/31/determine-run-time-jar-being-used/

This is nothing related to any particular library.这与任何特定的库无关。 This is a general exception in java这是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.只需在任何 zip 查看器中打开该 jar 文件并转到可以找到该类的特定位置,该位置将类似于org/apache/commons/io/FileUtils并使用某个类反编译器反编译该类并检查该方法是否即isSymLink(Ljava/io/File;)Z编译器所抱怨的在该类中可用。

It can also happen that the method is there but the method signature is different也可能发生方法存在但方法签名不同的情况

which version of commons.io.jar you are using?您使用的是哪个版本的commons.io.jar isSymlink(java.io.File) method was introduced since 2.0 version, so your commons.io.jar should have version greater than 2.0. isSymlink(java.io.File)方法是从 2.0 版本开始引入的,所以你的commons.io.jar应该有大于 2.0 的版本。

you need to change your mapred.site.xml file.您需要更改您的 mapred.site.xml 文件。 copy "mapred-site.xml.template" to mapred-site.xml将“mapred-site.xml.template”复制到mapred-site.xml

Follow below link and change mapred-site.xml and yarn.site.xml按照以下链接更改 mapred-site.xml 和 yarn.site.xml

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

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:对于那些使用最新版本的org.apache.poi (例如 4.1.1、4.1.2)并使用 Maven 仍然遇到此错误的人:在我的情况下,我的 POM.xml 有:

<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.一切都很顺利。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.copyInputStreamToFile(Ljava/io/InputStream;Ljava/io/File;) - java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.copyInputStreamToFile(Ljava/io/InputStream;Ljava/io/File;) java.lang.NoSuchMethodError:org.apache.commons.io.FileUtils.readFileToByteArray - java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.readFileToByteArray java.lang.NoSuchMethodError:org.apache.commons.lang.StringUtils.isBlank(Ljava / lang / String;)Z错误 - java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.isBlank(Ljava/lang/String;)Z Error java.lang.NoSuchMethodError:org.apache.poi.util.IOUtils.copy(Ljava / io / InputStream; Ljava / io / OutputStream;)V - java.lang.NoSuchMethodError: org.apache.poi.util.IOUtils.copy(Ljava/io/InputStream;Ljava/io/OutputStream;)V java.lang.NoSuchMethodError:org.apache.fop.apps.FopFactory.newInstance(Ljava / io / File;)Lorg / apache / fop / apps / FopFactory; - java.lang.NoSuchMethodError: org.apache.fop.apps.FopFactory.newInstance(Ljava/io/File;)Lorg/apache/fop/apps/FopFactory; 线程“主”中的异常java.lang.NoSuchMethodError:org.openqa.selenium.io.FileHandler.unzip(Ljava / io / InputStream;)Ljava / io / File; - Exception in thread “main” java.lang.NoSuchMethodError: org.openqa.selenium.io.FileHandler.unzip(Ljava/io/InputStream;)Ljava/io/File; java.lang.NoSuchMethodError:org.apache.poi.util.IOUtils.copy(Ljava / io / InputStream; Ljava / io / OutputStream;) - java.lang.NoSuchMethodError: org.apache.poi.util.IOUtils.copy(Ljava/io/InputStream;Ljava/io/OutputStream;) 异常java.lang.NoSuchMethodError:org.apache.wicket.AttributeModifier.append(Ljava / lang / String; Ljava / io / Serializable;) - Exception java.lang.NoSuchMethodError: org.apache.wicket.AttributeModifier.append(Ljava/lang/String;Ljava/io/Serializable;) java.lang.NoSuchMethodError:org.apache.poi.xssf.usermodel.XSSFWorkbook。 <init> (Ljava / IO / InputStream的;)V - java.lang.NoSuchMethodError: org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(Ljava/io/InputStream;)V java.lang.NoSuchMethodError:org.apache.commons.io.IOUtils.read with Tika(检测方法) - java.lang.NoSuchMethodError: org.apache.commons.io.IOUtils.read with Tika (detect method)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM