Skip to content

Instantly share code, notes, and snippets.

View imasahiro's full-sized avatar

Masahiro Ide imasahiro

  • LINE Corporation
  • Tokyo Japan
View GitHub Profile
class Configuration {
@Bean
HttpServiceRegistrationBean springMvcTomcatService(ServletWebServerApplicationContext applicationContext) {
TomcatWebServer container = (TomcatWebServer) applicationContext.getWebServer();
// Starts the container explicitly to make sure all connectors are write back from serviceConnectors.
container.start();
Connector tomcatConnector = container.getTomcat().getConnector();
return new HttpServiceRegistrationBean()
.setServiceName("MyService")
// Armeria 0.67.1
// armeria-shaded
// armeria-spring-boot-starter-shaded
public class MySpringBootAppTest {
@Rule
public final MockitoRule rule = MockitoJUnit.rule();
@Mock
private MyService.Iface iface;
@Test
com.linecorp.armeria.common.ProtocolViolationException: java.lang.NullPointerException
at com.linecorp.armeria.client.Http1ResponseDecoder.channelRead(Http1ResponseDecoder.java:144)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelR