You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "laijianbin (JIRA)" <ji...@apache.org> on 2018/11/19 07:25:00 UTC

[jira] [Commented] (SCB-1030) NPE when use DynamicSchemaLoader.registerSchemas(String, String)

    [ https://issues.apache.org/jira/browse/SCB-1030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16691334#comment-16691334 ] 

laijianbin commented on SCB-1030:
---------------------------------

复现步骤:

步骤一

在启动函数中添加DynamicSchemaLoader.INSTANCE.registerSchemas("bmiproviderdfdfd", "classpath*:dynamicschema/*.yaml");

public class BmiproviderApplication {
 public static void main(String[] args) throws Exception {
 Log4jUtils.init();
 BeanUtils.init();
 DynamicSchemaLoader.INSTANCE.registerSchemas("bmiproviderdfdfd", "classpath*:dynamicschema/*.yaml");
 }
}

步骤二

访问静态接口,查看日志为空指针

!image-2018-11-19-15-23-58-612.png!

> NPE when use DynamicSchemaLoader.registerSchemas(String, String)
> ----------------------------------------------------------------
>
>                 Key: SCB-1030
>                 URL: https://issues.apache.org/jira/browse/SCB-1030
>             Project: Apache ServiceComb
>          Issue Type: Task
>            Reporter: laijianbin
>            Assignee: laijianbin
>            Priority: Major
>         Attachments: image-2018-11-19-15-23-58-612.png
>
>
> 2018-11-19 11:46:14,758 [ERROR] http server failed. org.apache.servicecomb.transport.rest.vertx.VertxRestDispatcher.failureHandler(VertxRestDispatcher.java:72)
> java.lang.NullPointerException
>  at org.apache.servicecomb.common.rest.locator.OperationLocator.locate(OperationLocator.java:56)
>  at org.apache.servicecomb.common.rest.locator.ServicePathManager.producerLocateOperation(ServicePathManager.java:116)
>  at org.apache.servicecomb.common.rest.RestProducerInvocation.locateOperation(RestProducerInvocation.java:61)
>  at org.apache.servicecomb.common.rest.AbstractRestInvocation.findRestOperation(AbstractRestInvocation.java:80)
>  at org.apache.servicecomb.common.rest.RestProducerInvocation.findRestOperation(RestProducerInvocation.java:56)
>  at org.apache.servicecomb.common.rest.RestProducerInvocation.invoke(RestProducerInvocation.java:45)
>  at org.apache.servicecomb.transport.rest.vertx.VertxRestDispatcher.onRequest(VertxRestDispatcher.java:194)
>  at io.vertx.ext.web.impl.RouteImpl.handleContext(RouteImpl.java:223)
>  at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:101)
>  at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:120)
>  at org.apache.servicecomb.transport.rest.vertx.RestBodyHandler$BHandler.doEnd(RestBodyHandler.java:248)
>  at org.apache.servicecomb.transport.rest.vertx.RestBodyHandler$BHandler.end(RestBodyHandler.java:226)
>  at org.apache.servicecomb.transport.rest.vertx.RestBodyHandler.lambda$0(RestBodyHandler.java:86)
>  at io.vertx.core.http.impl.HttpServerRequestImpl.handleEnd(HttpServerRequestImpl.java:418)
>  at io.vertx.core.http.impl.ServerConnection.handleLastHttpContent(ServerConnection.java:475)
>  at io.vertx.core.http.impl.ServerConnection.processMessage(ServerConnection.java:446)
>  at io.vertx.core.http.impl.ServerConnection.handleMessage(ServerConnection.java:156)
>  at io.vertx.core.http.impl.HttpServerImpl$ServerHandlerWithWebSockets.handleMessage(HttpServerImpl.java:705)
>  at io.vertx.core.http.impl.HttpServerImpl$ServerHandlerWithWebSockets.handleMessage(HttpServerImpl.java:614)
>  at io.vertx.core.net.impl.VertxHandler.lambda$channelRead$1(VertxHandler.java:150)
>  at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:342)
>  at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:200)
>  at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:148)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
>  at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
>  at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
>  at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
>  at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
>  at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
>  at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
>  at io.vertx.core.http.impl.Http1xOrH2CHandler.end(Http1xOrH2CHandler.java:49)
>  at io.vertx.core.http.impl.Http1xOrH2CHandler.channelRead(Http1xOrH2CHandler.java:27)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
>  at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
>  at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
>  at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
>  at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
>  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
>  at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
>  at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
>  at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
>  at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
>  at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
>  at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
>  at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
>  at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
>  at java.lang.Thread.run(Thread.java:745)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)