java -cp "/dirwhereclassresides/java:/dirwherejarresides/jdk/jre/lib/ext/jackson-databind-2.9.9.1.jar" TestĮxception in thread "main" : com/fasterxml/jackson/annotation/JsonViewĪt (ClassLoader. I tried adding the path where the jar resides, but I get the same error. java -cp "/dirwhereclassresides/java" Test Exception in thread "main" : com/fasterxml/jackson/annotation/JsonViewĪt .introspect.JacksonAnnotationIntrospector.(JacksonAnnotationIntrospector.java:37)Īt .ObjectMapper.(ObjectMapper.java:291)Ĭaused by: : .JsonViewĪt $1.run(URLClassLoader.java:366)Īt $1.run(URLClassLoader.java:355)Īt (Native Method)Īt (URLClassLoader.java:354)Īt (ClassLoader.java:425)Īt (ClassLoader.java:358) However, I can't seem to get java find the jar & execute the class. This is useful if the property names used internally in your Java class is not the same as the property name used in the JSON file. I am able to compile the class with no issues, and produce Test.class. The Jackson annotation JsonSetter is used to tell Jackson that is should match the name of this setter method to a property name in the JSON data, when reading JSON into objects. I placed jackson-databind-2.9.9.1.jar in /dirwherejarresides/jdk/jre/lib/ext. The inheritance generation is achieved using jackson annotations. Note: There is a new version for this artifact. Note: There is a new version for this artifact. 46 in MvnRepository ( See Top Artifacts) 1 in Annotation Libraries. ObjectMapper objectMapper = new ObjectMapper() 46 in MvnRepository ( See Top Artifacts) 1 in Annotation Libraries. I wrote a simple test class to get it working. I need to use jackson to handle some JSON in my code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |