Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonFactory

I am working on YouTube broadcast sample examples. I have created a sample Java Project & added required jars. But, when I try to run the project it throws exception.

Exception :

Throwable: com/fasterxml/jackson/core/JsonFactory java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonFactory     at com.google.api.client.json.jackson2.JacksonFactory.<init>(JacksonFactory.java:44)     at com.google.api.services.samples.youtube.cmdline.live.Auth.<clinit>(Auth.java:35)     at com.google.api.services.samples.youtube.cmdline.live.CreateBroadcast.main(CreateBroadcast.java:55) Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.JsonFactory     at java.net.URLClassLoader$1.run(URLClassLoader.java:366)     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)     at java.lang.ClassLoader.loadClass(ClassLoader.java:425)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)     at java.lang.ClassLoader.loadClass(ClassLoader.java:358)     ... 3 more 

I downloaded the project from this GitHub repository.

like image 661
VVB Avatar asked May 21 '15 07:05

VVB


People also ask

How do I fix Java Lang NoClassDefFoundError error?

You can fix NoClassDefFoundError error by checking following: Check the exception stack trace to know exactly which class throw the error and which is the class not found by java.

What is no class def found error?

ClassNotFoundException occurs when you try to load a class at runtime using Class. forName() or loadClass() methods and requested classes are not found in classpath. Most of the time this exception will occur when you try to run an application without updating the classpath with JAR files.


1 Answers

Add the following dependency to your pom.xml

<dependency>     <groupId>com.fasterxml.jackson.core</groupId>     <artifactId>jackson-core</artifactId>     <version>2.5.2</version> </dependency> 
like image 95
shruti1810 Avatar answered Sep 20 '22 19:09

shruti1810