Reply To: .addRule – java.lang.IllegalStateException:

Splash Forums Rewrite Users .addRule – java.lang.IllegalStateException: Reply To: .addRule – java.lang.IllegalStateException:


Well, to avoid this exception, you should use the following:

public Configuration getConfiguration(ServletContext context) {	
	return ConfigurationBuilder.begin() 
			 .when(Direction.isInbound().and(new HttpCondition() {
                             public boolean evaluate(HttpServletRewrite event, EvaluationContext context)
                                 return event.getResponse().isCommitted();
	         .perform(Log.message(Level.INFO, "Rewrite is active."))//  message(Log.message(Level.INFO, "Rewrite is active."))) 

But why is the response committed? It probably shouldn’t be. You should try to find what is committing the response prematurely.