real-logic / simple-binary-encoding

Simple Binary Encoding (SBE) - High Performance Message Codec
Apache License 2.0
3.08k stars 519 forks source link

C++ - Failing to generate Codecs for CME template_FIXBinary.xml #123

Closed aasaimuthu closed 10 years ago

aasaimuthu commented 10 years ago

Hi, When we try to compile this latest CME templates_FixBinary.xml library provided by the link ftp://ftp.cmegroup.com/SBEFix/NRCert/Templates/templates_FIXBinary.xml (CME ftp site can be accessible by everyone)

java -jar -Dsbe.target.language=cpp98 target/dist/sbe.jar templates_FixBinary.xml

we are getting the following error, please advise

Exception in thread "main" java.lang.NullPointerException: schemaIdType must not be null at uk.co.real_logic.sbe.util.Verify.notNull(Verify.java:35) at uk.co.real_logic.sbe.ir.HeaderStructure.(HeaderStructure.java:48) at uk.co.real_logic.sbe.ir.Ir.(Ir.java:61) at uk.co.real_logic.sbe.xml.IrGenerator.generate(IrGenerator.java:47) at uk.co.real_logic.sbe.SbeTool.main(SbeTool.java:104)

Thanks & Regards, Aasai

mjpt777 commented 10 years ago

This suggests the schemaId attribute has not been set on the messageSchema tag. I'd guess the CME have not updated their templates to support SBE RC2 as yet.

mjpt777 commented 10 years ago

I recommend you run SbeTool with schema validation turned on and use the following XSD.

sbe.validation.xsd

https://github.com/real-logic/simple-binary-encoding/blob/master/main/resources/fpl/SimpleBinary1-0.xsd

aasaimuthu commented 10 years ago

Hi, Still i am getting the same error with using this option sbe.validation.xsd, Please check am i using the correct in the option field?

java -jar -Dsbe.target.language=cpp98 -Dsbe.validation.xsd=SimpleBinary1-0.xsd target/dist/sbe.jar templates_FixBinary.xml

[Error] :2:340: cvc-elt.1: Cannot find the declaration of element 'ns2:messageSchema'. Exception in thread "main" java.lang.IllegalStateException: Element 'ns2:messageSchema' has empty or missing attribute: id at uk.co.real_logic.sbe.xml.XmlSchemaParser.getAttributeValue(XmlSchemaParser.java:233) at uk.co.real_logic.sbe.xml.MessageSchema.(MessageSchema.java:52) at uk.co.real_logic.sbe.xml.XmlSchemaParser.parse(XmlSchemaParser.java:90) at uk.co.real_logic.sbe.SbeTool.parseSchema(SbeTool.java:155) at uk.co.real_logic.sbe.SbeTool.main(SbeTool.java:104)

aasaimuthu commented 10 years ago

Hi, Do you have any other opern source or tool which we can use to generate Codecs for CME template_FIXBinary.xml

Thanks & Regards, Aasai

mjpt777 commented 10 years ago

The problem is the CME templates need to be updated to reflect SBE 1.0 RC2. Please contact the CME.

aasaimuthu commented 10 years ago

Hi, Is there anyway to disable this particular error at time being and then we can generate the codecs messages.

Thanks & Regards, Aasai

mjpt777 commented 10 years ago

Sorry but that is a required field.

You could modify the templates and add the field to the XML? Any positive integer should suffice.

aasaimuthu commented 10 years ago

Hi, I just tried with this id="1" in the templates_FixBinary.xml now i got this error, Exception in thread "main" java.lang.NullPointerException: schemaIdType must not be null at uk.co.real_logic.sbe.util.Verify.notNull(Verify.java:35) at uk.co.real_logic.sbe.ir.HeaderStructure.(HeaderStructure.java:48) at uk.co.real_logic.sbe.ir.Ir.(Ir.java:61) at uk.co.real_logic.sbe.xml.IrGenerator.generate(IrGenerator.java:47) at uk.co.real_logic.sbe.SbeTool.main(SbeTool.java:104)

if possible could you please update the required field in this templates_FixBinary.xml and give it to me then i will try, because i tried with many possibility no luck. ftp://ftp.cmegroup.com/SBEFix/NRCert/Templates/templates_FIXBinary.xml

Thanks & Regards, Aasai

mjpt777 commented 10 years ago

The messageHeader composite type must have the following format.

    <composite name="messageHeader" description="Message identifiers and length of message root">
        <type name="blockLength" primitiveType="uint16"/>
        <type name="templateId" primitiveType="uint16"/>
        <type name="schemaId" primitiveType="uint16"/>
        <type name="version" primitiveType="uint16"/>
    </composite>
donmendelson commented 10 years ago

The next update of templates by CME is planned for early May. It will conform to the SBE RC2 standard.