Capturing device configuration using the JSCH SSH library fails with a NoClassDefFound com/jcraft/jsch/JSch exception

book

Article ID: 140270

calendar_today

Updated On:

Products

CA eHealth CA Spectrum

Issue/Introduction

When using NCM to capture the device configuration of a juniper router the customer was getting the following excpetions in the NCMSERV.OUT file with debug enabled:

Nov 14, 2019 16:06:45.147 - com.aprisma.spectrum.scmd.ScmService.debugging set to max
Nov 14, 2019 16:07:41.128 -
java.lang.NoClassDefFoundError: com/jcraft/jsch/JSch
    at com.aprisma.spectrum.scmd.JschSSH.getSession(JschSSH.java:57)
    at com.aprisma.spectrum.scmd.JunoScript.jschJunoCapture(JunoScript.java:66)
    at com.aprisma.spectrum.scmd.JunoScript.capture(JunoScript.java:46)
    at com.aprisma.spectrum.scmd.ScmServiceImpl.captureRunningConfigImpl(ScmServiceImpl.java:398
)
    at com.aprisma.spectrum.scmd.ScmServiceImpl.captureRunningConfigRun(ScmServiceImpl.java:222)
    at com.aprisma.spectrum.scmd.ScmServiceImpl.access$000(ScmServiceImpl.java:31)
    at com.aprisma.spectrum.scmd.ScmServiceImpl$1.run(ScmServiceImpl.java:1919)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.jcraft.jsch.JSch
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 8 more
Nov 14, 2019 16:07:43.131 -
java.lang.NoClassDefFoundError: com/jcraft/jsch/JSch
    at com.aprisma.spectrum.scmd.JschSSH.getSession(JschSSH.java:57)
    at com.aprisma.spectrum.scmd.JunoScript.jschJunoCapture(JunoScript.java:66)
    at com.aprisma.spectrum.scmd.JunoScript.capture(JunoScript.java:46)
    at com.aprisma.spectrum.scmd.ScmServiceImpl.captureRunningConfigImpl(ScmServiceImpl.java:398
)
    at com.aprisma.spectrum.scmd.ScmServiceImpl.captureRunningConfigRun(ScmServiceImpl.java:222)
    at com.aprisma.spectrum.scmd.ScmServiceImpl.access$000(ScmServiceImpl.java:31)
    at com.aprisma.spectrum.scmd.ScmServiceImpl$1.run(ScmServiceImpl.java:1919)
    at java.lang.Thread.run(Thread.java:745)

 

 
 

Cause

The following line was missing from the NCMSERV.idb file:


ENV;CLASSPATH=$SPECROOT/lib/jsch-0.1.54.jar<CSPATHSEP>;



Environment

Release : 10.X

Component : Spectrum Core / NCM

Resolution

Make sure the following line in in the $SPECROOT/lib/SDPM/partslist/NCMSERV.idb file:


ENV;CLASSPATH=$SPECROOT/lib/jsch-0.1.54.jar<CSPATHSEP>;


If it is not included in the file, add the line and restart the ncmservice.