Comments (3)
With a few tweaks schema-gen now parses cyclic dependencies properly and XmlSchemaNormalizer is able to traverse the IES schema.
from schema-gen.
Did you successfully generate IES.xsd?
I have following issue and no output files generated:
Exception in thread "main" java.lang.IllegalStateException: no type for element: Element[Extension 0..2147483647 https://mip-interop.org/data/v4.3/Extension] with parent: ComplexType(false, [], [], true, null, [], [Node(null, , null, [:], false)], false, false, [], false, false, true, true, true, ComplexType[name=ExtensibleType base=null])
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80)
at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:74)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:237)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:249)
at com.javagen.schema.java.JavaGen.visit(JavaGen.groovy:262)
at com.javagen.schema.xml.XmlSchemaVisitor$visit$10.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
at com.javagen.schema.xml.XmlSchemaVisitor$Trait$Helper.visit(XmlSchemaVisitor.groovy:128)
at com.javagen.schema.xml.XmlSchemaVisitor$Trait$Helper$visit$5.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135)
at com.javagen.schema.java.JavaGen.visit(JavaGen.groovy:437)
at com.javagen.schema.xml.XmlSchemaVisitor$visit$9.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
at com.javagen.schema.xml.XmlSchemaVisitor$Trait$Helper.visit(XmlSchemaVisitor.groovy:98)
at com.javagen.schema.xml.XmlSchemaVisitor$Trait$Helper$visit$4.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135)
at com.javagen.schema.java.JavaGen.visit(JavaGen.groovy:297)
at com.javagen.schema.xml.XmlSchemaVisitor$visit$8.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at com.javagen.schema.xml.XmlSchemaVisitor$visit$4.call(Unknown Source)
at com.javagen.schema.xml.XmlSchemaVisitor$Trait$Helper.visit(XmlSchemaVisitor.groovy:37)
at com.javagen.schema.xml.XmlSchemaVisitor$Trait$Helper$visit$2.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135)
at com.javagen.schema.java.JavaGen.visit(JavaGen.groovy:129)
at com.javagen.schema.java.JavaGen$visit$0.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:156)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:168)
at com.javagen.schema.java.JavaGen.gen(JavaGen.groovy:112)
at com.javagen.schema.java.JavaGen$gen.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
at com.javagen.schema.java.JavaGenMain.main(JavaGenMain.groovy:179)
from schema-gen.
I spent some time looking into this bug last night, but couldn't find the cause and I don't have time to track it down right now. The Extension element is assigned a type prior to the exception, but is either corrupted or assigned another Extension instance. If you want to pursue this further, here are my suggestions:
- Comment-out all the other imports in IES.xsd except for AppInfo.xsd and Base.xsd and use local file copies for efficiency in JavaGenMain:
def initIES() { printSchema = true schemaURL = new File('/Users/richard/dev/combat-vision/src/main/resources/IES.xsd').toURI().toURL() srcDir = new File('/Users/richard/dev/combat-vision/src/main/java-gen') }
- Set boolean verbose = true in XmlSchemaNormalizer
- To capture the problem element in the debugger, I'll often insert an if statement, with a println body, so I have someplace to set a breakpoint:
if (name == 'Extension') { println("name=${name}, /ref=${ref}")
- I believe the type is set in the setElementProperties(element, child) call on line 235 in XmlSchemaNormalizer.
- Note also that all root/global types are set and retrieved using
schema.putGlobal(qname, type)
andschema.getGlobal(qname(name))
. - The way circular references are handled is to call indexGlobalNodes(xmlSchema) which just sets up some place-holders before the schema tree is traversed so ref's have something to point to. The way I fixed the last bug was to move this call before the import/include calls. Maybe that introduced a new problem?
Good luck!
from schema-gen.
Related Issues (20)
- Support for multiple xsd HOT 1
- No namespace registered for prefix HOT 4
- [Question]: Run without plugin HOT 2
- Cannot get property 'imports' on null object HOT 3
- Invalid `static` keyword for nested Kotlin classes HOT 1
- When i upgrade the gradle version to 6, below error is coming HOT 1
- NeTEx XSD schema
- fractionDigits facet is not recognized HOT 2
- Invalid enum and variable names
- Unable to execute DartGenMain.groovy HOT 1
- still usable?
- Complex element with choice is not generated correct anymore HOT 1
- No such property: val for class: com.javagen.schema.kotlin.KotlinJacksonCallback HOT 3
- StackOverflowError (no error message): Don't re-load and parse a file previously loaded and parsed. HOT 1
- TODO -> IllegalStateException
- class com.javagen.schema.java.JavaGen, unresolved supertypes: FieldHelper HOT 1
- Bug java 12
- Fix plugin accpect xsd:include
- Sample for Kotlin/JS? HOT 1
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 schema-gen.