FIXTradingCommunity / fix-orchestra

Machine readable rules of engagement
Apache License 2.0
74 stars 34 forks source link

Running Testgen #99

Closed nngakosso closed 4 years ago

nngakosso commented 4 years ago

While I was running testgen I got this error:

C:\Users\nngakosso\Documents\fix-orchestra\testgen\target>java -jar testgen-1.5.0-jar-with-dependencies.jar C:\Users\nngakosso\Documents\fix-orchestra\testgen\target\args[1]\quickfixj/FIX50SP2.xml generated-sources Exception in thread "main" javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"fix"). Expected elements are <{http://purl.org/dc/terms/}abstract>,<{http://purl.org/dc/terms/}accessRights>,<{http://purl.org/dc/terms/}accrualMethod>,<{http://purl.org/dc/terms/}accrualPeriodicity>,<{http://purl.org/dc/terms/}accrualPolicy>,<{http://fixprotocol.io/2020/orchestra/repository}actors>,<{http://purl.org/dc/terms/}alternative>,<{http://purl.org/dc/elements/1.1/}any>,<{http://purl.org/dc/terms/}audience>,<{http://purl.org/dc/terms/}available>,<{http://purl.org/dc/terms/}bibliographicCitation>,<{http://fixprotocol.io/2020/orchestra/repository}categories>,<{http://fixprotocol.io/2020/orchestra/repository}codeSets>,<{http://fixprotocol.io/2020/orchestra/repository}components>,<{http://fixprotocol.io/2020/orchestra/repository}concepts>,<{http://purl.org/dc/terms/}conformsTo>,<{http://purl.org/dc/elements/1.1/}contributor>,<{http://purl.org/dc/terms/}contributor>,<{http://purl.org/dc/elements/1.1/}coverage>,<{http://purl.org/dc/terms/}coverage>,<{http://purl.org/dc/terms/}created>,<{http://purl.org/dc/elements/1.1/}creator>,<{http://purl.org/dc/terms/}creator>,<{http://fixprotocol.io/2020/orchestra/repository}datatype>,<{http://fixprotocol.io/2020/orchestra/repository}datatypes>,<{http://purl.org/dc/elements/1.1/}date>,<{http://purl.org/dc/terms/}date>,<{http://purl.org/dc/terms/}dateAccepted>,<{http://purl.org/dc/terms/}dateCopyrighted>,<{http://purl.org/dc/terms/}dateSubmitted>,<{http://purl.org/dc/elements/1.1/}description>,<{http://purl.org/dc/terms/}description>,<{http://purl.org/dc/terms/}educationLevel>,<{http://purl.org/dc/terms/}extent>,<{http://fixprotocol.io/2020/orchestra/repository}fields>,<{http://purl.org/dc/elements/1.1/}format>,<{http://purl.org/dc/terms/}format>,<{http://fixprotocol.io/2020/orchestra/repository}groups>,<{http://purl.org/dc/terms/}hasFormat>,<{http://purl.org/dc/terms/}hasPart>,<{http://purl.org/dc/terms/}hasVersion>,<{http://purl.org/dc/elements/1.1/}identifier>,<{http://purl.org/dc/terms/}identifier>,<{http://purl.org/dc/terms/}instructionalMethod>,<{http://purl.org/dc/terms/}isFormatOf>,<{http://purl.org/dc/terms/}isPartOf>,<{http://purl.org/dc/terms/}isReferencedBy>,<{http://purl.org/dc/terms/}isReplacedBy>,<{http://purl.org/dc/terms/}isRequiredBy>,<{http://purl.org/dc/terms/}isVersionOf>,<{http://purl.org/dc/terms/}issued>,<{http://purl.org/dc/elements/1.1/}language>,<{http://purl.org/dc/terms/}language>,<{http://purl.org/dc/terms/}license>,<{http://fixprotocol.io/2020/orchestra/repository}mappedDatatype>,<{http://purl.org/dc/terms/}mediator>,<{http://purl.org/dc/terms/}medium>,<{http://fixprotocol.io/2020/orchestra/repository}messages>,<{http://purl.org/dc/terms/}modified>,<{http://purl.org/dc/terms/}provenance>,<{http://purl.org/dc/elements/1.1/}publisher>,<{http://purl.org/dc/terms/}publisher>,<{http://purl.org/dc/terms/}references>,<{http://purl.org/dc/elements/1.1/}relation>,<{http://purl.org/dc/terms/}relation>,<{http://purl.org/dc/terms/}replaces>,<{http://fixprotocol.io/2020/orchestra/repository}repository>,<{http://purl.org/dc/terms/}requires>,<{http://purl.org/dc/elements/1.1/}rights>,<{http://purl.org/dc/terms/}rights>,<{http://purl.org/dc/terms/}rightsHolder>,<{http://fixprotocol.io/2020/orchestra/repository}sections>,<{http://purl.org/dc/elements/1.1/}source>,<{http://purl.org/dc/terms/}source>,<{http://purl.org/dc/terms/}spatial>,<{http://purl.org/dc/elements/1.1/}subject>,<{http://purl.org/dc/terms/}subject>,<{http://purl.org/dc/terms/}tableOfContents>,<{http://purl.org/dc/terms/}temporal>,<{http://purl.org/dc/elements/1.1/}title>,<{http://purl.org/dc/terms/}title>,<{http://purl.org/dc/elements/1.1/}type>,<{http://purl.org/dc/terms/}type>,<{http://purl.org/dc/terms/}valid> at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:726) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:247) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:242) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:109) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1131) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:556) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:538) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:153) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:214) at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157) at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:204) at io.fixprotocol.orchestra.testgen.TestGenerator.unmarshal(TestGenerator.java:268) at io.fixprotocol.orchestra.testgen.TestGenerator.(TestGenerator.java:138) at io.fixprotocol.orchestra.testgen.TestGenerator.main(TestGenerator.java:90)

This while using FIX50SP2.xml file. I tried using others orchestra file but I was just getting a nullPointer error.

Maybe its on the source directory, I used this code:

-jar testgen-1.5.0-jar-with-dependencies.jar C:\Users\nngakosso\Documents\fix-orchestra\testgen\target\args[1]\quickfixj/FIX50SP2.xml generated-sources

donmendelson commented 4 years ago

Please specify git tag or release on all problem reports.

Is args[1] intentional as a directory name? Square brackets are apparently allowed in Windows filenames, but it is unusual.

It looks like you are mixing two different errors. In one the first command line argument is interpreted as null, while in the other file is found but XML parsing fails. Can you verify that the XML file is well formed and conforms to the Orchestra schema?

nngakosso commented 4 years ago

Yes sorry about that. args[1] is the name as it is I didnt do anything.

Yes I made a mistake by copying the first code which was where I forgot the file extension. Just verified the file and it's not actually an Orchestra file my bad but a regular FIX message in XML format.