[CONTROLLER-141] NPE when accessing linkstate BGP-RIB Created: 28/Jan/14  Updated: 25/Jul/23  Resolved: 26/Feb/14

Status: Resolved
Project: controller
Component/s: restconf
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Robert Varga Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


External issue ID: 383

 Description   

With default SP edition configuration (centralized integration build #152), trying to access http://localhost:8080/restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-ls:linkstate-address-family/bgp-ls:linkstate-subsequent-address-family/linkstate-routes results in following stack trace to be reported:

java.lang.NullPointerException
org.opendaylight.yangtools.yang.common.QName.<init>(QName.java:146)
org.opendaylight.yangtools.yang.common.QName.create(QName.java:293)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.toQName(ControllerContext.java:913)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.addKeyValue(ControllerContext.java:845)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.collectPathArguments(ControllerContext.java:717)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.collectPathArguments(ControllerContext.java:733)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.collectPathArguments(ControllerContext.java:733)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.collectPathArguments(ControllerContext.java:733)
org.opendaylight.controller.sal.restconf.impl.ControllerContext.toInstanceIdentifier(ControllerContext.java:178)
org.opendaylight.controller.sal.restconf.impl.RestconfImpl.readOperationalData(RestconfImpl.java:218)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
com.sun.jersey.server.impl.uri.rules.ResourceObjectRule.accept(ResourceObjectRule.java:100)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:440)
org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:179)



 Comments   
Comment by Jozef Gloncak [ 11/Feb/14 ]

Can you specify yang module which you used? I tried to find module bgp-rib in controller but I found nothing.

Comment by Jozef Gloncak [ 11/Feb/14 ]

Yang file with module bgp-rib was found in bgpcep project by Laco Borak.

Comment by Jozef Gloncak [ 14/Feb/14 ]

This null pointer exception was caused because key values of list
tables

  • bgp-ls:linkstate-address-family
  • bgp-ls:linkstate-subsequent-address-family
    are of type identityref.

It is supposed that prefix part of value (in this case bgp-ls) represents name of module and not prefix which is specified in YANG module.

Working URI should be like
......./tables/bgp-linkstate:linkstate-address-family/bgp-linkstate:linkstate-subsequent-address-family/.......

Comment by Jozef Gloncak [ 14/Feb/14 ]

Raising of exception for case when key value can't be resolved

Change-Id: I6343d98e6549c02906628c78f61f97c18b244fe4

Comment by Jozef Gloncak [ 24/Feb/14 ]

The fix isn't merged yet

Generated at Wed Feb 07 19:52:17 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.