Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.io.IOUtils.toString(Ljava
程序员文章站
2022-05-05 14:48:42
...
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.io.IOUtils.toString(Ljava/io/InputStream;Ljava/nio/charset/Charset;)Ljava/lang/String;
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/io/Charsets
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.15</version>
</dependency>
使用WebClient报错!!
最后方案:
增加依赖
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<!--jsoup解析html页面-->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.3</version>
</dependency>
<!--高级http解析工具-->
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.19</version>
</dependency>
成功!!!!!!!!!
推荐阅读
-
activeMQBroker 编译错误Exception in thread “main“ java.lang.NoClassDefFoundError: com/fasterxml/jackson/
-
Exception in thread main java.lang.NoClassDefFoundError错误解决方法
-
Exception in thread main java.lang.NoClassDefFoundError错误解决方法
-
Exception in thread "main" java.lang.IllegalArgumentException: Illegal character in query at index x
-
jython报错,亲测有效Exception in thread “main“ ImportError: Cannot import site module and its dependencies:
-
Oracle dbca报Exception in thread main
-
java编译过程中出现了Exception in thread “main" java.lang.UnsupportedClassVersionError
-
storm报错:Exception in thread "main" java.lang.RuntimeException: InvalidTopologyException(msg:Component: [mybolt] subscribes from non-existent
-
JDBC:Exception in thread “main“ java.sql.SQLException: The server time zone value ‘�й���ʱ�报错
-
归并排序栈溢出异常Exception in thread "main" java.lang.*Error