tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kirys <ki...@neoteroi.org>
Subject Tomee 1.7.4 tries to parse a binary multipart as json
Date Wed, 28 Dec 2016 12:27:43 GMT
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(JAXRSUtils.java:1040)
     at 
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:610)
     at 
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:574)
     at 
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:242)
     at 
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:91)
     at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
     at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.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(CXFJAXRSFilter.java:94)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
     at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
     at 
com.gasce.portal.filters.NoCacheFilter.doFilter(NoCacheFilter.java:65)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
     at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
     at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
     at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
     at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
     at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
     at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
     at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
     at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
     at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
     at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.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(ThreadPoolExecutor.java:1142)
     at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.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(JsonStreamParserImpl.java:983)
     at 
org.apache.johnzon.core.JsonStreamParserImpl.readNextChar(JsonStreamParserImpl.java:272)
     at 
org.apache.johnzon.core.JsonStreamParserImpl.next(JsonStreamParserImpl.java:331)
     at 
org.apache.johnzon.core.JsonReaderImpl.readValue(JsonReaderImpl.java:52)
     at 
org.apache.johnzon.mapper.MappingParserImpl.readObject(MappingParserImpl.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(JohnzonMessageBodyReader.java:76)
     at 
org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.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(JsonStreamParserImpl.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(JsonStreamParserImpl.java:983)
     at 
org.apache.johnzon.core.JsonStreamParserImpl.readNextChar(JsonStreamParserImpl.java:272)
     at 
org.apache.johnzon.core.JsonStreamParserImpl.next(JsonStreamParserImpl.java:331)
     at 
org.apache.johnzon.core.JsonReaderImpl.readValue(JsonReaderImpl.java:52)
     at 
org.apache.johnzon.mapper.MappingParserImpl.readObject(MappingParserImpl.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(JohnzonMessageBodyReader.java:76)
     at 
org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1032)
     at 
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:610)
     at 
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:574)
     at 
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:242)
     at 
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:91)
     at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
     at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.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(CXFJAXRSFilter.java:94)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
     at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
     at 
com.gasce.portal.filters.NoCacheFilter.doFilter(NoCacheFilter.java:65)
     at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
     at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
     at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
     at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
     at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
     at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
     at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
     at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
     at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
     at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
     at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
     at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.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(ThreadPoolExecutor.java:1142)
     at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.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(JsonStreamParserImpl.java:265)
     ... 40 common frames omitted


Mime
View raw message