Re: Exception in thread AWT-EventQueue-0 java.lang.NullPointerException

2011-05-18 Thread Lạc Trung
@Steve Loughran : That's the way I repaired my program.
@Robert Evans
@Harsh J:  Thanks for your reply.I'm so happy.

Thanks so much.


Re: Exception in thread AWT-EventQueue-0 java.lang.NullPointerException

2011-05-17 Thread Steve Loughran

On 16/05/11 21:12, Lạc Trung wrote:

I'm using Hadoop-0.21.
---
hut.edu.vn



At the top, it's your code, so you get to fix it. The good thing about 
open source is you can go all the way in.


This is what I would do in the same situation
-Grab the 0.21 source JAR
-add it your IDE
-have a look at what line it's NPEing on
-work out what variable's being null would trigger that. Usually its 
whatever object has just had a method called on it.

-work out why that's null (usually some config/startup thing was missing).
-If its a repeatable problem, try adding some checks in advance, dump 
state to the console, etc.

-fix what is probably a setup problem

If it's some other problem (race condition etc), life is harder

-steve


Re: Exception in thread AWT-EventQueue-0 java.lang.NullPointerException

2011-05-17 Thread Harsh J
Hey Lạc Trung,

I do not see a configuration instance used in your code; but you're
using the Configured class. Do you instantiate CopyFiles using
Hadoop's ReflectionUtils utility class? Unless that's done, the
getConf() would be returning a null causing the issue probably.

On Sat, May 14, 2011 at 8:07 PM, Lạc Trung trungnb3...@gmail.com wrote:
 Hello everybody !



 This exception was thrown when I tried to copy a file from local file to
 HDFS.

-- 
Harsh J


Re: Exception in thread AWT-EventQueue-0 java.lang.NullPointerException

2011-05-16 Thread Robert Evans
 {

copyFromLocal(path, str2);

} catch (IOException ex) {


Logger.getLogger(CopyFile.class.getName()).log(Level.SEVERE, null, ex);

}





}

};

 copy.addActionListener(act3);

 copy.setBounds(100 , 200 , 89, 23);

 form.getContentPane().add(copy);



}

}



And the output is :




Exception in thread AWT-EventQueue-0 java.lang.NullPointerException

at
org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:103)

at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:95)

at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:180)

at org.apache.hadoop.fs.Path.getFileSystem(Path.java:175)

at learnsocket.CopyFile.copyFromLocal(CopyFile.java:60)

at learnsocket.CopyFile$3.actionPerformed(CopyFile.java:152)

at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)

at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)

at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)

at java.awt.Component.processMouseEvent(Component.java:6267)

at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)

at java.awt.Component.processEvent(Component.java:6032)

at java.awt.Container.processEvent(Container.java:2041)

at java.awt.Component.dispatchEventImpl(Component.java:4630)

at java.awt.Container.dispatchEventImpl(Container.java:2099)

at java.awt.Component.dispatchEvent(Component.java:4460)

at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)

at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)

at java.awt.Container.dispatchEventImpl(Container.java:2085)

at java.awt.Window.dispatchEventImpl(Window.java:2478)

at java.awt.Component.dispatchEvent(Component.java:4460)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)

at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)






Please tell me what my problem is and how to fix it.



Thanks so much ^^ !



--
Nguyễn Bá Trung
SHSV : 20083535
SĐT: 01216259222
Email  : trungnb3...@gmail.com



Re: Exception in thread AWT-EventQueue-0 java.lang.NullPointerException

2011-05-16 Thread Lạc Trung
I'm using Hadoop-0.21.
---
hut.edu.vn


Exception in thread AWT-EventQueue-0 java.lang.NullPointerException

2011-05-14 Thread Lạc Trung
(CopyFile.class.getName()).log(Level.SEVERE, null, ex);

}





}

};

 copy.addActionListener(act3);

 copy.setBounds(100 , 200 , 89, 23);

 form.getContentPane().add(copy);



}

}



And the output is :




Exception in thread AWT-EventQueue-0 java.lang.NullPointerException

at
org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:103)

at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:95)

at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:180)

at org.apache.hadoop.fs.Path.getFileSystem(Path.java:175)

at learnsocket.CopyFile.copyFromLocal(CopyFile.java:60)

at learnsocket.CopyFile$3.actionPerformed(CopyFile.java:152)

at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)

at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)

at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)

at java.awt.Component.processMouseEvent(Component.java:6267)

at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)

at java.awt.Component.processEvent(Component.java:6032)

at java.awt.Container.processEvent(Container.java:2041)

at java.awt.Component.dispatchEventImpl(Component.java:4630)

at java.awt.Container.dispatchEventImpl(Container.java:2099)

at java.awt.Component.dispatchEvent(Component.java:4460)

at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)

at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)

at java.awt.Container.dispatchEventImpl(Container.java:2085)

at java.awt.Window.dispatchEventImpl(Window.java:2478)

at java.awt.Component.dispatchEvent(Component.java:4460)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)

at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)






Please tell me what my problem is and how to fix it.



Thanks so much ^^ !



-- 
Nguyễn Bá Trung
SHSV : 20083535
SĐT: 01216259222
Email  : trungnb3...@gmail.com