New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict between json-schema-validator and jackson-core #188

Open
shobr opened this Issue Jun 29, 2016 · 9 comments

Comments

Projects
None yet
3 participants
@shobr

shobr commented Jun 29, 2016

Hi,
I am getting below error when both jackson-core and json-schema-validator jars are used :

java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
at com.fasterxml.jackson.databind.ObjectMapper.(ObjectMapper.java:549)
at com.fasterxml.jackson.databind.ObjectMapper.(ObjectMapper.java:460)

I have seen that json-schema-validator does not have the above method in JsonFactory class while jackson-core has.
Please provide a solution as I need to have both the jars in my classpath.

Also, I have another issue that I posted on stackOverflow.
http://stackoverflow.com/questions/38049997/json-schema-validator-not-validating-all-items-of-an-array-but-only-the-first-on

Thanks.

@huggsboson

This comment has been minimized.

Show comment
Hide comment
@huggsboson

huggsboson Jun 29, 2016

Member

Which version of jackson are you including? I read that error as something is expecting that method to be there and it isn't there, which usually happens when you have a newer version of a jar included and an older version.

http://stackoverflow.com/questions/27746750/exception-in-thread-main-java-lang-nosuchmethoderror-com-fasterxml-jackson-co

Member

huggsboson commented Jun 29, 2016

Which version of jackson are you including? I read that error as something is expecting that method to be there and it isn't there, which usually happens when you have a newer version of a jar included and an older version.

http://stackoverflow.com/questions/27746750/exception-in-thread-main-java-lang-nosuchmethoderror-com-fasterxml-jackson-co

@shobr

This comment has been minimized.

Show comment
Hide comment
@shobr

shobr Jun 29, 2016

I am using jackson-2.7.4 and json-schema-validator-2.2.6-lib.
In both these jars, above class is present but in json-schema-validator, the method is not defined.
I have to include json-schema-validator-2.2.6-lib.jar as it has ProcessingReport class which is required during validation.

shobr commented Jun 29, 2016

I am using jackson-2.7.4 and json-schema-validator-2.2.6-lib.
In both these jars, above class is present but in json-schema-validator, the method is not defined.
I have to include json-schema-validator-2.2.6-lib.jar as it has ProcessingReport class which is required during validation.

@huggsboson

This comment has been minimized.

Show comment
Hide comment
@huggsboson

huggsboson Jun 29, 2016

Member

jackson-core 2.2.x is a transitive dependency of json-schema-validator, though it will probably work fine if you make sure jackson-core-2.7.x gets included due to backwards compatibility.

If you look at:
http://fasterxml.github.io/jackson-core/javadoc/2.2.0/com/fasterxml/jackson/core/JsonFactory.html
-and-
https://fasterxml.github.io/jackson-core/javadoc/2.7/com/fasterxml/jackson/core/JsonFactory.html

You'll notice that requiresPropertyOrdering isn't in 2.2 but is in 2.7. So I'm assuming that somehow you're getting jackson-core 2.2 included in your classpath over 2.7.

Member

huggsboson commented Jun 29, 2016

jackson-core 2.2.x is a transitive dependency of json-schema-validator, though it will probably work fine if you make sure jackson-core-2.7.x gets included due to backwards compatibility.

If you look at:
http://fasterxml.github.io/jackson-core/javadoc/2.2.0/com/fasterxml/jackson/core/JsonFactory.html
-and-
https://fasterxml.github.io/jackson-core/javadoc/2.7/com/fasterxml/jackson/core/JsonFactory.html

You'll notice that requiresPropertyOrdering isn't in 2.2 but is in 2.7. So I'm assuming that somehow you're getting jackson-core 2.2 included in your classpath over 2.7.

@shobr

This comment has been minimized.

Show comment
Hide comment
@shobr

shobr Jun 30, 2016

Thanks @huggsboson
So I changed jackson version from 2.7.4 to 2.2.3 and it works like a charm.

Also, I have another issue with json-schema-validator :
http://stackoverflow.com/questions/38049997/json-schema-validator-not-validating-all-items-of-an-array-but-only-the-first-on

I don't know if I am doing something wrong.

shobr commented Jun 30, 2016

Thanks @huggsboson
So I changed jackson version from 2.7.4 to 2.2.3 and it works like a charm.

Also, I have another issue with json-schema-validator :
http://stackoverflow.com/questions/38049997/json-schema-validator-not-validating-all-items-of-an-array-but-only-the-first-on

I don't know if I am doing something wrong.

@huggsboson

This comment has been minimized.

Show comment
Hide comment
@huggsboson

huggsboson Jun 30, 2016

Member

Did you try the [deepCheck](http://fge.github.io/json-schema-validator/2.2.x/com/github/fge/jsonschema/main/JsonSchema.html#validate%28com.fasterxml.jackson.databind.JsonNode, boolean%29) option? My reading of the docs makes me think it won't help you but it's worth trying. Also you can probably remove a lot of extra nesting in your json's if you were so inclined by using oneOf.

Member

huggsboson commented Jun 30, 2016

Did you try the [deepCheck](http://fge.github.io/json-schema-validator/2.2.x/com/github/fge/jsonschema/main/JsonSchema.html#validate%28com.fasterxml.jackson.databind.JsonNode, boolean%29) option? My reading of the docs makes me think it won't help you but it's worth trying. Also you can probably remove a lot of extra nesting in your json's if you were so inclined by using oneOf.

@shobr

This comment has been minimized.

Show comment
Hide comment
@shobr

shobr Jul 1, 2016

I tried deep check option by setting it to true. Still same problem persists.

shobr commented Jul 1, 2016

I tried deep check option by setting it to true. Still same problem persists.

@huggsboson

This comment has been minimized.

Show comment
Hide comment
@huggsboson

huggsboson Jul 1, 2016

Member

I'll try to check out the code but I'm in the middle of a crunch on a
separate project so probably can't promise a timeline on figuring iy out.
:(.
On Jun 30, 2016 11:01 PM, "shobr" notifications@github.com wrote:

I tried deep check option by setting it to true. Still same problem
persists.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#188 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ADUzzFmXcepDGAwt37khWcHgLHFjlouZks5qRK1SgaJpZM4JA1ES
.

Member

huggsboson commented Jul 1, 2016

I'll try to check out the code but I'm in the middle of a crunch on a
separate project so probably can't promise a timeline on figuring iy out.
:(.
On Jun 30, 2016 11:01 PM, "shobr" notifications@github.com wrote:

I tried deep check option by setting it to true. Still same problem
persists.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#188 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ADUzzFmXcepDGAwt37khWcHgLHFjlouZks5qRK1SgaJpZM4JA1ES
.

@shobr

This comment has been minimized.

Show comment
Hide comment
@shobr

shobr Jul 4, 2016

Hi,
Could you find time to check the code @huggsboson

shobr commented Jul 4, 2016

Hi,
Could you find time to check the code @huggsboson

@xawyong

This comment has been minimized.

Show comment
Hide comment
@xawyong

xawyong Nov 10, 2016

Hi ,can anyone tell me which version of Jackson-core is as a transitive dependency for json-schema-validator-2.2.6-lib ?? thanks

xawyong commented Nov 10, 2016

Hi ,can anyone tell me which version of Jackson-core is as a transitive dependency for json-schema-validator-2.2.6-lib ?? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment