How to diagnose "org.restlet.data.Parameter cannot be cast to org.restlet.data.Header" error in Restlet 2.3.5? <p>I'm using Restlet 2.3.5 in my application. When the <code>GET</code> request handler of a certain server resource is invoked, I get the following error:</p> <pre><code>[10:26:04] [Restlet-860541310/WARN]: Nov 29, 2015 10:26:04 AM org.restlet.engine.adapter.ServerAdapter addResponseHeaders WARNING: Exception intercepted while adding the response headers java.lang.ClassCastException: org.restlet.data.Parameter cannot be cast to org.restlet.data.Header at org.restlet.engine.header.HeaderUtils.addExtensionHeaders(HeaderUtils.java:226) at org.restlet.engine.header.HeaderUtils.addResponseHeaders(HeaderUtils.java:653) at org.restlet.engine.adapter.ServerAdapter.addResponseHeaders(ServerAdapter.java:83) at org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:184) at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:144) at org.restlet.engine.connector.HttpServerHelper$1.handle(HttpServerHelper.java:64) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77) at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80) at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:677) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77) at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:649) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) </code></pre> <p>The problem is that this exception is thrown outside of the code that I wrote (I added logging statements in my server resource and according to them, the exception is thrown somewhere else).</p> <p>As a result, I get 500 response (internal server error), even though my server resource sends correct data back to the client.</p> <p>How can I find out, what exactly is causing this error?</p>