Hi Friends, I made some changes in the build.gradle file, added the following lines --
(1) group = "org.springframework.data.hadoop"
(2) repositories { mavenCentral() }
The compilation process is successful but in the run process showing some errors --
-----------------------------------------------------------------------
Code:
../gradlew
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:run
2012-06-06 11:11:43,693 INFO [org.springframework.context.support.ClassPathXmlApplicationContext] - <Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1a0c10f: startup date [Wed Jun 06 11:11:43 IST 2012]; root of context hierarchy>
2012-06-06 11:11:43,791 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from class path resource [META-INF/spring/context.xml]>
2012-06-06 11:11:44,256 INFO [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer] - <Loading properties file from class path resource [hadoop.properties]>
2012-06-06 11:11:44,275 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1d85f79: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,hadoop-configuration,wordcount-job,clean-script,runner]; root of factory hierarchy>
2012-06-06 11:11:45,725 INFO [org.apache.hadoop.ipc.Client] - <Retrying connect to server: localhost/127.0.0.1:9000. Already tried 0 time(s).>
2012-06-06 11:11:46,726 INFO [org.apache.hadoop.ipc.Client] - <Retrying connect to server: localhost/127.0.0.1:9000. Already tried 1 time(s).>
2012-06-06 11:11:47,727 INFO [org.apache.hadoop.ipc.Client] - <Retrying connect to server: localhost/127.0.0.1:9000. Already tried 2 time(s).>
2012-06-06 11:11:48,728 INFO [org.apache.hadoop.ipc.Client] - <Retrying connect to server: localhost/127.0.0.1:9000. Already tried 3 time(s).>
2012-06-06 11:11:49,768 INFO [org.apache.hadoop.ipc.Client] - <Retrying connect to server: localhost/127.0.0.1:9000. Already tried 4 time(s).>
2012-06-06 11:11:50,770 INFO [org.apache.hadoop.ipc.Client] - <Retrying connect to server: localhost/127.0.0.1:9000. Already tried 5 time(s).>
2012-06-06 11:11:51,771 INFO [org.apache.hadoop.ipc.Client] - <Retrying connect to server: localhost/127.0.0.1:9000. Already tried 6 time(s).>
2012-06-06 11:11:52,796 INFO [org.apache.hadoop.ipc.Client] - <Retrying connect to server: localhost/127.0.0.1:9000. Already tried 7 time(s).>
2012-06-06 11:11:53,797 INFO [org.apache.hadoop.ipc.Client] - <Retrying connect to server: localhost/127.0.0.1:9000. Already tried 8 time(s).>
2012-06-06 11:11:54,798 INFO [org.apache.hadoop.ipc.Client] - <Retrying connect to server: localhost/127.0.0.1:9000. Already tried 9 time(s).>
2012-06-06 11:11:54,811 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1d85f79: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,hadoop-configuration,wordcount-job,clean-script,runner]; root of factory hierarchy>
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wordcount-job': Invocation of init method failed; nested exception is java.net.ConnectException: Call to localhost/127.0.0.1:9000 failed on connection exception: java.net.ConnectException: Connection refused
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at org.springframework.data.hadoop.samples.wordcount.Main.main(Main.java:41)
Caused by: java.net.ConnectException: Call to localhost/127.0.0.1:9000 failed on connection exception: java.net.ConnectException: Connection refused
at org.apache.hadoop.ipc.Client.wrapException(Client.java:1095)
at org.apache.hadoop.ipc.Client.call(Client.java:1071)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
at $Proxy1.getProtocolVersion(Unknown Source)
at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:396)
at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:379)
at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:119)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:238)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:203)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:89)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1386)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1404)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:254)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:123)
at org.springframework.data.hadoop.mapreduce.JobFactoryBean.afterPropertiesSet(JobFactoryBean.java:177)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419)
... 12 more
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:656)
at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:434)
at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:560)
at org.apache.hadoop.ipc.Client$Connection.access$2000(Client.java:184)
at org.apache.hadoop.ipc.Client.getConnection(Client.java:1202)
at org.apache.hadoop.ipc.Client.call(Client.ja)a:1046
... 28 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Command '/usr/java/jdk1.6.0_29/bin/java' finished with (non-zero) exit value 1.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 19.532 secs
-----------------------------------------------------------------------
Friends can you plz help me to solve this problem ....
Thank you ....