Cursor needs to be over an identifier
It seems like the tip requires you to position the cursor over a class name for which it will then insert the import statement. "No identifier under cursor"-error shows up when the mapping tries to use the <C-W>} command when there is no word under the cursor.
ctags
The other errors show up because it also uses the command <C-W>} which requires you to have a ctags file containing the tags for the project. That can be generated with a ctags utility. Exuberant ctags is quite nice for that purpose:
http://ctags.sourceforge.net/
Here is some information about using ctags for java (although on my system I don't have a command exuberant-ctags, it's just ctags):
http://blog.vinceliu.com/2007/08/vim-tips-for-java-2-using-exuberant.html
Tip quality
It looks like the mapping in that tip clobbers the default register, search register and changes the last change command, the jump stack, the tag stack and moves the cursor. So it's a quick'n dirty tip, not very elegant.