Run-time error with MaturityMonthYear (200)

Imported from previous forum

[ original email was from Adam Marzi - adam_marzi@cargill.com ]
Hi,

I am experiencing a very strange run-time error and am looking for some help or insight.

I have a Java application that produces FIXML from a Quickfix message. I used Castor to bind the 4.4 FIXML Schema into Java classes. When creating an Execution Report, everything works fine except for MaturityMonthYear. No matter what value I set it to, a run-time error occurs during the Marshalling call. If I comment out the set method for MMY, the error goes away, which tells me this error is unique to MMY. Also, the errors that are thrown are not caught by my try-catch. I have included sample code and the error message below.

Thanks in advance for your help!

Adam

public String FIXtoFIXML(quickfix.fix44.ExecutionReport fixExecRpt){

	// Create new FIXML Execution Report
	fixmlschema.ExecRpt fixmlExecRpt = new ExecRpt();

	// Create Instrument, a component block within 				// Execution Report
	fixmlschema.Instrmt instrmt = new Instrmt();

	try
	{

		.
		.
		.


		instrmt.setMMY("200512");

		execRptElements.setInstrmt(instrmt);

		.
		.
		.

		// Marshall the fixml message 
		// from memory to writer.
		Marshaller.marshal(fixmlExecRpt, writer);
		/*THIS IS WHERE THE RUN-TIME 
		* ERROR HAPPENS.  IF I 
		* COMMENT OUT instrmt.setMMY()
		* THEN THE MARSHALL OCCURRS 
		* WITHOUT ERRORS. */


	catch(Exception e)
	{
		System.out.println(e);
		System.exit(1);
	}


	return writer.toString();

}

THE RESULTING ERROR(s):

java.lang.NoClassDefFoundError: org/apache/oro/text/regex/MalformedPatternException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at org.exolab.castor.util.LocalConfiguration.getRegExpEvaluator(LocalConfiguration.java:500)
at org.exolab.castor.xml.validators.PatternValidator.initEvaluator(PatternValidator.java:164)
at org.exolab.castor.xml.validators.PatternValidator.validate(PatternValidator.java:135)
at org.exolab.castor.xml.validators.StringValidator.validate(StringValidator.java:257)
at org.exolab.castor.xml.validators.StringValidator.validate(StringValidator.java:291)
at org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:256)
at org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescriptorImpl.java:898)
at org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescriptorImpl.java:760)
at org.exolab.castor.xml.Validator.validate(Validator.java:122)
at org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:258)
at org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescriptorImpl.java:892)
at org.exolab.castor.xml.Validator.validate(Validator.java:122)
at org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:258)
at org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescriptorImpl.java:892)
at org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassDescriptorImpl.java:760)
at org.exolab.castor.xml.Validator.validate(Validator.java:122)
at org.exolab.castor.xml.Marshaller.validate(Marshaller.java:2068)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:774)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:674)
at FIXMLGenerator.FIXML.FIXtoFIXML(FIXML.java:357)

Castor is requiring the oro.jar from Jakarta ORO - Jakarta ORO
to be in your classpath

The FIXML schema uses a regular expression for formatting the MMY

Hi,

I am experiencing a very strange run-time error and am looking for some
help or insight.

I have a Java application that produces FIXML from a Quickfix message. I
used Castor to bind the 4.4 FIXML Schema into Java classes. When
creating an Execution Report, everything works fine except for
MaturityMonthYear. No matter what value I set it to, a run-time error
occurs during the Marshalling call. If I comment out the set method for
MMY, the error goes away, which tells me this error is unique to MMY.
Also, the errors that are thrown are not caught by my try-catch. I have
included sample code and the error message below.

Thanks in advance for your help!

Adam

public String FIXtoFIXML(quickfix.fix44.ExecutionReport fixExecRpt){

            // Create new FIXML Execution Report fixmlschema.ExecRpt
            fixmlExecRpt = new ExecRpt();

            // Create Instrument, a component block within //
            Execution Report fixmlschema.Instrmt instrmt = new
            Instrmt();

            try {

                    . . .


                    instrmt.setMMY("200512");

                    execRptElements.setInstrmt(instrmt);

                    . . .

                    // Marshall the fixml message // from memory to
                    writer. Marshaller.marshal(fixmlExecRpt,
                    writer); /*THIS IS WHERE THE RUN-TIME
                    * ERROR HAPPENS. IF I
                    * COMMENT OUT instrmt.setMMY()
                    * THEN THE MARSHALL OCCURRS
                    * WITHOUT ERRORS. */


            catch(Exception e) { System.out.println(e);
            System.exit(1); }


            return writer.toString();

}

THE RESULTING ERROR(s):

java.lang.NoClassDefFoundError:
org/apache/oro/text/regex/MalformedPatternException at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:141) at org.exolab.castor.util.Local-
Configuration.getRegExpEvaluator(LocalConfiguration.java:500) at org.ex-
olab.castor.xml.validators.PatternValidator.initEvaluator(PatternValida-
tor.java:164) at org.exolab.castor.xml.validators.PatternValidator.vali-
date(PatternValidator.java:135) at org.exolab.castor.xml.validators.Str-
ingValidator.validate(StringValidator.java:257) at org.exolab.castor.xm-
l.validators.StringValidator.validate(StringValidator.java:291) at
org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:256)
at org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassD-
escriptorImpl.java:898) at org.exolab.castor.xml.util.XMLClassDescripto-
rImpl.validate(XMLClassDescriptorImpl.java:760) at
org.exolab.castor.xml.Validator.validate(Validator.java:122) at
org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:258)
at org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassD-
escriptorImpl.java:892) at
org.exolab.castor.xml.Validator.validate(Validator.java:122) at
org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:258)
at org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassD-
escriptorImpl.java:892) at org.exolab.castor.xml.util.XMLClassDescripto-
rImpl.validate(XMLClassDescriptorImpl.java:760) at
org.exolab.castor.xml.Validator.validate(Validator.java:122) at
org.exolab.castor.xml.Marshaller.validate(Marshaller.java:2068) at
org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:774) at
org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:674) at
FIXMLGenerator.FIXML.FIXtoFIXML(FIXML.java:357)

[ original email was from Adam Marzi - adam_marzi@cargill.com ]

Thanks Neil and Prajod for your help on this one. It was much easier than I originally thought.

To resolve, I just had to add the “Cocoon” library to my JBuilder project.

Thanks again,
Adam

Hi,

I am experiencing a very strange run-time error and am looking for some
help or insight.

I have a Java application that produces FIXML from a Quickfix message. I
used Castor to bind the 4.4 FIXML Schema into Java classes. When
creating an Execution Report, everything works fine except for
MaturityMonthYear. No matter what value I set it to, a run-time error
occurs during the Marshalling call. If I comment out the set method for
MMY, the error goes away, which tells me this error is unique to MMY.
Also, the errors that are thrown are not caught by my try-catch. I have
included sample code and the error message below.

Thanks in advance for your help!

Adam

public String FIXtoFIXML(quickfix.fix44.ExecutionReport fixExecRpt){

            // Create new FIXML Execution Report fixmlschema.ExecRpt
            fixmlExecRpt = new ExecRpt();

            // Create Instrument, a component block within //
            Execution Report fixmlschema.Instrmt instrmt = new
            Instrmt();

            try {

                    . . .


                    instrmt.setMMY("200512");

                    execRptElements.setInstrmt(instrmt);

                    . . .

                    // Marshall the fixml message // from memory to
                    writer. Marshaller.marshal(fixmlExecRpt,
                    writer); /*THIS IS WHERE THE RUN-TIME
                    * ERROR HAPPENS. IF I
                    * COMMENT OUT instrmt.setMMY()
                    * THEN THE MARSHALL OCCURRS
                    * WITHOUT ERRORS. */


            catch(Exception e) { System.out.println(e);
            System.exit(1); }


            return writer.toString();

}

THE RESULTING ERROR(s):

java.lang.NoClassDefFoundError:
org/apache/oro/text/regex/MalformedPatternException at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:141) at org.exolab.castor.util.Local-
Configuration.getRegExpEvaluator(LocalConfiguration.java:500) at org.ex-
olab.castor.xml.validators.PatternValidator.initEvaluator(PatternValida-
tor.java:164) at org.exolab.castor.xml.validators.PatternValidator.vali-
date(PatternValidator.java:135) at org.exolab.castor.xml.validators.Str-
ingValidator.validate(StringValidator.java:257) at org.exolab.castor.xm-
l.validators.StringValidator.validate(StringValidator.java:291) at
org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:256)
at org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassD-
escriptorImpl.java:898) at org.exolab.castor.xml.util.XMLClassDescripto-
rImpl.validate(XMLClassDescriptorImpl.java:760) at
org.exolab.castor.xml.Validator.validate(Validator.java:122) at
org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:258)
at org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassD-
escriptorImpl.java:892) at
org.exolab.castor.xml.Validator.validate(Validator.java:122) at
org.exolab.castor.xml.FieldValidator.validate(FieldValidator.java:258)
at org.exolab.castor.xml.util.XMLClassDescriptorImpl.validate(XMLClassD-
escriptorImpl.java:892) at org.exolab.castor.xml.util.XMLClassDescripto-
rImpl.validate(XMLClassDescriptorImpl.java:760) at
org.exolab.castor.xml.Validator.validate(Validator.java:122) at
org.exolab.castor.xml.Marshaller.validate(Marshaller.java:2068) at
org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:774) at
org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:674) at
FIXMLGenerator.FIXML.FIXtoFIXML(FIXML.java:357)