开发者社区> 问答> 正文

eclipse运行nutch单元测试报错:org.apache.nutch.ne?报错

我是从https://svn.apache.org/repos/asf下载下来nutch。之后maven工程。什么配置也没改。直接运行TestURLFilters这个单元测试。报一下异常,希望高手指点一下。

java.lang.RuntimeException: org.apache.nutch.net.URLFilter not found.

at org.apache.nutch.net.URLFilters.<init>(URLFilters.java:52)
at org.apache.nutch.net.TestURLFilters.testNonExistingUrlFilter(TestURLFilters.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

展开
收起
爱吃鱼的程序员 2020-06-22 21:46:30 475 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    以上问题已解决。http://blog.csdn.net/wangzhaodong001/article/details/8597801

    但是又引起另一个问题。

    java.lang.RuntimeException:org.apache.nutch.plugin.PluginRuntimeException:java.lang.ClassNotFoundException:org.apache.nutch.net.RegexURLFilter
    atorg.apache.nutch.net.URLFilters.<init>(URLFilters.java:77)
    atorg.apache.nutch.net.TestURLFilters.testNonExistingUrlFilter(TestURLFilters.java:36)
    atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
    atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    atjava.lang.reflect.Method.invoke(Method.java:597)
    atjunit.framework.TestCase.runTest(TestCase.java:154)
    atjunit.framework.TestCase.runBare(TestCase.java:127)
    atjunit.framework.TestResult$1.protect(TestResult.java:106)
    atjunit.framework.TestResult.runProtected(TestResult.java:124)
    atjunit.framework.TestResult.run(TestResult.java:109)
    atjunit.framework.TestCase.run(TestCase.java:118)
    atorg.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
    atorg.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
    Causedby:org.apache.nutch.plugin.PluginRuntimeException:java.lang.ClassNotFoundException:org.apache.nutch.net.RegexURLFilter
    atorg.apache.nutch.plugin.Extension.getExtensionInstance(Extension.java:166)
    atorg.apache.nutch.net.URLFilters.<init>(URLFilters.java:57)
    ...17more
    Causedby:java.lang.ClassNotFoundException:org.apache.nutch.net.RegexURLFilter
    atjava.net.URLClassLoader$1.run(URLClassLoader.java:202)
    atjava.security.AccessController.doPrivileged(NativeMethod)
    atjava.net.URLClassLoader.findClass(URLClassLoader.java:190)
    atjava.lang.ClassLoader.loadClass(ClassLoader.java:307)
    atjava.lang.ClassLoader.loadClass(ClassLoader.java:248)
    atorg.apache.nutch.plugin.Extension.getExtensionInstance(Extension.java:156)
    ...18more



    2020-06-22 21:46:48
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Apache Flink技术进阶 立即下载
Apache Spark: Cloud and On-Prem 立即下载
Hybrid Cloud and Apache Spark 立即下载

相关镜像