[CONTROLLER-1331] RPC input with non-existent namespace causes NullPointerException Created: 21/May/15  Updated: 25/Jul/23  Resolved: 22/May/15

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

Type: Bug
Reporter: Ryan Goulding Assignee: Ryan Goulding
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 3331

 Description   

With an RPC input, if you provide a string with a non-existent namespace, it causes a null pointer exception, whether or not you meant for it to be in that format.

Here is an example:

leaf response-message

{ type string; }

The following string is provided as input:

<input>
<response-message>/a:b</response-message>
</input>

2015-05-19 11:20:54,221 | ERROR | qtp746320666-384 | ContainerResponse | 110 - com.sun.jersey.jersey-server - 1.17.0 |
The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NullPointerException
at org.opendaylight.controller.sal.rest.impl.RestUtil.toIdentity(RestUtil.java:87)[225:org.opendaylight.controller.sal-rest-connector:1.1.3.Helium-SR3]
at org.opendaylight.controller.sal.rest.impl.RestUtil.asInstanceIdentifier(RestUtil.java:50)[225:org.opendaylight.controller.sal-rest-connector:1.1.3.Helium-SR3]
at org.opendaylight.controller.sal.rest.impl.XmlToCompositeNodeReader.resolveValueOfElement(XmlToCompositeNodeReader.java:234)[225:org.opendaylight.controller.sal-rest-connector:1.1.3.Helium-SR3]

Note: This issue only occurs with XML. This does not occur with JSON.



 Comments   
Comment by Ryan Goulding [ 21/May/15 ]

https://git.opendaylight.org/gerrit/#/c/20913/

Comment by Ryan Goulding [ 21/May/15 ]

https://git.opendaylight.org/gerrit/#/c/20923/ - stable/lithium changes

Comment by Tony Tkacik [ 21/May/15 ]

Just a note: affected class in ubused on lithium (stable/lithium) and berrylium branch. So bugfix is needed only for stable/helium branch.

Comment by Ryan Goulding [ 21/May/15 ]

Abandoned patch sets for Li and Be since this code is unused. Changed target milestone to Helium-4.

Comment by Tony Tkacik [ 22/May/15 ]

Could you provide link to stable/helium patchset?

Comment by Ryan Goulding [ 22/May/15 ]

https://git.opendaylight.org/gerrit/#/c/20913/ resolves stable/helium

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