Hi,
I'm using CXF to create a jax-rs web service. Accessing the service from
a simple HTML form works correctly.
However when using curl to send a binary attachment, I get the following
server side exception
10 Mar 2017 09:55:56 | ERROR Unexpected exception from downstream in
Netty servlet handler, due to: {0}.
(org.apache.cxf.transport.http.netty.server.NettyHttpServletHandler)
[defaultEventExecutorGroup-7-1]
io.netty.handler.codec.UnsupportedMessageTypeException:
io.netty.handler.codec.http.DefaultFullHttpResponse (expected:
io.netty.buffer.ByteBuf)
at io.netty.handler.ssl.SslHandler.write(SslHandler.java:474)
at
io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:619)
at
io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:676)
at
io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:667)
at
io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:693)
at
io.netty.handler.codec.http.HttpObjectAggregator.decode(HttpObjectAggregator.java:166)
at
io.netty.handler.codec.http.HttpObjectAggregator.decode(HttpObjectAggregator.java:57)
at
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:278)
at
io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:277)
at
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:264)
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)
at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:278)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1070)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:904)
curl by default seems to issue a "Expect: 100-continue". The web service
call works if I disable "Expect: 100-continue" support. In this case
curl will post the request immediately. I have confirmed using some
other client application that if the client uses "Expect: 100-continue",
the web service does not function.
It seems that CXF jax-rs with netty as the HTTP(s) transport, does not
support "Expect: 100-continue" out of the box. Is there something I'm
missing in my configuration? Is it possible to enable "Expect:
100-continue" support?
Kind regards,
Martijn Brinkers
PS I'm using CXF 3.0.12