Hello, I am struggling to run vaadin 7 with hadoop. I have created a source code in plane java and executed with eclipse luna. It works fine file is coping to hadoop added all necessary jars but while trying it with vaadin I am facing too much trouble my code is as below
try
{
Configuration conf = new Configuration();
String source = "/home/midnight/op.cpp";
String dest = "/user";
conf.addResource(new Path("/usr/local/hadoop/etc/hadoop/core-site.xml"));
conf.addResource(new Path("/usr/local/hadoop/etc/hadoop/hdfs-site.xml"));
FileSystem fileSystem = FileSystem.get(conf);
String filename = source.substring(source.lastIndexOf('/') + 1,source.length());
if (dest.charAt(dest.length() - 1) != '/')
{
dest = dest + "/" + filename;
} else {
dest = dest + filename;
}
Path path = new Path(dest);
if (fileSystem.exists(path))
{
System.out.println("File " + dest + " already exists");
return;
}
FSDataOutputStream out1 = fileSystem.create(path);
InputStream in = new BufferedInputStream(new FileInputStream(new File(source)));
byte b = new byte[1024]
;
int numBytes = 0;
while ((numBytes = in.read(b)) > 0)
{
out1.write(b, 0, numBytes);
}
in.close();
out1.close();
fileSystem.close();
}catch(Exception e)
{
}
when i run this code i get this one
[code]
java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration
at com.example.mytest.MytestUI.init(MytestUI.java:35)
at com.vaadin.ui.UI.doInit(UI.java:641)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:217)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:74)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1406)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:305)
[/code]Please help me out of this. Can anyone has an idea? using hadoop 2.6.0, tomcat v8.0, java 1.7. is there any conflicting jar? How to get rid of this.