tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Tomee 1.7.4 tries to parse a binary multipart as json
Date Wed, 28 Dec 2016 13:35:22 GMT
Hi

you added johnzon yourself in tomee right? If so did you use a recent
version like 0.9.5 or 1.0.0? Also has your request the Content-Type header
well set?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-12-28 13:27 GMT+01:00 Kirys <kirys@neoteroi.org>:

> Hi all
>
> I have this method
>
>     @POST
>     @Path("/rest/saveLogo.do")
>     @Produces(MediaType.APPLICATION_JSON)
>     @Consumes(MediaType.MULTIPART_FORM_DATA)
>     public Response saveLogo(
>             MultipartBody body
>     ) {
>
>         return genericJsonResponse(CommandResult.NOT_IMPLEMENTED);
>     }
>
> somehow tomee tries to parse the passed body as if it were a json
>
> do you have any hint?
>
> Thank You
>
> K.
>
>
>
> Follows the stack trace
>
> javax.ws.rs.WebApplicationException: javax.json.stream.JsonParsingException:
> Unexpected IO exception on [lineNumber=1, columnNumber=1, streamOffset=0]
>     at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JA
> XRSUtils.java:1040)
>     at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRS
> Utils.java:610)
>     at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXR
> SUtils.java:574)
>     at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processR
> equest(JAXRSInInterceptor.java:242)
>     at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMe
> ssage(JAXRSInInterceptor.java:91)
>     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(Phase
> InterceptorChain.java:263)
>     at org.apache.cxf.transport.ChainInitiationObserver.onMessage(C
> hainInitiationObserver.java:121)
>     at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke
> (AbstractHTTPDestination.java:240)
>     at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(
> CxfRsHttpListener.java:227)
>     at org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXR
> SFilter.java:94)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
> lter(ApplicationFilterChain.java:241)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
> licationFilterChain.java:208)
>     at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilte
> r.java:52)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
> lter(ApplicationFilterChain.java:241)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
> licationFilterChain.java:208)
>     at com.gasce.portal.filters.NoCacheFilter.doFilter(NoCacheFilte
> r.java:65)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
> lter(ApplicationFilterChain.java:241)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
> licationFilterChain.java:208)
>     at org.apache.catalina.core.StandardWrapperValve.invoke(Standar
> dWrapperValve.java:220)
>     at org.apache.catalina.core.StandardContextValve.invoke(Standar
> dContextValve.java:122)
>     at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
>     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(A
> uthenticatorBase.java:505)
>     at org.apache.catalina.core.StandardHostValve.invoke(StandardHo
> stValve.java:169)
>     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo
> rtValve.java:103)
>     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa
> lve.java:956)
>     at org.apache.catalina.core.StandardEngineValve.invoke(Standard
> EngineValve.java:116)
>     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd
> apter.java:436)
>     at org.apache.coyote.http11.AbstractHttp11Processor.process(Abs
> tractHttp11Processor.java:1078)
>     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler
> .process(AbstractProtocol.java:625)
>     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(
> JIoEndpoint.java:318)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool
> Executor.java:1142)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
> lExecutor.java:617)
>     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.
> run(TaskThread.java:61)
>     at java.lang.Thread.run(Thread.java:745)
> Caused by: javax.json.stream.JsonParsingException: Unexpected IO
> exception on [lineNumber=1, columnNumber=1, streamOffset=0]
>     at org.apache.johnzon.core.JsonStreamParserImpl.uexio(JsonStrea
> mParserImpl.java:983)
>     at org.apache.johnzon.core.JsonStreamParserImpl.readNextChar(Js
> onStreamParserImpl.java:272)
>     at org.apache.johnzon.core.JsonStreamParserImpl.next(JsonStream
> ParserImpl.java:331)
>     at org.apache.johnzon.core.JsonReaderImpl.readValue(JsonReaderI
> mpl.java:52)
>     at org.apache.johnzon.mapper.MappingParserImpl.readObject(Mappi
> ngParserImpl.java:112)
>     at org.apache.johnzon.mapper.Mapper.mapObject(Mapper.java:237)
>     at org.apache.johnzon.mapper.Mapper.readObject(Mapper.java:192)
>     at org.apache.johnzon.jaxrs.JohnzonMessageBodyReader.readFrom(J
> ohnzonMessageBodyReader.java:76)
>     at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JA
> XRSUtils.java:1032)
>     ... 33 common frames omitted
> Caused by: java.nio.charset.MalformedInputException: Input length = 1
>     at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
>     at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
>     at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
>     at java.io.InputStreamReader.read(InputStreamReader.java:184)
>     at org.apache.johnzon.core.JsonStreamParserImpl.readNextChar(Js
> onStreamParserImpl.java:265)
>     ... 40 common frames omitted
> [C]2016-12-28 13:19:24,368|http-bio-8080-exec-164|DEBUG
> c.g.p.e.WebApplicationExceptionHandler: class javax.ws.rs
> .WebApplicationException
> javax.json.stream.JsonParsingException: Unexpected IO exception on
> [lineNumber=1, columnNumber=1, streamOffset=0]
>     at org.apache.johnzon.core.JsonStreamParserImpl.uexio(JsonStrea
> mParserImpl.java:983)
>     at org.apache.johnzon.core.JsonStreamParserImpl.readNextChar(Js
> onStreamParserImpl.java:272)
>     at org.apache.johnzon.core.JsonStreamParserImpl.next(JsonStream
> ParserImpl.java:331)
>     at org.apache.johnzon.core.JsonReaderImpl.readValue(JsonReaderI
> mpl.java:52)
>     at org.apache.johnzon.mapper.MappingParserImpl.readObject(Mappi
> ngParserImpl.java:112)
>     at org.apache.johnzon.mapper.Mapper.mapObject(Mapper.java:237)
>     at org.apache.johnzon.mapper.Mapper.readObject(Mapper.java:192)
>     at org.apache.johnzon.jaxrs.JohnzonMessageBodyReader.readFrom(J
> ohnzonMessageBodyReader.java:76)
>     at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JA
> XRSUtils.java:1032)
>     at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRS
> Utils.java:610)
>     at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXR
> SUtils.java:574)
>     at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processR
> equest(JAXRSInInterceptor.java:242)
>     at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMe
> ssage(JAXRSInInterceptor.java:91)
>     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(Phase
> InterceptorChain.java:263)
>     at org.apache.cxf.transport.ChainInitiationObserver.onMessage(C
> hainInitiationObserver.java:121)
>     at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke
> (AbstractHTTPDestination.java:240)
>     at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(
> CxfRsHttpListener.java:227)
>     at org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXR
> SFilter.java:94)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
> lter(ApplicationFilterChain.java:241)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
> licationFilterChain.java:208)
>     at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilte
> r.java:52)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
> lter(ApplicationFilterChain.java:241)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
> licationFilterChain.java:208)
>     at com.gasce.portal.filters.NoCacheFilter.doFilter(NoCacheFilte
> r.java:65)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
> lter(ApplicationFilterChain.java:241)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
> licationFilterChain.java:208)
>     at org.apache.catalina.core.StandardWrapperValve.invoke(Standar
> dWrapperValve.java:220)
>     at org.apache.catalina.core.StandardContextValve.invoke(Standar
> dContextValve.java:122)
>     at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
>     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(A
> uthenticatorBase.java:505)
>     at org.apache.catalina.core.StandardHostValve.invoke(StandardHo
> stValve.java:169)
>     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo
> rtValve.java:103)
>     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa
> lve.java:956)
>     at org.apache.catalina.core.StandardEngineValve.invoke(Standard
> EngineValve.java:116)
>     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd
> apter.java:436)
>     at org.apache.coyote.http11.AbstractHttp11Processor.process(Abs
> tractHttp11Processor.java:1078)
>     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler
> .process(AbstractProtocol.java:625)
>     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(
> JIoEndpoint.java:318)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool
> Executor.java:1142)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
> lExecutor.java:617)
>     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.
> run(TaskThread.java:61)
>     at java.lang.Thread.run(Thread.java:745)
> Caused by: java.nio.charset.MalformedInputException: Input length = 1
>     at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
>     at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
>     at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
>     at java.io.InputStreamReader.read(InputStreamReader.java:184)
>     at org.apache.johnzon.core.JsonStreamParserImpl.readNextChar(Js
> onStreamParserImpl.java:265)
>     ... 40 common frames omitted
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message