hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kirk True <k...@mustardgrain.com>
Subject Re: CLASSPATH errors running unit tests via Eclipse
Date Tue, 07 Jun 2011 04:38:03 GMT
Yep, that was it (the extra CLASSPATH folders in the run configuration 
templates). Thanks!

On 6/6/11 9:26 AM, Harsh J wrote:
> Kirk,
>
> IIRC, the "ant eclipse" target also bundles in some pre-configured Run
> Configurations into your Eclipse (You can see them in the
> Run-Configurations drop down as "SpecificTestTemplate" or so). Using
> that template should get rid of a lot of issues.
>
> (Btw, running specific tests from ant is possible too, via
> -Dtestcase=Name/Pattern)
>
> On Mon, Jun 6, 2011 at 9:31 PM, 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
>>
>
>

Mime
View raw message