hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd Lipcon <t...@cloudera.com>
Subject Re: CLASSPATH errors running unit tests via Eclipse
Date Mon, 06 Jun 2011 16:52:05 GMT
Hi Kirk,

Take a look at https://issues.apache.org/jira/browse/HDFS-1980 -- it might
help you. Hopefully I can get someone to review it and commit it this week?
*hint hint committers*

Thanks
-Todd

On Mon, Jun 6, 2011 at 9:01 AM, Kirk True <kirk@mustardgrain.com> wrote:

> Hi all,
>
> I'm trying to run some of the unit tests within Eclipse. But with a fresh
> checkout of the HDFS source, unit tests that use webapps generate errors in
> Eclipse.
>
> Steps to reproduce:
>
>  1. Get source
>        1. cd /tmp
>        2. mkdir test
>        3. cd test
>        4. git clone https://github.com/apache/hadoop-hdfs.git
>        5. cd hadoop-hdfs
>  2. Set up Eclipse project
>        1. Run `ant eclipse`
>        2. Run Eclipse with /tmp/test as the workspace
>        3. File -> Import...
>        4. Import "General" -> "Existing Projects into Workspace",
>           click "Next"
>        5. Select root directory "/tmp/test", select "hadoop-hdfs" and
>           click "Finish"
>  3. Navigate to "TestBlockRecovery" test source and select "Run As..."
>     "JUnit Test"
>
>
> I expected it to pass, but instead I get this error:
>
>   java.io.FileNotFoundException: webapps/datanode not found in CLASSPATH
>        at
>   org.apache.hadoop.http.HttpServer.getWebAppsPath(HttpServer.java:470)
>        at org.apache.hadoop.http.HttpServer.<init>(HttpServer.java:186)
>        at org.apache.hadoop.http.HttpServer.<init>(HttpServer.java:147)
>        at
>
> org.apache.hadoop.hdfs.server.datanode.DataNode.startInfoServer(DataNode.java:465)
>        at
>
> org.apache.hadoop.hdfs.server.datanode.DataNode.startDataNode(DataNode.java:1373)
>        at
>   org.apache.hadoop.hdfs.server.datanode.DataNode.<init>(DataNode.java:401)
>        at
>
> org.apache.hadoop.hdfs.server.datanode.TestBlockRecovery.startUp(TestBlockRecovery.java:114)
>        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
>
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>        at
>
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>        at
>
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>        at
>
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>        at
>
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>        at
>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>        at
>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>        at
>   org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>        at
>
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
>        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)
>
>
> I'm assuming that it's an issue with the Eclipse project generation, but I
> haven't been able to solve it by manually hacking the .classpath Eclipse
> file.
>
> Any ideas?
>
> Thanks,
> Kirk
>



-- 
Todd Lipcon
Software Engineer, Cloudera

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message