Jackson Schema Validator com.github.fge.Frozen Class not found Exception

时间:2013-07-17 12:34:45

标签: schema jackson validation

我正在使用带有以下代码的jackson schema validator:

 ObjectMapper mapperSchema = new ObjectMapper();
 ObjectMapper mapperData = new ObjectMapper();
 JsonFactory factory = mapperData.getFactory();             
 JsonParser jp = factory.createParser(jsonDataString);
 JsonNode jsonData = mapperData.readTree(jp);       
 factory = mapperSchema.getFactory();           
 jp = factory.createParser(jsonSchemaString);
 JsonNode jsonSchema = mapperSchema.readTree(jp);

 JsonSchemaFactory schemaFactory = JsonSchemaFactory.byDefault();
 JsonSchema schema = schemaFactory.getJsonSchema(jsonSchema);

 ProcessingReport report;
 report = schema.validate(jsonData);

运行时我得到以下异常:      引起:java.lang.NoClassDefFoundError:com / github / fge / Frozen     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:791)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     在org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895)     在org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)     在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)     在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)     at gov.max.service.persistence.restlet.resources.data.LibraryDataKeyResource.validateAndGetData(Unknown Source)     at gov.max.service.persistence.restlet.resources.data.LibraryDataKeyResource.requestGet(Unknown Source)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

我正在使用以下三个罐子      杰克逊的注解 - 2.2.0.jar      杰克逊核心2.2.0.jar      杰克逊 - 数据绑定-2.2.0.jar

您能否建议我为了通过该例外需要做多少工作。

提前致谢, GVR

0 个答案:

没有答案