java-json-tools / json-schema-validator

A JSON Schema validation implementation in pure Java, which aims for correctness and performance, in that order
http://json-schema-validator.herokuapp.com/
Other
1.62k stars 399 forks source link

JsonValidator error #104

Open lemoncolly opened 10 years ago

lemoncolly commented 10 years ago

I am working with version 2.2.5.

As soon as run my tool to validate, I am getting on error when trying to reference the JsonValidator.

private static final JsonValidator validator = JsonSchemaFactory.byDefault().getValidator();

Receiving the following error: Exception in thread "main" java.lang.NoSuchFieldError: DRAFTV4_HYPERSCHEMA at com.github.fge.jsonschema.cfg.ValidationConfigurationBuilder.(ValidationConfigurationBuilder.java:65) at com.github.fge.jsonschema.cfg.ValidationConfiguration.newBuilder(ValidationConfiguration.java:92) at com.github.fge.jsonschema.cfg.ValidationConfiguration.byDefault(ValidationConfiguration.java:102) at com.github.fge.jsonschema.main.JsonSchemaFactoryBuilder.(JsonSchemaFactoryBuilder.java:68) at com.github.fge.jsonschema.main.JsonSchemaFactory.newBuilder(JsonSchemaFactory.java:123) at com.github.fge.jsonschema.main.JsonSchemaFactory.byDefault(JsonSchemaFactory.java:113)

fge commented 10 years ago

Hello,

This is not normal; this would mean that you use a json-schema-core version which is very old. 2.2.5 depends on -core 1.2.4.

How do you use this package? If via maven and you have a dependency on -core, remove it: -validator 2.2.5 will automatically pull the correct version.

lemoncolly commented 10 years ago

Looks like JJSchema is getting the way. I am also using it in my application.

It uses the following:

``` com.github.fge json-schema-core 1.0.1 ```

I will try and update the core version in it's pom and see what happens. I was able to get your code working when I temporarily removed all references to the JJSchema jar file.

Thanks!

On Mon, Jun 2, 2014 at 12:18 PM, Francis Galiegue notifications@github.com wrote:

Hello,

This is not normal; this would mean that you use a json-schema-core version which is very old. 2.2.5 depends on -core 1.2.4.

How do you use this package? If via maven and you have a dependency on -core, remove it: -validator 2.2.5 will automatically pull the correct version.

— Reply to this email directly or view it on GitHub https://github.com/fge/json-schema-validator/issues/104#issuecomment-44858198 .