I'm trying to login to smartsheet using their api but I'm encountering a NoClassDefFoundError caused by a ClassNotFound Exception.
import java.util.ArrayList;
import java.util.Properties;
import java.util.Set;
import java.util.HashSet;
import java.util.List;
import java.io.InputStream;
import java.io.FileInputStream;
import com.smartsheet.api.Smartsheet;
import com.smartsheet.api.SmartsheetFactory;
import com.smartsheet.api.models.Cell;
import com.smartsheet.api.models.Column;
import com.smartsheet.api.models.Row;
import com.smartsheet.api.models.Sheet;
import com.smartsheet.api.models.PagedResult;
import com.smartsheet.api.models.AutomationAction;
import com.google.gson.Gson;
import com.smartsheet.api.SmartsheetBuilder;
public class Main
{
//main method for our main class
public static void main(String args[]) throws Exception
{
/*line that throws error*/
Smartsheet ss = new SmartsheetBuilder().setAccessToken("myAccessToken").build();
// other parts of the program
return;
}
}
Stacktrace:
Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JsonDeserializer at com.smartsheet.api.internal.SmartsheetImpl. (SmartsheetImpl.java:279) at com.smartsheet.api.SmartsheetBuilder.build(SmartsheetBuilder.java:258) at smartsheet.Main.main(Main.java:27) Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.JsonDeserializer at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 3 more
Is there any particular reason why this error is thrown? I've tried to access smartsheet using smartsheetfactory as demonstrated in their sample program, but I'm getting the same error.