Forum Discussion

Boo's avatar
Boo
New Contributor
6 years ago

Sending special character

I have a REST POST request who is sending a lot of json data. Part of those data contains special character letters like in "éèêàù". When I send the data like that, I got an error message saying:

 

HTTP Status 500 – Internal Server Error

Type Exception Report

Message Servlet execution threw an exception

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: Servlet execution threw an exception
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause

java.lang.NoSuchMethodError: javax.ws.rs.InternalServerErrorException.validate(Ljavax/ws/rs/core/Response;Ljavax/ws/rs/core/Response$Status;)Ljavax/ws/rs/core/Response;
	javax.ws.rs.InternalServerErrorException.<init>(InternalServerErrorException.java:126)
	org.apache.cxf.jaxrs.utils.SpecExceptions.toInternalServerErrorException(SpecExceptions.java:79)
	org.apache.cxf.jaxrs.utils.ExceptionUtils.toInternalServerErrorException(ExceptionUtils.java:113)
	org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.convertExceptionToResponseIfPossible(JAXRSInInterceptor.java:226)
	org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:215)
	org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:77)
	org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
	org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
	org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
	org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
	org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
	org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:218)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
	org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs.

Apache Tomcat/8.5.32

However, if I remove all special character from the request, everything goes fine.

 

I have try adding "Encoding" "UTF-8" to my header but it doesn't work.

 

So, what should I do to be able to send data containing special character?

 

(Note that the same request with special character work on Postman)

  • Did you try adding UTF-8 to this path?

     

    "%SOAPUI_HOME%"\bin\SoapUI-X.0.0.vmoptions and add

    "-Dfile.encoding=UTF8"

    Save the file and restart ReadyAPI again. To check whether it is updated :-

     

    Go to ready API - Help --> System Properties --> file.encoding

  • avidCoder's avatar
    avidCoder
    Super Contributor

    Did you try adding UTF-8 to this path?

     

    "%SOAPUI_HOME%"\bin\SoapUI-X.0.0.vmoptions and add

    "-Dfile.encoding=UTF8"

    Save the file and restart ReadyAPI again. To check whether it is updated :-

     

    Go to ready API - Help --> System Properties --> file.encoding