java.lang.NullPointerException

JIRA | antony silvester | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Test Steps : 1] Execute the latest App from the below git https://github.com/SojanKoshy/ymstest.git onos> app activate org.onosproject.yms onos> app activate org.onosproject.ymstest onos> app activate org.onosproject.restconf onos> onos> yms-test testNbiResister Send from postman: POST ​http://127.0.01:8181/onos/restconf/data/network { "name": "Huawei", "surname": "Bangalore", "networklist": [{ "network-id": "123", "server-provided": "false" }] } -------- Perform Get operation from Postman. Exception: onos> exception-display java.lang.NullPointerException at org.onosproject.yms.app.ytb.YdtBuilderFromYo.getInterfaceClassFromImplClass(YdtBuilderFromYo.java:724) at org.onosproject.yms.app.ytb.YdtBuilderFromYo.getModuleNodeFromYsr(YdtBuilderFromYo.java:194) at org.onosproject.yms.app.ytb.DefaultYangTreeBuilder.getYdtBuilderForYo(DefaultYangTreeBuilder.java:56) at org.onosproject.yms.app.yab.YangApplicationBroker.buildResponseYdtTree(YangApplicationBroker.java:344) at org.onosproject.yms.app.yab.YangApplicationBroker.processQuery(YangApplicationBroker.java:102) at org.onosproject.yms.app.ymsm.YmsManager.executeOperation(YmsManager.java:143) at org.onosproject.restconf.restconfmgr.RestconfManager.doGetOperation(RestconfManager.java:113) at org.onosproject.restconf.rpp.RestconfWebResource.handleGetRequest(RestconfWebResource.java:74)[180:org.onosproject.onos-app-restconf-rpp:1.7.0.SNAPSHOT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_101] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_101] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_101] at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_101] ******************************* Confirmed by Vidhyashree

    JIRA | 6 months ago | antony silvester
    java.lang.NullPointerException
  2. 0

    Issue: 1) input is not accepted in json body for rpc 2) Exception observed while posting RPC REST request Test steps: 1) Activate yms, ymstest & restconf apps 2) Run testcase testNbiSimpleRpc onos> app activate org.onosproject.yms onos> app activate org.onosproject.ymstest onos> app activate org.onosproject.restconf onos> yms-test testNbiSimpleRpc Test code snippet: SimpleRpcManager simpleRpcManager = new SimpleRpcManager(); ymsService.registerService(simpleRpcManager, SimpleRpc.class, null); print("Registered Service"); Test output: ---- Yang file ---- module simple-rpc { yang-version 1; namespace "urn:yms:test:rpc:simple"; prefix pc; revision 2016-08-26; rpc activate-software-image { input { leaf image-name { type string; } } output { leaf status { type string; } } } } --- POST ---- http://127.0.0.1:8181/onos/restconf/data/simple-rpc { "activate-software-image": { "input": { "image-name": "My Image" } } } ----output--- { "code": 500, "message": "Requested input is not child in activate-software-image in 0 at 0 in null\"" } --- POST ---- http://127.0.0.1:8181/onos/restconf/data/simple-rpc { "activate-software-image": { "image-name": "My Image" } } ----output--- { "code": 500, "message": "org.onosproject.yms.app.yob.YobSingleInstanceLeafHandler.setObjectInParent(YobSingleInstanceLeafHandler.java:61)" } ---- exception ---- onos> exception-display java.lang.NullPointerException at org.onosproject.yms.app.yob.YobSingleInstanceLeafHandler.setObjectInParent(YobSingleInstanceLeafHandler.java:61) at org.onosproject.yms.app.yob.YobListener.exitYdtNode(YobListener.java:91) at org.onosproject.yms.app.ydt.DefaultYdtWalker.walkTree(DefaultYdtWalker.java:67) at org.onosproject.yms.app.ydt.DefaultYdtWalker.walk(DefaultYdtWalker.java:97) at org.onosproject.yms.app.yob.DefaultYobBuilder.getYangObject(DefaultYobBuilder.java:43) at org.onosproject.yms.app.yab.YangApplicationBroker.getYangObject(YangApplicationBroker.java:224) at org.onosproject.yms.app.yab.YangApplicationBroker.processEditOfApplication(YangApplicationBroker.java:384) at org.onosproject.yms.app.yab.YangApplicationBroker.processEdit(YangApplicationBroker.java:130) at org.onosproject.yms.app.ymsm.YmsManager.executeOperation(YmsManager.java:136) at org.onosproject.restconf.restconfmgr.RestconfManager.doPostOperation(RestconfManager.java:133) at org.onosproject.restconf.rpp.RestconfWebResource.handlePostRequest(RestconfWebResource.java:126)[181:org.onosproject.onos-app-restconf-rpp:1.7.0.SNAPSHOT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_101] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_101] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_101] at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_101] at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)[136:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)[136:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)[136:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)[136:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)[136:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)[136:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)[136:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)[136:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)[136:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)[128:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)[128:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.internal.Errors.process(Errors.java:315)[128:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.internal.Errors.process(Errors.java:297)[128:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.internal.Errors.process(Errors.java:267)[128:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)[128:org.glassfish.jersey.core.jersey-common:2.22.2] at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)[136:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)[136:org.glassfish.jersey.core.jersey-server:2.22.2] at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)[142:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2] at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)[142:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)[142:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)[142:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2] at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)[142:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)[111:org.ops4j.pax.web.pax-web-jetty:3.2.6] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)[111:org.ops4j.pax.web.pax-web-jetty:3.2.6] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:75)[111:org.ops4j.pax.web.pax-web-jetty:3.2.6] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.server.Server.handle(Server.java:370)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[102:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415] at java.lang.Thread.run(Thread.java:745)[:1.8.0_101] Mailed to: Gaurav and moved to Vinod

    JIRA | 5 months ago | Sojan Koshy
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.onosproject.yms.app.ytb.YdtBuilderFromYo.getInterfaceClassFromImplClass()
    2. org.onosproject.yms
      YmsManager.executeOperation
      1. org.onosproject.yms.app.ytb.YdtBuilderFromYo.getInterfaceClassFromImplClass(YdtBuilderFromYo.java:724)
      2. org.onosproject.yms.app.ytb.YdtBuilderFromYo.getModuleNodeFromYsr(YdtBuilderFromYo.java:194)
      3. org.onosproject.yms.app.ytb.DefaultYangTreeBuilder.getYdtBuilderForYo(DefaultYangTreeBuilder.java:56)
      4. org.onosproject.yms.app.yab.YangApplicationBroker.buildResponseYdtTree(YangApplicationBroker.java:344)
      5. org.onosproject.yms.app.yab.YangApplicationBroker.processQuery(YangApplicationBroker.java:102)
      6. org.onosproject.yms.app.ymsm.YmsManager.executeOperation(YmsManager.java:143)
      6 frames
    3. org.onosproject.restconf
      RestconfWebResource.handleGetRequest
      1. org.onosproject.restconf.restconfmgr.RestconfManager.doGetOperation(RestconfManager.java:113)
      2. org.onosproject.restconf.rpp.RestconfWebResource.handleGetRequest(RestconfWebResource.java:74)[180:org.onosproject.onos-app-restconf-rpp:1.7.0.SNAPSHOT]
      2 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_101]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_101]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_101]
      4. java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_101]
      4 frames