Error: "java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver"

  • KM476885
  • 28-Jul-2008
  • 10-Jun-2010

Summary

When user uses Check Credential for MicrosoftSQLServer, the connection fails

Error

Following DEBUG message is logged in probeMgr-patternsDebug.log

.... [DEBUG] [Thread-<xx>] - connection to ip=<x.x.x.x> by 'sql' protocol failed. error: java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver

Cause

This is a bug since the jar files or drivers not configured in probes Environment Class Path. The Probe Environment Path is available in <DDM install path>\scripts\install\WrapperEnv.conf

Fix

Follow the instructions below


1. Add the following line to WrapperEnv.conf file. This file can be located at <DDM install path>\scripts\install\conf
 
# Define the path to jdbc directory in the global Environment vars section around line 30
set.jdbc =%root%/lib/collectors/probeManager/discoveryResources/db

# Define the variable for Oracle and MSSQL in Environment Collectors Path section around line 79 and 80
set.ORACLE_CLASSPATH=%jdbc%/oracle/Seropto.jar
set.MSSQL_CLASSPATH=%jdbc%/mssqlserver/jtds-1.2.2.jar

# Add above two variable in the Manager and Probe's class path as show below
set.COLLECTORS_LOCAL_CLASSPATH=%MAM_JARS%;%lib%/collectors;%MYSQL_CLASSES%;%ext%/silib.jar;%SAP_CLASSES%;%FLOW_CLASSES%;%SNMP_CLASSES%;%JMX_CLASSES%;%ORACLE_CLASSPATH%;%MSSQL_CLASSPATH%


set.COLLECTORS_PROBE_CLASSPATH=%MAM_JARS%;%lib%/collectors;%MYSQL_CLASSES%;%ext%/silib.jar;%SAP_CLASSES%;%FLOW_CLASSES%;%SNMP_CLASSES%;%JMX_CLASSES%;%ORACLE_CLASSPATH%;%MSSQL_CLASSPATH%

2. 
Restart the probe for the changes to take effect.




Note: Also added drivers for oracle as discussed in Document ID KM476887 - Error: "java.lang.ClassNotFoundException: com.inet.ora.OraDriver"