HTTP 400 UnsupportedMediaTypeException: RESTEASY001055: невозможно использовать тип содержимого - PullRequest
0 голосов
/ 26 июня 2019

Я пытаюсь сделать петицию из SOAP GUI, если я делаю, когда JSON содержит символ с длиной битов 8 или более (ñ, í, ó, ú, ' и т. д.), ответы сервера с этим журналом ошибок

11:16:54,869 ERROR [org.jboss.resteasy.resteasy_jaxrs.i18n] (http-127.0.0.1:8080-2) RESTEASY000100: Failed executing POST /path: org.jboss.resteasy.spi.ReaderException: org.codehaus.jackson.JsonParseException: Invalid UTF-8 middle byte 0x22
 at [Source: org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl$InputStreamWrapper@1df9ca1; line: 37, column: 27]
    at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:201) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:137) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:160) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:561) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:543) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:128) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar:1.0.2.Final-redhat-2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at XXX.filter.ApiOriginFilter.doFilterInternal(ApiOriginFilter.java:44) [classes:]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.5.9.Final-redhat-2-bz-1358913.jar:7.5.9.Final-redhat-3]
    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.5.9.Final-redhat-2-bz-1358913.jar:7.5.9.Final-redhat-3]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.17.Final-redhat-1.jar:7.5.17.Final-redhat-1]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
Caused by: org.codehaus.jackson.JsonParseException: Invalid UTF-8 middle byte 0x22
 at [Source: org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl$InputStreamWrapper@1df9ca1; line: 37, column: 27]
    at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1433) [jackson-core-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:521) [jackson-core-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.impl.Utf8StreamParser._reportInvalidOther(Utf8StreamParser.java:2830) [jackson-core-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.impl.Utf8StreamParser._reportInvalidOther(Utf8StreamParser.java:2837) [jackson-core-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.impl.Utf8StreamParser._decodeUtf8_4(Utf8StreamParser.java:2682) [jackson-core-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.impl.Utf8StreamParser._finishString2(Utf8StreamParser.java:1962) [jackson-core-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.impl.Utf8StreamParser._finishString(Utf8StreamParser.java:1905) [jackson-core-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.impl.Utf8StreamParser.getText(Utf8StreamParser.java:276) [jackson-core-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.deser.std.StringDeserializer.deserialize(StringDeserializer.java:26) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.deser.std.StringDeserializer.deserialize(StringDeserializer.java:13) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:299) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.deser.SettableBeanProperty$FieldProperty.deserializeAndSet(SettableBeanProperty.java:579) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:299) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.deser.SettableBeanProperty$FieldProperty.deserializeAndSet(SettableBeanProperty.java:579) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2704) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1315) [jackson-mapper-asl-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419) [jackson-jaxrs-1.9.9.redhat-4.jar:1.9.9.redhat-4]
    at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:106) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.read(GZIPDecodingInterceptor.java:63) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:109) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:168) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
    ... 31 more

Я пытался добавить значение заголовка Content-Type -> application/json;charset=utf-8, добавить параметр JVM -Dfile.encoding=UTF-8, изменить версию моей зависимости, но не могу исправитьпроблема.

Когда я использую Почтальон, у меня нет этой проблемы!Я скопировал временные заголовки из Почтальона и скопировал их в SOAP, и ничего ...

Мне нужно знать, почему это происходит, потому что между моими модулями я делаю эту петицию к /path, и у меня было то же самоепроблема.

Моя зависимость от pom RESTEASY:

<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-spring</artifactId>
    <version>2.3.13.Final-redhat-1</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-jackson-provider</artifactId>
    <version>2.3.13.Final-redhat-1</version>
    <scope>provided</scope>
</dependency>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...