When I try to finish a activity listener plugin project in Eclipse, I get null returned by DebugPlugin.getDefault() in my project, the code like below:
public class SampleHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
//      System.out.println("hello1");
    BreakpointListener bl = new BreakpointListener();
    DebugEventSetListener desl = new DebugEventSetListener();
//      System.out.println("hello2");
    System.out.println(bl.toString());
    System.out.println(DebugPlugin.getDefault());//print null 
    System.out.println(DebugPlugin.getDefault().getBreakpointManager());
   DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(bl);
    DebugPlugin.getDefault().addDebugEventListener(desl);
    return null;
    }
}
I'm sure I have imported org.eclipse.debug.core, but DebugPlugin.getDefault() give me a null.
How can I solve this problem? Why this problem occured?
 
    