java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Test Step : Send a invalid XML Test XML: String invalidXml = "<network xmlns=\"urn:TBD:params:xml:ns:yang:nodes\"><name>My name</name><surname>My Surname</surname><isHappy>false</isHappy></network></filter>"; List<Object> yangModuleDecodedList = yangCodecHandler.decode(invalidXml, YangProtocolEncodingFormat.XML_ENCODING); --- Output : Exception onos> exception-display java.lang.NullPointerException at org.onosproject.yms.app.ych.codecutils.YchYangDataTreeCodec.decodeProtocolDataToYdt(YchYangDataTreeCodec.java:187) at org.onosproject.yms.app.ych.DefaultYangCodecHandler.decode(DefaultYangCodecHandler.java:195) at org.onosproject.ymstest.cli.YmsTestCommand.execute(YmsTestCommand.java:90) at org.onosproject.cli.AbstractShellCommand.doExecute(AbstractShellCommand.java:150) at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[27:org.apache.karaf.shell.console:3.0.5] at Proxy5204d04d_d874_45f6_a4b9_92aaf7f5cf24.execute(Unknown Source)[:] at Proxy5204d04d_d874_45f6_a4b9_92aaf7f5cf24.execute(Unknown Source)[:] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94) at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:210) at org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1$1.run(LocalConsoleManager.java:109) at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_101] at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[28:org.apache.karaf.jaas.modules:3.0.5] at org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1.run(LocalConsoleManager.java:102)[27:org.apache.karaf.shell.console:3.0.5] onos> ************************************* Module Having problem : YchYangDataTreeCodec.java public YdtBuilder decodeProtocolDataToYdt(String protocolData, Object schemaRegistry) { YdtExtendedBuilder ydtExtendedBuilder = null; Document document = null; try { document = DocumentHelper.parseText(protocolData); } catch (DocumentException e) { // TODO } XmlWalker walker = new DefaultXmlCodecWalker(); XmlCodecListener listener = new XmlCodecListener(); findRootElement(document.getRootElement()); Confirmed By Shankar
    via by antony silvester,
  • 1] Test Code String xml = "<filter xmlns=\"ydt.filter-type\" type=\"subtree\"><network xmlns=\"urn:TBD:params:xml:ns:yang:nodes\"><name>My name</name><surname>My Surname</surname><isHappy>false</isHappy></network></filter>"; List<Object> yangModuleDecodedList = yangCodecHandler.decode(xml, YangProtocolEncodingFormat.XML_ENCODING); Please find the Attached Yang File Output : Exception: onos> exception-display java.lang.NullPointerException at org.onosproject.yms.app.yob.YobSingleInstanceLeafHandler.setObjectInParent(YobSingleInstanceLeafHandler.java:59) at org.onosproject.yms.app.yob.YobListener.exitYdtNode(YobListener.java:79) at org.onosproject.yms.app.yob.YobListener.exitYdtNode(YobListener.java:91) at org.onosproject.yms.app.ydt.DefaultYdtWalker.walkTree(DefaultYdtWalker.java:66) at org.onosproject.yms.app.ydt.DefaultYdtWalker.walk(DefaultYdtWalker.java:96) at org.onosproject.yms.app.yob.DefaultYobBuilder.getYangObject(DefaultYobBuilder.java:43) at org.onosproject.yms.app.ych.DefaultYangCodecHandler.getObjectList(DefaultYangCodecHandler.java:241) at org.onosproject.yms.app.ych.DefaultYangCodecHandler.decode(DefaultYangCodecHandler.java:199) at org.onosproject.ymstest.cli.YmsTestCommand.execute(YmsTestCommand.java:90) at org.onosproject.cli.AbstractShellCommand.doExecute(AbstractShellCommand.java:150) at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[27:org.apache.karaf.shell.console:3.0.5] at Proxy2c8c95a2_4d2b_4472_930d_0a4e362aadfd.execute(Unknown Source)[:] at Proxy2c8c95a2_4d2b_4472_930d_0a4e362aadfd.execute(Unknown Source)[:] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94) at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:210) at org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1$1.run(LocalConsoleManager.java:109) at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_101] at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[28:org.apache.karaf.jaas.modules:3.0.5] at org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1.run(LocalConsoleManager.java:102)[27:org.apache.karaf.shell.console:3.0.5] onos> *********************************** Module Having Problem : YobHandler.java createYangBuilderObject try { yangDefaultClass = Class.forName(qualifiedClassName); } catch (ClassNotFoundException e) { log.error("YOB: failed to load class for class " + className); } try { Confirmed by : Bharat
    via by antony silvester,
    • java.lang.NullPointerException at org.onosproject.yms.app.ych.codecutils.YchYangDataTreeCodec.decodeProtocolDataToYdt(YchYangDataTreeCodec.java:187) at org.onosproject.yms.app.ych.DefaultYangCodecHandler.decode(DefaultYangCodecHandler.java:195) at org.onosproject.ymstest.cli.YmsTestCommand.execute(YmsTestCommand.java:90) at org.onosproject.cli.AbstractShellCommand.doExecute(AbstractShellCommand.java:150) at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[27:org.apache.karaf.shell.console:3.0.5] at Proxy5204d04d_d874_45f6_a4b9_92aaf7f5cf24.execute(Unknown Source)[:] at Proxy5204d04d_d874_45f6_a4b9_92aaf7f5cf24.execute(Unknown Source)[:] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[27:org.apache.karaf.shell.console:3.0.5] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94) at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:210) at org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1$1.run(LocalConsoleManager.java:109) at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_101] at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[28:org.apache.karaf.jaas.modules:3.0.5] at org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1.run(LocalConsoleManager.java:102)[27:org.apache.karaf.shell.console:3.0.5]
    No Bugmate found.