users@grizzly.java.net

Unable to restart a controller

From: Jerome Louvel <contact_at_noelios.com>
Date: Thu, 28 Feb 2008 14:52:45 +0100

Hi all,

I completing the Grizzly connector for Restlet 1.1 M2 release. It almost
working but I encountered an issue.

If you start a controller, then stop it, then start it again, you get a NPE
due to issues with the default pipeline.

Exception in thread "Thread-2" java.lang.NullPointerException
        at
com.sun.grizzly.DefaultPipeline.startPipeline(DefaultPipeline.java:180)
        at com.sun.grizzly.Controller.start(Controller.java:819)
        at com.noelios.restlet.ext.grizzly.GrizzlyServerHelper

                $1.run(GrizzlyServerHelper.java:94)

I found a workaround by doing this:
        this.controller.stop();
      this.controller.getPipeline().stopPipeline();
      this.controller.setPipeline(new DefaultPipeline());

Obviously, it would be better to be able to reuse the existing
pipeline/threads.

Best regards,
Jerome Louvel
http://www.restlet.org