Java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException
Try to use the latest com.fasterxml.jackson.core/jackson-databind
.
I upgraded it to 2.9.4
and it works now.
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.4</version>
</dependency>
java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException
Check which version of jackson-databind you are using.
According to that topic:
ClassNotFoundException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException
java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonFactory
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>
Exception in thread main java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper on maven
You are using maven-jar-plugin
to create a jar-with-dependencies
.
I think you want to use maven-assembly-plugin
instead.
In order to do this, change
<artifactId>maven-jar-plugin</artifactId>
to
<artifactId>maven-assembly-plugin</artifactId>
You may also need to add the execution to the plugin (as pointed out in the comments):
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
By the way, you may want to use use package
instead of install
.
Also execute the jar-with-dependencies
and not the "normal" jar:
java -jar target/myApp-jar-with-dependencies.jar
java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JsonMappingException
Related Topics
How to Link Feature and Step Definition in Cucumber
Failed to Process Import Candidates for Configuration Class
How to Find the Longest Word in a Given String
Changing Scene When a Button Is Pressed Fxml
Round Off a Double While Maintaining the Trailing Zero
Set Drawable Size Programmatically
Default Value in Lombok. How to Init Default With Both Constructor and Builder
How to Exit an Android App Programmatically
Spring MVC - Get Httpservletresponse Body
Kafka Consumer in Java Not Consuming Messages
How to Get Row Count Using Resultset in Java
Way to Check If Two Collections Contain the Same Elements, Independent of Order
How to Parallelize a Foreach Loop in Java
Sonarqube: Missing Blame Information for the Following Files
Value Annotation Not Working in Junit Test
Limiting the Number of Characters in a String, and Chopping Off the Rest