Comments (16)
Strangely enough, I do use IDEA too (12.0.3) but do not have this problem. Do you use a plugin in particular which makes itself use of Rhino?
Also, I am no expert in Rhino: what do you think is the best way to fix this? You talk about a sealed context and I indeed create one in RhinoHelper
's static initializer which is sealed. Does it work if you remove the ctx.seal(null)
?
My main problem right now is that I cannot reproduce :/
from json-schema-validator.
OK, I have sent a mail to the mozilla-rhino Google group since I don't have the slightest idea on how to solve that problem... And I still cannot reproduce it.
I'll keep you informed.
from json-schema-validator.
I'm sorry, but it seems that it is a problem of my setup. Rhino from validator has clashed with Rhino v1.6R7 from YUI compressor and IDEA preferred the second one.
Following POM reproduces the issue:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>json-validator-test</groupId>
<artifactId>json-validator-test</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.github.fge</groupId>
<artifactId>json-schema-validator</artifactId>
<version>1.6.0</version>
<exclusions>
<exclusion>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.6R7</version>
</dependency>
</dependencies>
</project>
I'm not an expert in Rhino either and I can't advice anything about it but after I removed ctx.seal(null)
everything became fine.
from json-schema-validator.
OK but still, the fact that you found a solution seems to tell that there is something that can be done about it...
I'll try and reproduce it with your sample pom.
from json-schema-validator.
OK, reproduced. I obtain the same stack trace.
Hmm... Now I need to analyze. Thanks a lot for the reproducer!
from json-schema-validator.
Good news: I could reproduce the problem and cure it.
Since in 1.99.x the file has moved (it is now in json-schema-core), I have cured the problem there instead. See:
Can you confirm that it works for you? If it does I'll backport it to 1.6.x and do a 1.6.1.
Original commit:
java-json-tools/json-schema-core@951dd86
from json-schema-validator.
Well, can't say that it completely works on 1.99.10-SNAPSHOT. The validator still crashes with
com.github.fge.jsonschema.exceptions.InvalidSchemaException: invalid schema, cannot continue at com.github.fge.jsonschema.processors.validation.ValidationChain$1.process(ValidationChain.java:83) at com.github.fge.jsonschema.processors.validation.ValidationChain$1.process(ValidationChain.java:75) at com.github.fge.jsonschema.processing.ProcessorSelector$Chooser.process(ProcessorSelector.java:100) at com.github.fge.jsonschema.processing.ProcessorChain$ProcessorMerger.process(ProcessorChain.java:135) at com.github.fge.jsonschema.processors.validation.ValidationChain.process(ValidationChain.java:69) at com.github.fge.jsonschema.processors.validation.ValidationChain.process(ValidationChain.java:37) at com.github.fge.jsonschema.processing.ProcessorSelector$Chooser.process(ProcessorSelector.java:100) at com.github.fge.jsonschema.processing.ProcessorChain$ProcessorMerger.process(ProcessorChain.java:135) at com.github.fge.jsonschema.processors.validation.ValidationProcessor$3.load(ValidationProcessor.java:209) at com.github.fge.jsonschema.processors.validation.ValidationProcessor$3.load(ValidationProcessor.java:202) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3579) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2372) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2335) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2250) at com.google.common.cache.LocalCache.get(LocalCache.java:3980) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3984) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4868) at com.github.fge.jsonschema.processing.ProcessingCache.get(ProcessingCache.java:44) at com.github.fge.jsonschema.processors.validation.ValidationProcessor.process(ValidationProcessor.java:78) at com.github.fge.jsonschema.main.JsonValidator.doValidate(JsonValidator.java:79) at com.github.fge.jsonschema.main.JsonValidator.validate(JsonValidator.java:87)
Which is strange because the same schema is valid for 1.6. But it is completely another problem I hope, so I could say that fix helped :) Please backport it.
from json-schema-validator.
Hmm, care to show the schema?
from json-schema-validator.
OK, 1.6.1 has been put on maven with the fix.
Now, on to the 1.99.x problem, do you reproduce it on the site too (http://json-schema-validator.herokuapp.com)?
from json-schema-validator.
OK, I have a suspiscion: your schema is written for draft v3, right?
1.99.x (and 2.0.x will) default to draft v4.
from json-schema-validator.
Sorry, the schema is pretty complex with lots of references so I can't just copy it into your site. And right, it is written for v3
from json-schema-validator.
BTW thanks for a rapid fix!
from json-schema-validator.
No problem :)
Will you let me know when you have grabbed 1.6.1 so that I can close the issue?
from json-schema-validator.
Yeap, done it already, everything is perfetct
from json-schema-validator.
Hi, I'm getting below error when trying to validate my schema and json
com.github.fge.jsonschema.exceptions.InvalidSchemaException: invalid schema, cannot continue
at com.github.fge.jsonschema.processors.validation.ValidationChain$1.doException(ValidationChain.java:68)
at com.github.fge.jsonschema.report.ProcessingMessage.asException(ProcessingMessage.java:292)
at com.github.fge.jsonschema.processing.ProcessorChain$1.process(ProcessorChain.java:133)
at com.github.fge.jsonschema.processing.ProcessorChain$ProcessorMerger.process(ProcessorChain.java:187)
at com.github.fge.jsonschema.processing.ProcessingResult.of(ProcessingResult.java:79)
at com.github.fge.jsonschema.processing.CachingProcessor$1.load(CachingProcessor.java:110)
at com.github.fge.jsonschema.processing.CachingProcessor$1.load(CachingProcessor.java:102)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
at com.google.common.cache.LocalCache.get(LocalCache.java:3932)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806)
My schema is using enum and patterns, how to deal with it.
from json-schema-validator.
@devorbh it looks like your schema was invalidly specified. Any chance you can paste that here?
from json-schema-validator.
Related Issues (20)
- Failed validation for no apparent reason?
- Getting java.util.concurrent.ExecutionException while validating
- Error when validating Json against a schema defining oneOf
- Are we planning on supporting draft-07 HOT 1
- Example code on README.md please plus links to examples in src
- Migrate from joda-time to java 8 time API HOT 2
- Improcess error hanling in getJsonSchema - never squash exceptions
- Android app crashes because schema (v4) cannot be found at runtime HOT 2
- Getting NPE when passing null to validate method.
- Has the functionality of the ResolvingSchemaWalker been replaced in more recent versions?
- Conflicting Transitive Dependency Versions for Guava and Jsr305
- Where is pom.xml ? I want to import this library to my local and customize it
- Not compatible with GraalVM
- NoSuchFieldError on signing
- When JSONObject contains JSONArray, JSONArray's object can not be validated
- draftv4/schema is different between json-schema-validator 2.2.14 and json-schema-core 1.2.14 HOT 2
- release new version HOT 2
- How can we get Error Message with the error path appended?
- Obtain JUST the message from a ValidationMessage?
- BUG: ECMA262 valid pattern throws an exception
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-schema-validator.