Coder Social home page Coder Social logo

Comments (3)

reaster avatar reaster commented on July 17, 2024

With a few tweaks schema-gen now parses cyclic dependencies properly and XmlSchemaNormalizer is able to traverse the IES schema.

from schema-gen.

ComBatVision avatar ComBatVision commented on July 17, 2024

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.

reaster avatar reaster commented on July 17, 2024

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:

  1. 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') }
  2. Set boolean verbose = true in XmlSchemaNormalizer
  3. 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}")
  4. I believe the type is set in the setElementProperties(element, child) call on line 235 in XmlSchemaNormalizer.
  5. Note also that all root/global types are set and retrieved using schema.putGlobal(qname, type) and schema.getGlobal(qname(name)).
  6. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.