Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-10286

NoClassDefFoundError for net/sf/json/JSONSerialize with the JSON collector on Minion

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Meridian-2018.1.0, 22.0.4
    • Component/s: None
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Sprint:
      Horizon - August 1st 2018, Horizon - August 8th 2018, Horizon - August 15th 2018, Horizon - August 22nd 2018, Horizon - August 29th 2018

      Description

      I encountered the following exception when trying to use the JSON handler with the XML collector on Minion:

      admin@opennms> collection:collect -n 137 org.opennms.protocols.xml.collector.XmlCollector 172.20.1.61 collection=json-bamboo-agent-stats handler-class=org.opennms.protocols.json.collector.DefaultJsonCol[39/1970]
      ndler                                                                                                                                                                                                             
                                                                                                                                                                                                                        
      Collect failed with:java.util.concurrent.ExecutionException: org.opennms.core.rpc.api.RemoteExecutionException: java.util.concurrent.CompletionException: java.lang.NoClassDefFoundError: net/sf/json/JSONSerialize
      r
       at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
       at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
       at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)                                                                                                                           
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NoClassDefFoundError: net/sf/json/JSONSerializer
       at org.opennms.protocols.json.collector.AbstractJsonCollectionHandler.getJSONObject(AbstractJsonCollectionHandler.java:184)                                                                                      
       at org.opennms.protocols.json.collector.DefaultJsonCollectionHandler.fillCollectionSet(DefaultJsonCollectionHandler.java:49)                                                                                     
       at org.opennms.protocols.xml.collector.AbstractXmlCollectionHandler.collect(AbstractXmlCollectionHandler.java:178)                                                                                               
       at org.opennms.protocols.xml.collector.XmlCollector.collect(XmlCollector.java:257)                                                                                                                               
       at Proxy201c535a_1150_4dbf_b5b4_b596d9e5d7a7.collect(Unknown Source)                                                                                                                                             
       at org.opennms.netmgt.collection.client.rpc.CollectorClientRpcModule$1.get(CollectorClientRpcModule.java:83)                                                                                                     
       at org.opennms.netmgt.collection.client.rpc.CollectorClientRpcModule$1.get(CollectorClientRpcModule.java:77)                                                                                                     
       at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
       ... 3 more        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
              at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
              at org.opennms.netmgt.collection.commands.CollectCommand.execute(CollectCommand.java:169)                                                                                                                 
              at org.opennms.netmgt.collection.commands.CollectCommand.execute(CollectCommand.java:73)
              at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)                                                                                                                
              at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)                                                                                                        
              at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)                                                                                                        
              at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571)                                                                                                                                     
              at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497)                                                                                                                               
              at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386)                                                                                                                                        
              at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417)                                                                                                                                               
              at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)                                                                                                                                                 
              at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)                                                                                                                                                  
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)                                                                                                                                               
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)                                                                                                                        
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)                                                                                                                        
              at java.lang.Thread.run(Thread.java:748)
      Caused by: org.opennms.core.rpc.api.RemoteExecutionException: java.util.concurrent.CompletionException: java.lang.NoClassDefFoundError: net/sf/json/JSONSerializer                                                
       at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
       at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
       at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NoClassDefFoundError: net/sf/json/JSONSerializer
       at org.opennms.protocols.json.collector.AbstractJsonCollectionHandler.getJSONObject(AbstractJsonCollectionHandler.java:184)
       at org.opennms.protocols.json.collector.DefaultJsonCollectionHandler.fillCollectionSet(DefaultJsonCollectionHandler.java:49)
       at org.opennms.protocols.xml.collector.AbstractXmlCollectionHandler.collect(AbstractXmlCollectionHandler.java:178)
       at org.opennms.protocols.xml.collector.XmlCollector.collect(XmlCollector.java:257)
       at Proxy201c535a_1150_4dbf_b5b4_b596d9e5d7a7.collect(Unknown Source)
       

        Attachments

          Activity

            People

            • Assignee:
              j-white Jesse White
              Reporter:
              j-white Jesse White
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: