The problem is that GrizzlyServerFactory returns already started HttpServer, that's why you can not reconfigure it on the fly. Here [1] I've created a copy of the GrizzlyServerFactory , which doesn't start HttpServer, so the code like:
HttpServer httpServer = GrizzlyServerFactory.createHttpServer(BASE_URI, rc);
httpServer.getListener("grizzly").setMaxHttpHeaderSize(Integer.MAX_VALUE);
// don't forget to start the server explicitly
httpServer.start();
Hope that will help.