Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 823B3E390 for ; Tue, 12 Feb 2013 16:01:15 +0000 (UTC) Received: (qmail 77663 invoked by uid 500); 12 Feb 2013 16:01:10 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 77408 invoked by uid 500); 12 Feb 2013 16:01:09 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 77400 invoked by uid 99); 12 Feb 2013 16:01:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 16:01:09 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ch.schneider@gmx-topmail.de designates 212.227.15.19 as permitted sender) Received: from [212.227.15.19] (HELO mout.gmx.net) (212.227.15.19) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 16:01:03 +0000 Received: from mailout-de.gmx.net ([10.1.76.33]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0LcmGP-1UoDD33ag3-00kBlv for ; Tue, 12 Feb 2013 17:00:42 +0100 Received: (qmail 21773 invoked by uid 0); 12 Feb 2013 16:00:42 -0000 Received: from 91.89.54.189 by www037.gmx.net with HTTP; Tue, 12 Feb 2013 17:00:42 +0100 (CET) Content-Type: text/plain; charset="utf-8" Date: Tue, 12 Feb 2013 17:00:42 +0100 From: "Christian Schneider" In-Reply-To: Message-ID: <20130212160042.27240@gmx.net> MIME-Version: 1.0 References: <20130212125100.68600@gmx.net> <511A43E8.2080702@gmail.com> Subject: Re: NullPointerException in Spring Data Hadoop with CDH4 To: user@hadoop.apache.org X-Authenticated: #7857841 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1/zTYkCkfDzwXCE/ac8QRP1PPn5GXFEmwVejCUfVv 8Kzy+vPsC2FCmTqtkm30vIIEIakdVYbiz6wQ== Content-Transfer-Encoding: 8bit X-GMX-UID: fQJoccBreSEqaNCFHHQh8R1+IGRvb0Au X-Virus-Checked: Checked by ClamAV on apache.org With the help of Costin I got a running Maven configuration. Thank you :). This is a pom.xml for Spring Data Hadoop and CDH4: 4.0.0 com.example com.example.main 0.0.1-SNAPSHOT jar 1.7 UTF-8 3.2.0.RELEASE 1.0.0.BUILD-SNAPSHOT 2.0.0-cdh4.1.3 2.0.0-mr1-cdh4.1.3 org.springframework spring-core ${spring.version} commons-logging commons-logging org.springframework spring-context ${spring.version} org.springframework.data spring-data-hadoop ${spring.hadoop.version} hadoop-streaming org.apache.hadoop hadoop-tools org.apache.hadoop org.apache.hadoop hadoop-common ${hadoop.version.generic} org.apache.hadoop hadoop-hdfs ${hadoop.version.generic} org.apache.hadoop hadoop-tools 2.0.0-mr1-cdh4.1.3 org.apache.hadoop hadoop-streaming 2.0.0-mr1-cdh4.1.3 org.apache.maven.plugins maven-compiler-plugin ${java-version} ${java-version} spring-milestones http://repo.springsource.org/libs-milestone false cloudera https://repository.cloudera.com/artifactory/cloudera-repos/ false spring-snapshot Spring Maven SNAPSHOT Repository http://repo.springframework.org/snapshot Best Regards, Christian. -------- Original-Nachricht -------- > Datum: Tue, 12 Feb 2013 16:56:50 +0100 > Von: Christian Schneider > An: ironhawk@gmx.com > Betreff: Fwd: NullPointerException in Spring Data Hadoop with CDH4 > ---------- Forwarded message ---------- > From: Costin Leau > Date: 2013/2/12 > Subject: Re: NullPointerException in Spring Data Hadoop with CDH4 > To: user@hadoop.apache.org > > > Hi, > > For Spring Data Hadoop problems, it's best to use the designated forum > [1]. > These being said I've tried to reproduce your error but I can't - I've > upgraded the build to CDH 4.1.3 which runs fine against the VM on the CI > (4.1.1). > Maybe you have some other libraries on the client classpath? > > From the stacktrace, it looks like the org.apache.hadoop.mapreduce.**Job > class has no 'state' or 'info' fields... > > Anyway, let's continue the discussion on the forum. > > Cheers, > [1] > http://forum.springsource.org/**forumdisplay.php?87-Hadoop > > > On 02/12/13 2:51 PM, Christian Schneider wrote: > > > Hi, > > I try to use Spring Data Hadoop with CDH4 to write a Map Reduce Job. > > > > On startup, I get the following exception: > > > > Exception in thread "SimpleAsyncTaskExecutor-1" java.lang.** > > ExceptionInInitializerError > > at org.springframework.data.**hadoop.mapreduce.JobExecutor$** > > 2.run(JobExecutor.java:183) > > at java.lang.Thread.run(Thread.**java:722) > > Caused by: java.lang.NullPointerException > > at > org.springframework.util.**ReflectionUtils.**makeAccessible(** > > ReflectionUtils.java:405) > > at org.springframework.data.**hadoop.mapreduce.JobUtils.<** > > clinit>(JobUtils.java:123) > > ... 2 more > > > > I guess there is a problem with my Hadoop related dependencies. I > couldn't > > find any reference showing how to configure Spring Data together with > CDH4. > > But Costin showed, he is able to configure it: > https://build.springsource. > > > **org/browse/SPRINGDATAHADOOP-**CDH4-JOB1 > > > > > > **Maven Setup** > > > > > > 1.0.0.**BUILD-SNAPSHOT > version> > > 2.0.0-cdh4.1.**3 > > > > > > > > ... > > > > org.springframework.**data > > spring-data-**hadoop > > ${spring.hadoop.**version} > > > > > > > > org.apache.hadoop > > hadoop-common > > ${hadoop.version} > > > > > > > > org.apache.hadoop > > hadoop-client > > ${hadoop.version} > > > > > > > > org.apache.hadoop > > hadoop-streaming > > ${hadoop.version} > > > > > > > > org.apache.hadoop > > hadoop-test > > 2.0.0-mr1-cdh4.1.3 > > > > > > > > org.apache.hadoop > > hadoop-tools > > 2.0.0-mr1-cdh4.1.3 > > > > ... > > > > ... > > > > > > cloudera > > https://repository.**cloudera.com/artifactory/** > > > cloudera-repos/ > > > > > > false > > > > > > > > > > spring-snapshot > > Spring Maven SNAPSHOT Repository > > > http://repo.**springframework.org/snapshot > > > > > > > > > > **Application Context** > > > > > > xmlns="http://www.**springframework.org/schema/**beans > > " > > > xmlns:xsi="http://www.w3.org/**2001/XMLSchema-instance > > " > > > xmlns:hdp="http://www.**springframework.org/schema/**hadoop" > > > xmlns:context="http://www.**springframework.org/schema/**context > > " > > > xmlns:hadoop="http://www.**springframework.org/schema/**hadoop > > " > > xsi:schemaLocation=" > > > http://www.springframework.**org/schema/beans > > > http://www.springframework.**org/schema/beans/spring-beans.**xsd > > > http://www.springframework.**org/schema/hadoop > > > http://www.springframework.**org/schema/hadoop/spring-**hadoop.xsd > > > http://www.springframework.**org/schema/context/spring-**context.xsd > > > http://www.springframework.**org/schema/integration > > > http://www.springframework.**org/schema/context > > > http://www.springframework.**org/schema/context/spring-**context-3.1.xsd > > "> > > > > location="classpath:hadoop.**properties" > > /> > > > > > > fs.defaultFS=${hd.fs} > > > > > > > output-path="${output.path}" mapper="com.example.** > > WordMapper" > > reducer="com.example.**WordReducer" /> > > > > > wait-for-completion="true"/> > > > > > > > > **Cluster version** > > > > Hadoop 2.0.0-cdh4.1.3 > > > > > > **Note:** > > > > This small Unittest is running fine with the current configuration: > > > > @RunWith(**SpringJUnit4ClassRunner.class) > > @ContextConfiguration(**locations = { > "classpath:/**applicationContext.xml" > > }) > > public class Starter { > > > > @Autowired > > private Configuration configuration; > > > > @Test > > public void shellOps() { > > Assert.assertNotNull(this.**configuration); > > FsShell fsShell = new FsShell(this.configuration); > > final Collection coll = > fsShell.ls("/user"); > > System.out.println(coll); > > } > > } > > > > > > It would be nice if someone can give me an example configuration. > > > > Best Regards, > > Christian. > > > > > -- > Costin