I am trying to create REST service using Spring.When I try to access that service it returns proper data but shows -
Exception handling request to /RESTServ
We faced this issue while trial to migrate spring-boot-1.2.2-Final on wildfly 8.1.0-Final to spring-boot-1.3.2-Final on wildfly 8.1.0-Final. This error does not occur on wildfly 8.2.1-Final, so if you have option tp udate your wildfly version, you should do that.
But if you still have to use wildfly-8.1.0-Final, then you could patch it.
1) get https://github.com/undertow-io/undertow/archive/1.0.15.Final.zip
2) edit io.undertow.servlet.spec.HttpServletResponseImpl located in module servlet
@Override
public String getHeaders(final String name) {
return new ArrayList(exchange.getResponseHeaders().get(name));
}
to
@Override
public Collection getHeaders(final String name) {
final HeaderValues headerValues = exchange.getResponseHeaders().get(name);
if (headerValues != null) {
return new ArrayList(headerValues);
}
return new ArrayList();
}
Add the HeaderValues import:
import io.undertow.util.HeaderValues;
package undertow-servlet with maven and then overwrite
{wildfly-root-directory}/modules/system/layers/base/io/undertow/servlet/main/undertow-servlet-1.0.15.Final.jar
with the file
{undertow-root-directory}/servlet/target/undertow-servlet-1.0.15.Final.jar
This will solve this error.