Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0-beta1
-
None
-
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
Description
I have an app that uses HtmlUnit which depends on Log4J 1.2.
When I run it, I get:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.log4j.Category.log(Ljava/lang/String;Lorg/apache/log4j/Priority;Ljava/lang/Object;Ljava/lang/Throwable;)V at org.apache.commons.logging.impl.Log4JLogger.debug(Log4JLogger.java:177) at com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration.parseClassElement(JavaScriptConfiguration.java:394) at com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration.buildUsageMap(JavaScriptConfiguration.java:312) at com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration.<init>(JavaScriptConfiguration.java:147) at com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration.getInstance(JavaScriptConfiguration.java:237) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.<init>(JavaScriptEngine.java:116) at com.gargoylesoftware.htmlunit.WebClient.init(WebClient.java:219) at com.gargoylesoftware.htmlunit.WebClient.<init>(WebClient.java:193) at com.gargoylesoftware.htmlunit.WebClient.<init>(WebClient.java:184) at com.c2g2.collect.BizJournalsPageCollector.<init>(BizJournalsPageCollector.java:50) at com.c2g2.site.SitesDb.newBizJournalsSiteDb(SitesDb.java:95) at com.c2g2.site.SitesDb.getSiteDbList(SitesDb.java:39) at com.c2g2.site.SitesDbCollector.run(SitesDbCollector.java:32) at com.c2g2.site.SitesDbCollector.main(SitesDbCollector.java:24)
My CP in Eclipse:
<?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src/main/java"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Oracle JRE 7 +NiN"/> <classpathentry kind="lib" path="lib/jetty-all-8.1.7.v20120910.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/commons-codec-1.6.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/commons-collections-3.2.1.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/commons-io-2.2.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/commons-lang3-3.1.jar" sourcepath="src/lib/commons-lang3-3.1-sources.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/commons-logging-1.1.1.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/cssparser-0.9.7.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/htmlunit-2.10.jar" sourcepath="src/lib/htmlunit-2.10-src.zip"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/htmlunit-core-js-2.10.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/httpclient-4.2.1.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/httpcore-4.2.1.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/httpmime-4.2.1.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/nekohtml-1.9.16.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/sac-1.3.jar"/> <classpathentry kind="lib" path="lib/htmlunit-2.10/lib/serializer-2.7.1.jar"/> <classpathentry kind="lib" path="lib/commons-vfs2-2.0.jar" sourcepath="src/lib/commons-vfs2-2.0-sources.jar"/> <classpathentry kind="lib" path="lib/joda-time-2.1.jar" sourcepath="src/lib/joda-time-2.1-sources.jar"/> <classpathentry kind="lib" path="lib/commons-csv-1.0-SNAPSHOT.jar" sourcepath="/commons-csv/src"/> <classpathentry kind="lib" path="lib/commons-email-1.2.jar" sourcepath="src/lib/commons-email-1.2-sources.jar"/> <classpathentry kind="lib" path="lib/mail-1.4.5.jar"/> <classpathentry kind="lib" path="lib/log4j-api-2.0-beta1.jar" sourcepath="src/lib/log4j-api-2.0-beta1-sources.jar"/> <classpathentry kind="lib" path="lib/log4j-core-2.0-beta1.jar" sourcepath="src/lib/log4j-core-2.0-beta1-sources.jar"/> <classpathentry kind="lib" path="lib/log4j12-api-2.0-beta1.jar"/> <classpathentry kind="output" path="bin"/> </classpath>