You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Paul Cooper <pc...@emspic.org> on 2010/09/24 03:58:56 UTC

Error compiling schema

Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
Time to build schema type system: 2.124 seconds
Time to generate code: 4.917 seconds
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web...a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

Any help would be HUGELY appreciated.

Paul Cooper
Project Manager
EMS Performance Improvement Center
100 Market Street
Chapel Hill, NC  27516
(919) 843-0201

RE: Error compiling schema

Posted by Wing Yew Poon <wi...@oracle.com>.
Paul Gillen,
thank you for the report.
Please file a bug in JIRA against XMLBeans 2.5.0 for this compilation problem.
- Wing Yew
 
If you like, you can also file a bug for the fact that http://xmlbeans.apache.org/sourceAndBinaries/ needs to be updated with the current release. The home page http://xmlbeans.apache.org/ does show
 

New Release: Apache XMLBeans 2.5.0 (December 14, 2009)



  _____  

From: Gillen, Paul [mailto:paul.gillen@nscorp.com] 
Sent: Friday, September 24, 2010 12:19 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema



Different Paul here, but this looked interesting.

 

Presuming from original report this that is EMSDataSet.xsd and related XSDs available from http://www.nemsis.org/softwaredevelopers/downloads/emsDataset.html, and presuming I understand the problem report correctly.

 

Using downloaded binaries XMLBeans 2.3 and 2.4 compile cleanly.  XMLBeans 2.5 (which despite what is noted below is not listed as the current release on http://xmlbeans.apache.org/sourceAndBinaries/) generates:

 

C:\development\downloads>C:\development\xmlbeans-2.5.0\bin\scomp xsd\EMSDataSet.xsd -out lib\EMSDataSet.jar

Time to build schema type system: 2.652 seconds

Time to generate code: 21.917 seconds

C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml

.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml

.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xm

l.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

4 errors

 

BUILD FAILED

  _____  

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
Sent: Friday, September 24, 2010 3:00 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

 

The code to set the E19_03 element value is simple:

procInfo.setE1903(proc.getProcedurePerformed().getCode());

 

Paul,

you might try to print out what you are actually setting E19_03 to (what is the value of proc.getProcedurePerformed().getCode()?).

And how did that code get set in the ProcedurePerformed object?

What I'm getting at is that you should try to trace where your "89" first appeared in your system. Did it come from XMLBeans or did it come from some input to XMLBeans?

- Wing Yew

 

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Friday, September 24, 2010 12:04 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Wing Yew,

 

Thanks for the response. I have no idea what version of XMLBeans we *were* using..I downloaded it and built our schema jar in March of 2006. We did not find this error until we started attempting to export data earlier this year. And yes, the version I'm using now is built from the latest code checked out from the repository.

 

Here's the section of the schema in question:

HYPERLINK "http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd"- <  <xs:element name="E19_03" type="Procedure">

HYPERLINK "http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd"- <       <xs:annotation>

  <             <xs:documentation>The procedure performed on the patient</xs:documentation> 

 </xs:annotation>

  </xs:element>

 

Here's the definition of the "Procedure" type:

<xs:simpleType name="Procedure">

<xs:annotation>

<xs:documentation>The procedure performed on the patient</xs:documentation> 

</xs:annotation>

<xs:union memberTypes="ProcedureCPTCode NullValues" /> 

</xs:simpleType>

 

And here's the definition of the "ProcedureCPTCode" referenced above (this is a subset, it's a long list; these are EMS procedure codes):

<xs:simpleType name="ProcedureCPTCode">

<xs:restriction base="xs:decimal">

<xs:enumeration value="89.391">

<xs:annotation>

<xs:documentation>Capnography (CO2 Measurement)</xs:documentation> 

</xs:annotation>

</xs:enumeration>

<xs:enumeration value="89.392">

<xs:annotation>

<xs:documentation>Pulse Oximetry</xs:documentation> 

</xs:annotation>

</xs:enumeration>

<xs:enumeration value="89.510">

<xs:annotation>

<xs:documentation>Cardiac Monitor</xs:documentation> 

</xs:annotation>

</xs:enumeration>

</xs:restriction>

</xs:simpleType>

 

The code to set the E19_03 element value is simple:

procInfo.setE1903(proc.getProcedurePerformed().getCode());

 

And the method getCode() is defined:

private BigDecimal myCode;

public void setCode(BigDecimal code) {

myCode = code;

}

public BigDecimal getCode() {

return myCode;

}

 

You are correct about the bug we are seeing: we are setting the value to 89.51 but the XML output is 89. The XML in my last email was copied directly from the XMLBeans output file. And yes, now that I look at it, 89.51 will not equal 89.510, but that's a problem for another day.

 

I just found the email my co-worker sent just before he left, and it turns out he was referencing the same bug I referenced below, so there is a high probability that he had no idea what he was talking about. Nonetheless, we are clearly having a problem.

 

Paul

 

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
Sent: Thursday, September 23, 2010 10:26 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

 

Paul,

you'll have to explain a bit more what the bug is.

Can you excerpt the part of your schema that defines the type of the E19_03 element?

Also, how is the value of the element set?

Is the bug that you're setting E19_03 to 89.51 but when the XMLObject marshalled, you get 89 in E19_03?

 

What version of XMLBeans are you using? Am I correct in my understanding that you were using 2.5 and seeing a bug consistently, and then you switched to using XMLBeans built from the latest in the svn trunk and now see the bug intermittently?

There haven't been that many code checkins since 2.5 was released. How did your co-worker know that the bug was "fixed in the source but NOT fixed in version 2.5" (meaning fixed after 2.5?)?

 

- Wing Yew

 

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Thursday, September 23, 2010 7:20 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Wow, I was hoping someone on the list would instantly know what I was talking about.   J

 

We are building an XML file from Oracle data. Periodically we get the following error when validating the XML:

 

W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

 

Here is the section of the XML that is in question:

 

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>

 

As you see above, there are two E19_01_0 sections, one has a E19_03 value of 89.392, and the other has the value of 89. Unfortunately, the second value SHOULD be 89.51. My cow-orker (who has since left the company) indicated that this was a known problem with the version of XMLBeans we were using, and had been fixed in the source but NOT fixed in version 2.5..we'd have to download the source and build it ourselves. Prior to building and deploying the most recent source, we were having this truncation problem on every one of these records. Now, we get it randomly.

 

Thanks for the quick response!

 

Paul

 

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
Sent: Thursday, September 23, 2010 7:07 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

 

Paul,

what is this BigDecimal truncation bug that you speak of?

- Wing Yew

 

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema

Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

 

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

 

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd

Time to build schema type system: 2.124 seconds

Time to generate code: 4.917 seconds

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

4 errors

 

BUILD FAILED

 

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

 

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web.a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

 

Any help would be HUGELY appreciated.

 

Paul Cooper

Project Manager

EMS Performance Improvement Center

100 Market Street

Chapel Hill, NC  27516

(919) 843-0201

RE: Error compiling schema

Posted by Wing Yew Poon <wi...@oracle.com>.
I have committed a change to the XMLBeans trunk with the fix for XMLBEANS-396 as suggested by the original reporter, Chris Clark. The earlier change committed by Cezar Andrei as a fix for this issue was evidently incorrect.
If you should wish to use the latest XMLBeans, the compilation errors for the EMSDataSet.xsd schema should not occur anymore.
 
Paul Cooper, if you could put together a reproducer for the BigDecimal truncation issue you are seeing (xml schema - the EMSDataSet.xsd would be fine - and test program that only depends on XMLBeans and compiling the schema) and open a JIRA issue for it, that would be very helpful.
 
Thanks,
Wing Yew

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Monday, September 27, 2010 3:50 PM
To: user@xmlbeans.apache.org; paul.d.gillen@gmail.com
Subject: RE: Error compiling schema



All,

 

Results of my test using code provided by Paul[1] below.

 

Code snippet:

Procedure xmlProc = Procedure.Factory.newInstance();

xmlProc.setStringValue(proc.getProcedurePerformed().getCode().toString());

procInfo.xsetE1903(xmlProc);

 

Logging output from my server:

Sep 27 2010 12:38 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 27 2010 12:38 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:15:00.0

Sep 27 2010 12:38 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 27 2010 12:38 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392

Sep 27 2010 12:38 | DEBUG  | AbstractXmlBuilder | XML to this point:

<E19_01_0 xmlns="http://www.nemsis.org">

  <E19_01>2010-08-23T17:15:00.000Z</E19_01>

  <E19_02>0</E19_02>

  <E19_03>89.392</E19_03>

</E19_01_0>

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:16:00.0

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | XML to this point:

<xml-fragment xmlns:nem="http://www.nemsis.org">

  <nem:E19_01_0>

    <nem:E19_01>2010-08-23T17:15:00.000Z</nem:E19_01>

    <nem:E19_02>0</nem:E19_02>

    <nem:E19_03>89.392</nem:E19_03>

    <nem:E19_05>1</nem:E19_05>

    <nem:E19_06>1</nem:E19_06>

    <nem:E19_07>4500</nem:E19_07>

    <nem:E19_08>4605</nem:E19_08>

    <nem:E19_09>SC008406</nem:E19_09>

    <nem:E19_10>4625</nem:E19_10>

    <nem:E19_11>-15</nem:E19_11>

  </nem:E19_01_0>

  <nem:E19_01_0>

    <nem:E19_01>2010-08-23T17:16:00.000Z</nem:E19_01>

    <nem:E19_02>0</nem:E19_02>

    <nem:E19_03>89.51</nem:E19_03>

 </nem:E19_01_0>

</xml-fragment>

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

 

E19 snippet from final XML document:

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.51</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>

 

So, using the code provided by Paul[1] and using BigDecimal.toString() gives me the correct output.

 

Now, just for grins, I made a slight change to my original code, getting the code value from my bean and creating a new BigDecimal from that:

procInfo.setE1903(new BigDecimal(proc.getProcedurePerformed().getCode().toString()));

LOGGER.debug("Added E1903:" + proc.getProcedurePerformed().getCode());

LOGGER.debug("XML to this point:" + e19.toString());

 

Predictably, the code failed, and it failed immediately, as the E19.toString() generated the incorrect 89 value:

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:15:00.0

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | XML to this point:

<E19_01_0 xmlns="http://www.nemsis.org">

  <E19_01>2010-08-23T17:15:00.000Z</E19_01>

  <E19_02>0</E19_02>

  <E19_03>89.392</E19_03>

</E19_01_0>

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 27 2010 15:42 | DEBUG  | IdleRemover | run: IdleRemover notifying pools, interval: 450000

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:16:00.0

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51

Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | XML to this point:

<xml-fragment xmlns:nem="http://www.nemsis.org">

  <nem:E19_01_0>

    <nem:E19_01>2010-08-23T17:15:00.000Z</nem:E19_01>

    <nem:E19_02>0</nem:E19_02>

    <nem:E19_03>89.392</nem:E19_03>

    <nem:E19_05>1</nem:E19_05>

    <nem:E19_06>1</nem:E19_06>

    <nem:E19_07>4500</nem:E19_07>

    <nem:E19_08>4605</nem:E19_08>

    <nem:E19_09>SC008406</nem:E19_09>

    <nem:E19_10>4625</nem:E19_10>

    <nem:E19_11>-15</nem:E19_11>

  </nem:E19_01_0>

  <nem:E19_01_0>

    <nem:E19_01>2010-08-23T17:16:00.000Z</nem:E19_01>

    <nem:E19_02>0</nem:E19_02>

    <nem:E19_03>89</nem:E19_03>

  </nem:E19_01_0>

</xml-fragment>

 

I would suggest that there seems to be a bug in the marshaling code of the BigDecimal. I have done a bit of homework on how many of these we get, and we do get a fair amount of them, and there is no particular value that the problem seems to happen with.

 

Paul[0]

 

 

From: pgillen [mailto:paul.d.gillen@gmail.com] 
Sent: Monday, September 27, 2010 10:41 AM
To: user@xmlbeans.apache.org
Subject: Re: Error compiling schema

 

The Procedure seemed to be an essential step. -p2-

---------
Paul Gillen

  _____  

From: Paul Cooper <pc...@emspic.org> 

Date: Mon, 27 Sep 2010 13:29:34 -0400

To: user@xmlbeans.apache.org<us...@xmlbeans.apache.org>

ReplyTo: user@xmlbeans.apache.org 

Subject: RE: Error compiling schema

 

Paul,

 

You're suggesting doing a toString() on the BigDecimal? Hadn't tried that..let me test, I'll report back.

 

Paul

 

From: Gillen, Paul [mailto:paul.gillen@nscorp.com] 
Sent: Monday, September 27, 2010 10:23 AM
To: 'user@xmlbeans.apache.org'
Subject: RE: Error compiling schema

 

This do it?  (in terms of solving your problem, not fixing XMLBeans should there be a problem there)

 

I _hate_ BigDecimal.

 

= Paul[1] =

  _____  

    throws Exception

    {

        EMSDataSetDocument  emsDoc          = EMSDataSetDocument.Factory.newInstance();

        

        EMSDataSet          emsDs           = emsDoc.addNewEMSDataSet();

        Header              hdr             = emsDs.addNewHeader();

        Record              rec1            = hdr.addNewRecord();

        E19                 rec1_e19        = rec1.addNewE19();

                

        E19010              rec1_e19010a    = rec1_e19.addNewE19010();

        Procedure           p1              = Procedure.Factory.newInstance();

        p1.setStringValue("1.1234");

        rec1_e19010a.xsetE1903(p1);

        

        E19010              rec1_e19010b    = rec1_e19.addNewE19010();

        Procedure           p2              = Procedure.Factory.newInstance();

        p2.setStringValue("2.2468");

        rec1_e19010b.xsetE1903(p2);

        

        System.out.println(emsDoc.toString());

    }

 

<EMSDataSet xmlns="http://www.nemsis.org">

  <Header>

    <Record>

      <E19>

        <E19_01_0>

          <E19_03>1.1234</E19_03>

        </E19_01_0>

        <E19_01_0>

          <E19_03>2.2468</E19_03>

        </E19_01_0>

      </E19>

    </Record>

  </Header>

</EMSDataSet>

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Monday, September 27, 2010 11:24 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

 

Tim,

 

Your understanding of the problem is correct. This is a repeatable problem. The values being logged are coming directly from the bean's getters, so the value is correct when being added to the XML. And yes, the problem always occurs at the decimal. Interestingly, it seems to happen the SECOND time the E19 element is created.

 

I'll log the XML (it's a pretty big file, hopefully I can log sections) and see what happens.

 

I'll also try to find another PCR with multiple E19 elements.

 

Paul

 

From: Tim Watts [mailto:tim@cliftonfarm.org] 
Sent: Saturday, September 25, 2010 10:14 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

 

Not exactly sure what's happening here in terms of procedure. My guess is that AbstractXmlBuilder (superclass of XmlPrcBuilder?) is calling setters/"adders" on the target XmlBean and that XmlPcrBuilder is then calling bean.validate(). Is that right?

Can you repeat the problem at will or is it still a random thing?

Also, when the values are logged are they obtained using the bean's getters or are you logging the original value that the builder receives? If the latter, it might shed some light to log the values obtained from the getters as well.

Just for grins & giggles, what if you logged the XML after each set/add. Might shed some light on the point at which 89.51 becomes 89.

I'm also curious to know whether the truncation always occurs exactly at the decimal point?


On Sat, 2010-09-25 at 23:29 -0400, Paul Cooper wrote:
All,

 

I've successfully rebuilt my library with the 2.4 version of XMLBeans, and have successfully replicated the problem with BigDecimals with that version.

 

Here is the logging from my server:

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:15:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:16:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>> FAILED validation:  5329436

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder | Message: W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>>

 

And here is the XML output. Clearly there is an issue:

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>

 

Paul

 

RE: Error compiling schema

Posted by Paul Cooper <pc...@emspic.org>.
All,

Results of my test using code provided by Paul[1] below.

Code snippet:
Procedure xmlProc = Procedure.Factory.newInstance();
xmlProc.setStringValue(proc.getProcedurePerformed().getCode().toString());
procInfo.xsetE1903(xmlProc);

Logging output from my server:
Sep 27 2010 12:38 | DEBUG  | AbstractXmlBuilder | Created new E19010
Sep 27 2010 12:38 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:15:00.0
Sep 27 2010 12:38 | DEBUG  | AbstractXmlBuilder | Added E1902:0
Sep 27 2010 12:38 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392
Sep 27 2010 12:38 | DEBUG  | AbstractXmlBuilder | XML to this point:
<E19_01_0 xmlns="http://www.nemsis.org">
  <E19_01>2010-08-23T17:15:00.000Z</E19_01>
  <E19_02>0</E19_02>
  <E19_03>89.392</E19_03>
</E19_01_0>
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1905:1
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1906:1
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1907:4500
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1908:4605
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1910:4625
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1911:-15
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Created new E19010
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:16:00.0
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1902:0
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | XML to this point:
<xml-fragment xmlns:nem="http://www.nemsis.org">
  <nem:E19_01_0>
    <nem:E19_01>2010-08-23T17:15:00.000Z</nem:E19_01>
    <nem:E19_02>0</nem:E19_02>
    <nem:E19_03>89.392</nem:E19_03>
    <nem:E19_05>1</nem:E19_05>
    <nem:E19_06>1</nem:E19_06>
    <nem:E19_07>4500</nem:E19_07>
    <nem:E19_08>4605</nem:E19_08>
    <nem:E19_09>SC008406</nem:E19_09>
    <nem:E19_10>4625</nem:E19_10>
    <nem:E19_11>-15</nem:E19_11>
  </nem:E19_01_0>
  <nem:E19_01_0>
    <nem:E19_01>2010-08-23T17:16:00.000Z</nem:E19_01>
    <nem:E19_02>0</nem:E19_02>
    <nem:E19_03>89.51</nem:E19_03>
 </nem:E19_01_0>
</xml-fragment>
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1905:1
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1906:1
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1907:4500
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1908:4605
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406
Sep 27 2010 12:39 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

E19 snippet from final XML document:
      <E19>
        <E19_01_0>
          <E19_01>2010-08-23T17:15:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89.392</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
        <E19_01_0>
          <E19_01>2010-08-23T17:16:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89.51</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
      </E19>

So, using the code provided by Paul[1] and using BigDecimal.toString() gives me the correct output.

Now, just for grins, I made a slight change to my original code, getting the code value from my bean and creating a new BigDecimal from that:
procInfo.setE1903(new BigDecimal(proc.getProcedurePerformed().getCode().toString()));
LOGGER.debug("Added E1903:" + proc.getProcedurePerformed().getCode());
LOGGER.debug("XML to this point:" + e19.toString());

Predictably, the code failed, and it failed immediately, as the E19.toString() generated the incorrect 89 value:
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Created new E19010
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:15:00.0
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1902:0
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | XML to this point:
<E19_01_0 xmlns="http://www.nemsis.org">
  <E19_01>2010-08-23T17:15:00.000Z</E19_01>
  <E19_02>0</E19_02>
  <E19_03>89.392</E19_03>
</E19_01_0>
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1905:1
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1906:1
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1907:4500
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1908:4605
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1910:4625
Sep 27 2010 15:42 | DEBUG  | IdleRemover | run: IdleRemover notifying pools, interval: 450000
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1911:-15
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Created new E19010
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:16:00.0
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1902:0
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51
Sep 27 2010 15:42 | DEBUG  | AbstractXmlBuilder | XML to this point:
<xml-fragment xmlns:nem="http://www.nemsis.org">
  <nem:E19_01_0>
    <nem:E19_01>2010-08-23T17:15:00.000Z</nem:E19_01>
    <nem:E19_02>0</nem:E19_02>
    <nem:E19_03>89.392</nem:E19_03>
    <nem:E19_05>1</nem:E19_05>
    <nem:E19_06>1</nem:E19_06>
    <nem:E19_07>4500</nem:E19_07>
    <nem:E19_08>4605</nem:E19_08>
    <nem:E19_09>SC008406</nem:E19_09>
    <nem:E19_10>4625</nem:E19_10>
    <nem:E19_11>-15</nem:E19_11>
  </nem:E19_01_0>
  <nem:E19_01_0>
    <nem:E19_01>2010-08-23T17:16:00.000Z</nem:E19_01>
    <nem:E19_02>0</nem:E19_02>
    <nem:E19_03>89</nem:E19_03>
  </nem:E19_01_0>
</xml-fragment>

I would suggest that there seems to be a bug in the marshaling code of the BigDecimal. I have done a bit of homework on how many of these we get, and we do get a fair amount of them, and there is no particular value that the problem seems to happen with.

Paul[0]


From: pgillen [mailto:paul.d.gillen@gmail.com]
Sent: Monday, September 27, 2010 10:41 AM
To: user@xmlbeans.apache.org
Subject: Re: Error compiling schema

The Procedure seemed to be an essential step. -p2-

---------
Paul Gillen

________________________________
From: Paul Cooper <pc...@emspic.org>
Date: Mon, 27 Sep 2010 13:29:34 -0400
To: user@xmlbeans.apache.org<us...@xmlbeans.apache.org>
ReplyTo: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,

You're suggesting doing a toString() on the BigDecimal? Hadn't tried that....let me test, I'll report back.

Paul

From: Gillen, Paul [mailto:paul.gillen@nscorp.com]
Sent: Monday, September 27, 2010 10:23 AM
To: 'user@xmlbeans.apache.org'
Subject: RE: Error compiling schema

This do it?  (in terms of solving your problem, not fixing XMLBeans should there be a problem there)

I _hate_ BigDecimal.

= Paul[1] =
________________________________
    throws Exception
    {
        EMSDataSetDocument  emsDoc          = EMSDataSetDocument.Factory.newInstance();

        EMSDataSet          emsDs           = emsDoc.addNewEMSDataSet();
        Header              hdr             = emsDs.addNewHeader();
        Record              rec1            = hdr.addNewRecord();
        E19                 rec1_e19        = rec1.addNewE19();

        E19010              rec1_e19010a    = rec1_e19.addNewE19010();
        Procedure           p1              = Procedure.Factory.newInstance();
        p1.setStringValue("1.1234");
        rec1_e19010a.xsetE1903(p1);

        E19010              rec1_e19010b    = rec1_e19.addNewE19010();
        Procedure           p2              = Procedure.Factory.newInstance();
        p2.setStringValue("2.2468");
        rec1_e19010b.xsetE1903(p2);

        System.out.println(emsDoc.toString());
    }

<EMSDataSet xmlns="http://www.nemsis.org">
  <Header>
    <Record>
      <E19>
        <E19_01_0>
          <E19_03>1.1234</E19_03>
        </E19_01_0>
        <E19_01_0>
          <E19_03>2.2468</E19_03>
        </E19_01_0>
      </E19>
    </Record>
  </Header>
</EMSDataSet>
________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Monday, September 27, 2010 11:24 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Tim,

Your understanding of the problem is correct. This is a repeatable problem. The values being logged are coming directly from the bean's getters, so the value is correct when being added to the XML. And yes, the problem always occurs at the decimal. Interestingly, it seems to happen the SECOND time the E19 element is created.

I'll log the XML (it's a pretty big file, hopefully I can log sections) and see what happens.

I'll also try to find another PCR with multiple E19 elements.

Paul

From: Tim Watts [mailto:tim@cliftonfarm.org]
Sent: Saturday, September 25, 2010 10:14 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Not exactly sure what's happening here in terms of procedure. My guess is that AbstractXmlBuilder (superclass of XmlPrcBuilder?) is calling setters/"adders" on the target XmlBean and that XmlPcrBuilder is then calling bean.validate(). Is that right?

Can you repeat the problem at will or is it still a random thing?

Also, when the values are logged are they obtained using the bean's getters or are you logging the original value that the builder receives? If the latter, it might shed some light to log the values obtained from the getters as well.

Just for grins & giggles, what if you logged the XML after each set/add. Might shed some light on the point at which 89.51 becomes 89.

I'm also curious to know whether the truncation always occurs exactly at the decimal point?


On Sat, 2010-09-25 at 23:29 -0400, Paul Cooper wrote:
All,



I've successfully rebuilt my library with the 2.4 version of XMLBeans, and have successfully replicated the problem with BigDecimals with that version.



Here is the logging from my server:

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:15:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:16:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>> FAILED validation:  5329436

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder | Message: W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>>



And here is the XML output. Clearly there is an issue:

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>



Paul



Re: Error compiling schema

Posted by pgillen <pa...@gmail.com>.
The Procedure seemed to be an essential step. -p2-
---------
Paul Gillen

-----Original Message-----
From: Paul Cooper <pc...@emspic.org>
Date: Mon, 27 Sep 2010 13:29:34 
To: user@xmlbeans.apache.org<us...@xmlbeans.apache.org>
Reply-To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,

You're suggesting doing a toString() on the BigDecimal? Hadn't tried that....let me test, I'll report back.

Paul

From: Gillen, Paul [mailto:paul.gillen@nscorp.com]
Sent: Monday, September 27, 2010 10:23 AM
To: 'user@xmlbeans.apache.org'
Subject: RE: Error compiling schema

This do it?  (in terms of solving your problem, not fixing XMLBeans should there be a problem there)

I_hate_ BigDecimal.

= Paul[1] =
________________________________
    throws Exception
    {
        EMSDataSetDocument  emsDoc          = EMSDataSetDocument.Factory.newInstance();

        EMSDataSet          emsDs           = emsDoc.addNewEMSDataSet();
        Header              hdr             = emsDs.addNewHeader();
        Record              rec1            = hdr.addNewRecord();
        E19                 rec1_e19        = rec1.addNewE19();

        E19010              rec1_e19010a    = rec1_e19.addNewE19010();
        Procedure           p1              = Procedure.Factory.newInstance();
        p1.setStringValue("1.1234");
        rec1_e19010a.xsetE1903(p1);

        E19010              rec1_e19010b    = rec1_e19.addNewE19010();
        Procedure           p2              = Procedure.Factory.newInstance();
        p2.setStringValue("2.2468");
        rec1_e19010b.xsetE1903(p2);

        System.out.println(emsDoc.toString());
    }

<EMSDataSet xmlns="http://www.nemsis.org">
  <Header>
    <Record>
      <E19>
        <E19_01_0>
          <E19_03>1.1234</E19_03>
        </E19_01_0>
        <E19_01_0>
          <E19_03>2.2468</E19_03>
        </E19_01_0>
      </E19>
    </Record>
  </Header>
</EMSDataSet>
________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Monday, September 27, 2010 11:24 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Tim,

Your understanding of the problem is correct. This is a repeatable problem. The values being logged are coming directly from the bean's getters, so the value is correct when being added to the XML. And yes, the problem always occurs at the decimal. Interestingly, it seems to happen the SECOND time the E19 element is created.

I'll log the XML (it's a pretty big file, hopefully I can log sections) and see what happens.

I'll also try to find another PCR with multiple E19 elements.

Paul

From: Tim Watts [mailto:tim@cliftonfarm.org]
Sent: Saturday, September 25, 2010 10:14 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Not exactly sure what's happening here in terms of procedure. My guess is that AbstractXmlBuilder (superclass of XmlPrcBuilder?) is calling setters/"adders" on the target XmlBean and that XmlPcrBuilder is then calling bean.validate(). Is that right?

Can you repeat the problem at will or is it still a random thing?

Also, when the values are logged are they obtained using the bean's getters or are you logging the original value that the builder receives? If the latter, it might shed some light to log the values obtained from the getters as well.

Just for grins & giggles, what if you logged the XML after each set/add. Might shed some light on the point at which 89.51 becomes 89.

I'm also curious to know whether the truncation always occurs exactly at the decimal point?


On Sat, 2010-09-25 at 23:29 -0400, Paul Cooper wrote:
All,



I've successfully rebuilt my library with the 2.4 version of XMLBeans, and have successfully replicated the problem with BigDecimals with that version.



Here is the logging from my server:

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:15:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:16:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>> FAILED validation:  5329436

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder | Message: W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>>



And here is the XML output. Clearly there is an issue:

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>



Paul




RE: Error compiling schema

Posted by Paul Cooper <pc...@emspic.org>.
Paul,

You're suggesting doing a toString() on the BigDecimal? Hadn't tried that....let me test, I'll report back.

Paul

From: Gillen, Paul [mailto:paul.gillen@nscorp.com]
Sent: Monday, September 27, 2010 10:23 AM
To: 'user@xmlbeans.apache.org'
Subject: RE: Error compiling schema

This do it?  (in terms of solving your problem, not fixing XMLBeans should there be a problem there)

I _hate_ BigDecimal.

= Paul[1] =
________________________________
    throws Exception
    {
        EMSDataSetDocument  emsDoc          = EMSDataSetDocument.Factory.newInstance();

        EMSDataSet          emsDs           = emsDoc.addNewEMSDataSet();
        Header              hdr             = emsDs.addNewHeader();
        Record              rec1            = hdr.addNewRecord();
        E19                 rec1_e19        = rec1.addNewE19();

        E19010              rec1_e19010a    = rec1_e19.addNewE19010();
        Procedure           p1              = Procedure.Factory.newInstance();
        p1.setStringValue("1.1234");
        rec1_e19010a.xsetE1903(p1);

        E19010              rec1_e19010b    = rec1_e19.addNewE19010();
        Procedure           p2              = Procedure.Factory.newInstance();
        p2.setStringValue("2.2468");
        rec1_e19010b.xsetE1903(p2);

        System.out.println(emsDoc.toString());
    }

<EMSDataSet xmlns="http://www.nemsis.org">
  <Header>
    <Record>
      <E19>
        <E19_01_0>
          <E19_03>1.1234</E19_03>
        </E19_01_0>
        <E19_01_0>
          <E19_03>2.2468</E19_03>
        </E19_01_0>
      </E19>
    </Record>
  </Header>
</EMSDataSet>
________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Monday, September 27, 2010 11:24 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Tim,

Your understanding of the problem is correct. This is a repeatable problem. The values being logged are coming directly from the bean's getters, so the value is correct when being added to the XML. And yes, the problem always occurs at the decimal. Interestingly, it seems to happen the SECOND time the E19 element is created.

I'll log the XML (it's a pretty big file, hopefully I can log sections) and see what happens.

I'll also try to find another PCR with multiple E19 elements.

Paul

From: Tim Watts [mailto:tim@cliftonfarm.org]
Sent: Saturday, September 25, 2010 10:14 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Not exactly sure what's happening here in terms of procedure. My guess is that AbstractXmlBuilder (superclass of XmlPrcBuilder?) is calling setters/"adders" on the target XmlBean and that XmlPcrBuilder is then calling bean.validate(). Is that right?

Can you repeat the problem at will or is it still a random thing?

Also, when the values are logged are they obtained using the bean's getters or are you logging the original value that the builder receives? If the latter, it might shed some light to log the values obtained from the getters as well.

Just for grins & giggles, what if you logged the XML after each set/add. Might shed some light on the point at which 89.51 becomes 89.

I'm also curious to know whether the truncation always occurs exactly at the decimal point?


On Sat, 2010-09-25 at 23:29 -0400, Paul Cooper wrote:
All,



I've successfully rebuilt my library with the 2.4 version of XMLBeans, and have successfully replicated the problem with BigDecimals with that version.



Here is the logging from my server:

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:15:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:16:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>> FAILED validation:  5329436

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder | Message: W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>>



And here is the XML output. Clearly there is an issue:

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>



Paul



RE: Error compiling schema

Posted by "Gillen, Paul" <pa...@nscorp.com>.
This do it?  (in terms of solving your problem, not fixing XMLBeans should there be a problem there)

I _hate_ BigDecimal.

= Paul[1] =
________________________________
    throws Exception
    {
        EMSDataSetDocument  emsDoc          = EMSDataSetDocument.Factory.newInstance();

        EMSDataSet          emsDs           = emsDoc.addNewEMSDataSet();
        Header              hdr             = emsDs.addNewHeader();
        Record              rec1            = hdr.addNewRecord();
        E19                 rec1_e19        = rec1.addNewE19();

        E19010              rec1_e19010a    = rec1_e19.addNewE19010();
        Procedure           p1              = Procedure.Factory.newInstance();
        p1.setStringValue("1.1234");
        rec1_e19010a.xsetE1903(p1);

        E19010              rec1_e19010b    = rec1_e19.addNewE19010();
        Procedure           p2              = Procedure.Factory.newInstance();
        p2.setStringValue("2.2468");
        rec1_e19010b.xsetE1903(p2);

        System.out.println(emsDoc.toString());
    }

<EMSDataSet xmlns="http://www.nemsis.org">
  <Header>
    <Record>
      <E19>
        <E19_01_0>
          <E19_03>1.1234</E19_03>
        </E19_01_0>
        <E19_01_0>
          <E19_03>2.2468</E19_03>
        </E19_01_0>
      </E19>
    </Record>
  </Header>
</EMSDataSet>
________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Monday, September 27, 2010 11:24 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Tim,

Your understanding of the problem is correct. This is a repeatable problem. The values being logged are coming directly from the bean's getters, so the value is correct when being added to the XML. And yes, the problem always occurs at the decimal. Interestingly, it seems to happen the SECOND time the E19 element is created.

I'll log the XML (it's a pretty big file, hopefully I can log sections) and see what happens.

I'll also try to find another PCR with multiple E19 elements.

Paul

From: Tim Watts [mailto:tim@cliftonfarm.org]
Sent: Saturday, September 25, 2010 10:14 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Not exactly sure what's happening here in terms of procedure. My guess is that AbstractXmlBuilder (superclass of XmlPrcBuilder?) is calling setters/"adders" on the target XmlBean and that XmlPcrBuilder is then calling bean.validate(). Is that right?

Can you repeat the problem at will or is it still a random thing?

Also, when the values are logged are they obtained using the bean's getters or are you logging the original value that the builder receives? If the latter, it might shed some light to log the values obtained from the getters as well.

Just for grins & giggles, what if you logged the XML after each set/add. Might shed some light on the point at which 89.51 becomes 89.

I'm also curious to know whether the truncation always occurs exactly at the decimal point?


On Sat, 2010-09-25 at 23:29 -0400, Paul Cooper wrote:
All,



I've successfully rebuilt my library with the 2.4 version of XMLBeans, and have successfully replicated the problem with BigDecimals with that version.



Here is the logging from my server:

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:15:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:16:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>> FAILED validation:  5329436

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder | Message: W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>>



And here is the XML output. Clearly there is an issue:

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>



Paul



RE: Error compiling schema

Posted by Paul Cooper <pc...@emspic.org>.
Tim,

Your understanding of the problem is correct. This is a repeatable problem. The values being logged are coming directly from the bean’s getters, so the value is correct when being added to the XML. And yes, the problem always occurs at the decimal. Interestingly, it seems to happen the SECOND time the E19 element is created.

I’ll log the XML (it’s a pretty big file, hopefully I can log sections) and see what happens.

I’ll also try to find another PCR with multiple E19 elements.

Paul

From: Tim Watts [mailto:tim@cliftonfarm.org]
Sent: Saturday, September 25, 2010 10:14 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Not exactly sure what's happening here in terms of procedure. My guess is that AbstractXmlBuilder (superclass of XmlPrcBuilder?) is calling setters/"adders" on the target XmlBean and that XmlPcrBuilder is then calling bean.validate(). Is that right?

Can you repeat the problem at will or is it still a random thing?

Also, when the values are logged are they obtained using the bean's getters or are you logging the original value that the builder receives? If the latter, it might shed some light to log the values obtained from the getters as well.

Just for grins & giggles, what if you logged the XML after each set/add. Might shed some light on the point at which 89.51 becomes 89.

I'm also curious to know whether the truncation always occurs exactly at the decimal point?


On Sat, 2010-09-25 at 23:29 -0400, Paul Cooper wrote:
All,



I’ve successfully rebuilt my library with the 2.4 version of XMLBeans, and have successfully replicated the problem with BigDecimals with that version.



Here is the logging from my server:

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:15:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:16:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>> FAILED validation:  5329436

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder | Message: W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>>



And here is the XML output. Clearly there is an issue:

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>



Paul



RE: Error compiling schema

Posted by Tim Watts <ti...@cliftonfarm.org>.
Not exactly sure what's happening here in terms of procedure. My guess
is that AbstractXmlBuilder (superclass of XmlPrcBuilder?) is calling
setters/"adders" on the target XmlBean and that XmlPcrBuilder is then
calling bean.validate(). Is that right?

Can you repeat the problem at will or is it still a random thing?

Also, when the values are logged are they obtained using the bean's
getters or are you logging the original value that the builder receives?
If the latter, it might shed some light to log the values obtained from
the getters as well.

Just for grins & giggles, what if you logged the XML after each set/add.
Might shed some light on the point at which 89.51 becomes 89.

I'm also curious to know whether the truncation always occurs exactly at
the decimal point?


On Sat, 2010-09-25 at 23:29 -0400, Paul Cooper wrote:
All,

 

I’ve successfully rebuilt my library with the 2.4 version of XMLBeans,
and have successfully replicated the problem with BigDecimals with that
version.

 

Here is the logging from my server:

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23
10:15:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23
10:16:00.0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625

Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>>
FAILED validation:  5329436

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder | Message: W5329436 -- union
value '89' does not match any members of 'Procedure in namespace
http://www.nemsis.org'

Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>>

 

And here is the XML output. Clearly there is an issue:

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>

 

Paul

 


RE: Error compiling schema

Posted by Paul Cooper <pc...@emspic.org>.
All,

I've successfully rebuilt my library with the 2.4 version of XMLBeans, and have successfully replicated the problem with BigDecimals with that version.

Here is the logging from my server:
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:15:00.0
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.392
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Created new E19010
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1901:2010-08-23 10:16:00.0
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1902:0
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1903:89.51
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1905:1
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1906:1
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1907:4500
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1908:4605
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1909:SC008406
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1910:4625
Sep 25 2010 20:22 | DEBUG  | AbstractXmlBuilder | Added E1911:-15
Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>> FAILED validation:  5329436
Sep 25 2010 20:22 | INFO   | XmlPcrBuilder | Message: W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'
Sep 25 2010 20:22 | INFO   | XmlPcrBuilder |  >>>>>>>>>>>>>>>>>>>>>>>>

And here is the XML output. Clearly there is an issue:
      <E19>
        <E19_01_0>
          <E19_01>2010-08-23T17:15:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89.392</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
        <E19_01_0>
          <E19_01>2010-08-23T17:16:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
      </E19>

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Friday, September 24, 2010 12:45 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul Gillen and Paul Cooper,
if the compilation failure for the EMSDataSet.xsd is the same failure reported in XMLBeans-396 (I don't know what GML is), then please reopen that bug (instead of filing a new bug).
As best as I can see, XMLBeans-396 affects post-2.4.0 XMLBeans (version 2.4.1 is not an actual released version; once 2.4.0 is released, the version number is then changed to 2.4.1 in the src while the next release is in development). From what Paul Gillen reported, the EMSDataSet.xsd compiled successfully using 2.4.0.
For now, Paul Cooper, perhaps you can stick with 2.4.0.
- Wing Yew
________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Friday, September 24, 2010 12:34 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
Paul,

You have correctly identified my issue. And yes, the schema I'm attempting to compile is the EMSDataSet.xsd from the NEMSIS web site. There is a JIRA bug (XMLBEANS-396) that mentions that the current version of the compiler fails with these errors. Did you modify the source to include the suggested fix? The latest and greatest code DOES have the fix in it, and still generates exactly those errors.

I'm beginning to have a bit more sympathy for the vendors who have to submit XML to us...

Original Paul

From: Gillen, Paul [mailto:paul.gillen@nscorp.com]
Sent: Friday, September 24, 2010 12:19 PM
To: 'user@xmlbeans.apache.org'
Subject: RE: Error compiling schema

Different Paul here, but this looked interesting.

Presuming from original report this that is EMSDataSet.xsd and related XSDs available from http://www.nemsis.org/softwaredevelopers/downloads/emsDataset.html, and presuming I understand the problem report correctly.

Using downloaded binaries XMLBeans 2.3 and 2.4 compile cleanly.  XMLBeans 2.5 (which despite what is noted below is not listed as the current release on http://xmlbeans.apache.org/sourceAndBinaries/) generates:

C:\development\downloads>C:\development\xmlbeans-2.5.0\bin\scomp xsd\EMSDataSet.xsd -out lib\EMSDataSet.jar
Time to build schema type system: 2.652 seconds
Time to generate code: 21.917 seconds
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml
.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml
.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xm
l.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED
________________________________
From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Friday, September 24, 2010 3:00 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

The code to set the E19_03 element value is simple:
procInfo.setE1903(proc.getProcedurePerformed().getCode());

Paul,
you might try to print out what you are actually setting E19_03 to (what is the value of proc.getProcedurePerformed().getCode()?).
And how did that code get set in the ProcedurePerformed object?
What I'm getting at is that you should try to trace where your "89" first appeared in your system. Did it come from XMLBeans or did it come from some input to XMLBeans?
- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Friday, September 24, 2010 12:04 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
Wing Yew,

Thanks for the response. I have no idea what version of XMLBeans we *were* using....I downloaded it and built our schema jar in March of 2006. We did not find this error until we started attempting to export data earlier this year. And yes, the version I'm using now is built from the latest code checked out from the repository.

Here's the section of the schema in question:
-<http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd> <  <xs:element name="E19_03" type="Procedure">
-<http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd> <       <xs:annotation>
  <             <xs:documentation>The procedure performed on the patient</xs:documentation>
 </xs:annotation>
  </xs:element>

Here's the definition of the "Procedure" type:
<xs:simpleType name="Procedure">
<xs:annotation>
<xs:documentation>The procedure performed on the patient</xs:documentation>
</xs:annotation>
<xs:union memberTypes="ProcedureCPTCode NullValues" />
</xs:simpleType>

And here's the definition of the "ProcedureCPTCode" referenced above (this is a subset, it's a long list; these are EMS procedure codes):
<xs:simpleType name="ProcedureCPTCode">
<xs:restriction base="xs:decimal">
<xs:enumeration value="89.391">
<xs:annotation>
<xs:documentation>Capnography (CO2 Measurement)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="89.392">
<xs:annotation>
<xs:documentation>Pulse Oximetry</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="89.510">
<xs:annotation>
<xs:documentation>Cardiac Monitor</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>

The code to set the E19_03 element value is simple:
procInfo.setE1903(proc.getProcedurePerformed().getCode());

And the method getCode() is defined:
private BigDecimal myCode;
public void setCode(BigDecimal code) {
myCode = code;
}
public BigDecimal getCode() {
return myCode;
}

You are correct about the bug we are seeing: we are setting the value to 89.51 but the XML output is 89. The XML in my last email was copied directly from the XMLBeans output file. And yes, now that I look at it, 89.51 will not equal 89.510, but that's a problem for another day.

I just found the email my co-worker sent just before he left, and it turns out he was referencing the same bug I referenced below, so there is a high probability that he had no idea what he was talking about. Nonetheless, we are clearly having a problem...

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Thursday, September 23, 2010 10:26 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
you'll have to explain a bit more what the bug is.
Can you excerpt the part of your schema that defines the type of the E19_03 element?
Also, how is the value of the element set?
Is the bug that you're setting E19_03 to 89.51 but when the XMLObject marshalled, you get 89 in E19_03?

What version of XMLBeans are you using? Am I correct in my understanding that you were using 2.5 and seeing a bug consistently, and then you switched to using XMLBeans built from the latest in the svn trunk and now see the bug intermittently?
There haven't been that many code checkins since 2.5 was released. How did your co-worker know that the bug was "fixed in the source but NOT fixed in version 2.5" (meaning fixed after 2.5?)?

- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 7:20 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
Wow, I was hoping someone on the list would instantly know what I was talking about.   :)

We are building an XML file from Oracle data. Periodically we get the following error when validating the XML:

W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Here is the section of the XML that is in question:

      <E19>
        <E19_01_0>
          <E19_01>2010-08-23T17:15:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89.392</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
        <E19_01_0>
          <E19_01>2010-08-23T17:16:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
      </E19>

As you see above, there are two E19_01_0 sections, one has a E19_03 value of 89.392, and the other has the value of 89. Unfortunately, the second value SHOULD be 89.51. My cow-orker (who has since left the company) indicated that this was a known problem with the version of XMLBeans we were using, and had been fixed in the source but NOT fixed in version 2.5....we'd have to download the source and build it ourselves. Prior to building and deploying the most recent source, we were having this truncation problem on every one of these records. Now, we get it randomly.

Thanks for the quick response!

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Thursday, September 23, 2010 7:07 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
what is this BigDecimal truncation bug that you speak of?
- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema
Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
Time to build schema type system: 2.124 seconds
Time to generate code: 4.917 seconds
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web...a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

Any help would be HUGELY appreciated.

Paul Cooper
Project Manager
EMS Performance Improvement Center
100 Market Street
Chapel Hill, NC  27516
(919) 843-0201

RE: Error compiling schema

Posted by Paul Cooper <pc...@emspic.org>.
Wing Yew...

It's a-Paul-ing....

:)

Thanks for the advice. I'll report back shortly with my results. I've added heavy logging into the code that assigns the Procedure Codes, and I'll report back with my findings.

Thank all three of you (Tim included) for looking into this issue.

Paul (Cooper)

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Friday, September 24, 2010 12:45 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul Gillen and Paul Cooper,
if the compilation failure for the EMSDataSet.xsd is the same failure reported in XMLBeans-396 (I don't know what GML is), then please reopen that bug (instead of filing a new bug).
As best as I can see, XMLBeans-396 affects post-2.4.0 XMLBeans (version 2.4.1 is not an actual released version; once 2.4.0 is released, the version number is then changed to 2.4.1 in the src while the next release is in development). From what Paul Gillen reported, the EMSDataSet.xsd compiled successfully using 2.4.0.
For now, Paul Cooper, perhaps you can stick with 2.4.0.
- Wing Yew
________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Friday, September 24, 2010 12:34 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
Paul,

You have correctly identified my issue. And yes, the schema I'm attempting to compile is the EMSDataSet.xsd from the NEMSIS web site. There is a JIRA bug (XMLBEANS-396) that mentions that the current version of the compiler fails with these errors. Did you modify the source to include the suggested fix? The latest and greatest code DOES have the fix in it, and still generates exactly those errors.

I'm beginning to have a bit more sympathy for the vendors who have to submit XML to us...

Original Paul

From: Gillen, Paul [mailto:paul.gillen@nscorp.com]
Sent: Friday, September 24, 2010 12:19 PM
To: 'user@xmlbeans.apache.org'
Subject: RE: Error compiling schema

Different Paul here, but this looked interesting.

Presuming from original report this that is EMSDataSet.xsd and related XSDs available from http://www.nemsis.org/softwaredevelopers/downloads/emsDataset.html, and presuming I understand the problem report correctly.

Using downloaded binaries XMLBeans 2.3 and 2.4 compile cleanly.  XMLBeans 2.5 (which despite what is noted below is not listed as the current release on http://xmlbeans.apache.org/sourceAndBinaries/) generates:

C:\development\downloads>C:\development\xmlbeans-2.5.0\bin\scomp xsd\EMSDataSet.xsd -out lib\EMSDataSet.jar
Time to build schema type system: 2.652 seconds
Time to generate code: 21.917 seconds
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml
.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml
.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xm
l.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED
________________________________
From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Friday, September 24, 2010 3:00 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

The code to set the E19_03 element value is simple:
procInfo.setE1903(proc.getProcedurePerformed().getCode());

Paul,
you might try to print out what you are actually setting E19_03 to (what is the value of proc.getProcedurePerformed().getCode()?).
And how did that code get set in the ProcedurePerformed object?
What I'm getting at is that you should try to trace where your "89" first appeared in your system. Did it come from XMLBeans or did it come from some input to XMLBeans?
- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Friday, September 24, 2010 12:04 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
Wing Yew,

Thanks for the response. I have no idea what version of XMLBeans we *were* using....I downloaded it and built our schema jar in March of 2006. We did not find this error until we started attempting to export data earlier this year. And yes, the version I'm using now is built from the latest code checked out from the repository.

Here's the section of the schema in question:
-<http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd> <  <xs:element name="E19_03" type="Procedure">
-<http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd> <       <xs:annotation>
  <             <xs:documentation>The procedure performed on the patient</xs:documentation>
 </xs:annotation>
  </xs:element>

Here's the definition of the "Procedure" type:
<xs:simpleType name="Procedure">
<xs:annotation>
<xs:documentation>The procedure performed on the patient</xs:documentation>
</xs:annotation>
<xs:union memberTypes="ProcedureCPTCode NullValues" />
</xs:simpleType>

And here's the definition of the "ProcedureCPTCode" referenced above (this is a subset, it's a long list; these are EMS procedure codes):
<xs:simpleType name="ProcedureCPTCode">
<xs:restriction base="xs:decimal">
<xs:enumeration value="89.391">
<xs:annotation>
<xs:documentation>Capnography (CO2 Measurement)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="89.392">
<xs:annotation>
<xs:documentation>Pulse Oximetry</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="89.510">
<xs:annotation>
<xs:documentation>Cardiac Monitor</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>

The code to set the E19_03 element value is simple:
procInfo.setE1903(proc.getProcedurePerformed().getCode());

And the method getCode() is defined:
private BigDecimal myCode;
public void setCode(BigDecimal code) {
myCode = code;
}
public BigDecimal getCode() {
return myCode;
}

You are correct about the bug we are seeing: we are setting the value to 89.51 but the XML output is 89. The XML in my last email was copied directly from the XMLBeans output file. And yes, now that I look at it, 89.51 will not equal 89.510, but that's a problem for another day.

I just found the email my co-worker sent just before he left, and it turns out he was referencing the same bug I referenced below, so there is a high probability that he had no idea what he was talking about. Nonetheless, we are clearly having a problem...

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Thursday, September 23, 2010 10:26 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
you'll have to explain a bit more what the bug is.
Can you excerpt the part of your schema that defines the type of the E19_03 element?
Also, how is the value of the element set?
Is the bug that you're setting E19_03 to 89.51 but when the XMLObject marshalled, you get 89 in E19_03?

What version of XMLBeans are you using? Am I correct in my understanding that you were using 2.5 and seeing a bug consistently, and then you switched to using XMLBeans built from the latest in the svn trunk and now see the bug intermittently?
There haven't been that many code checkins since 2.5 was released. How did your co-worker know that the bug was "fixed in the source but NOT fixed in version 2.5" (meaning fixed after 2.5?)?

- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 7:20 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
Wow, I was hoping someone on the list would instantly know what I was talking about.   :)

We are building an XML file from Oracle data. Periodically we get the following error when validating the XML:

W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Here is the section of the XML that is in question:

      <E19>
        <E19_01_0>
          <E19_01>2010-08-23T17:15:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89.392</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
        <E19_01_0>
          <E19_01>2010-08-23T17:16:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
      </E19>

As you see above, there are two E19_01_0 sections, one has a E19_03 value of 89.392, and the other has the value of 89. Unfortunately, the second value SHOULD be 89.51. My cow-orker (who has since left the company) indicated that this was a known problem with the version of XMLBeans we were using, and had been fixed in the source but NOT fixed in version 2.5....we'd have to download the source and build it ourselves. Prior to building and deploying the most recent source, we were having this truncation problem on every one of these records. Now, we get it randomly.

Thanks for the quick response!

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Thursday, September 23, 2010 7:07 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
what is this BigDecimal truncation bug that you speak of?
- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema
Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
Time to build schema type system: 2.124 seconds
Time to generate code: 4.917 seconds
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web...a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

Any help would be HUGELY appreciated.

Paul Cooper
Project Manager
EMS Performance Improvement Center
100 Market Street
Chapel Hill, NC  27516
(919) 843-0201

RE: Error compiling schema

Posted by Wing Yew Poon <wi...@oracle.com>.
Paul Gillen and Paul Cooper,
if the compilation failure for the EMSDataSet.xsd is the same failure reported in XMLBeans-396 (I don't know what GML is), then please reopen that bug (instead of filing a new bug).
As best as I can see, XMLBeans-396 affects post-2.4.0 XMLBeans (version 2.4.1 is not an actual released version; once 2.4.0 is released, the version number is then changed to 2.4.1 in the src while the next release is in development). From what Paul Gillen reported, the EMSDataSet.xsd compiled successfully using 2.4.0.
For now, Paul Cooper, perhaps you can stick with 2.4.0.
- Wing Yew

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Friday, September 24, 2010 12:34 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema



Paul,

 

You have correctly identified my issue. And yes, the schema I'm attempting to compile is the EMSDataSet.xsd from the NEMSIS web site. There is a JIRA bug (XMLBEANS-396) that mentions that the current version of the compiler fails with these errors. Did you modify the source to include the suggested fix? The latest and greatest code DOES have the fix in it, and still generates exactly those errors.

 

I'm beginning to have a bit more sympathy for the vendors who have to submit XML to us.

 

Original Paul

 

From: Gillen, Paul [mailto:paul.gillen@nscorp.com] 
Sent: Friday, September 24, 2010 12:19 PM
To: 'user@xmlbeans.apache.org'
Subject: RE: Error compiling schema

 

Different Paul here, but this looked interesting.

 

Presuming from original report this that is EMSDataSet.xsd and related XSDs available from http://www.nemsis.org/softwaredevelopers/downloads/emsDataset.html, and presuming I understand the problem report correctly.

 

Using downloaded binaries XMLBeans 2.3 and 2.4 compile cleanly.  XMLBeans 2.5 (which despite what is noted below is not listed as the current release on http://xmlbeans.apache.org/sourceAndBinaries/) generates:

 

C:\development\downloads>C:\development\xmlbeans-2.5.0\bin\scomp xsd\EMSDataSet.xsd -out lib\EMSDataSet.jar

Time to build schema type system: 2.652 seconds

Time to generate code: 21.917 seconds

C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml

.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml

.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xm

l.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

4 errors

 

BUILD FAILED

  _____  

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
Sent: Friday, September 24, 2010 3:00 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

 

The code to set the E19_03 element value is simple:

procInfo.setE1903(proc.getProcedurePerformed().getCode());

 

Paul,

you might try to print out what you are actually setting E19_03 to (what is the value of proc.getProcedurePerformed().getCode()?).

And how did that code get set in the ProcedurePerformed object?

What I'm getting at is that you should try to trace where your "89" first appeared in your system. Did it come from XMLBeans or did it come from some input to XMLBeans?

- Wing Yew

 

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Friday, September 24, 2010 12:04 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Wing Yew,

 

Thanks for the response. I have no idea what version of XMLBeans we *were* using..I downloaded it and built our schema jar in March of 2006. We did not find this error until we started attempting to export data earlier this year. And yes, the version I'm using now is built from the latest code checked out from the repository.

 

Here's the section of the schema in question:

HYPERLINK "http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd"- <  <xs:element name="E19_03" type="Procedure">

HYPERLINK "http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd"- <       <xs:annotation>

  <             <xs:documentation>The procedure performed on the patient</xs:documentation> 

 </xs:annotation>

  </xs:element>

 

Here's the definition of the "Procedure" type:

<xs:simpleType name="Procedure">

<xs:annotation>

<xs:documentation>The procedure performed on the patient</xs:documentation> 

</xs:annotation>

<xs:union memberTypes="ProcedureCPTCode NullValues" /> 

</xs:simpleType>

 

And here's the definition of the "ProcedureCPTCode" referenced above (this is a subset, it's a long list; these are EMS procedure codes):

<xs:simpleType name="ProcedureCPTCode">

<xs:restriction base="xs:decimal">

<xs:enumeration value="89.391">

<xs:annotation>

<xs:documentation>Capnography (CO2 Measurement)</xs:documentation> 

</xs:annotation>

</xs:enumeration>

<xs:enumeration value="89.392">

<xs:annotation>

<xs:documentation>Pulse Oximetry</xs:documentation> 

</xs:annotation>

</xs:enumeration>

<xs:enumeration value="89.510">

<xs:annotation>

<xs:documentation>Cardiac Monitor</xs:documentation> 

</xs:annotation>

</xs:enumeration>

</xs:restriction>

</xs:simpleType>

 

The code to set the E19_03 element value is simple:

procInfo.setE1903(proc.getProcedurePerformed().getCode());

 

And the method getCode() is defined:

private BigDecimal myCode;

public void setCode(BigDecimal code) {

myCode = code;

}

public BigDecimal getCode() {

return myCode;

}

 

You are correct about the bug we are seeing: we are setting the value to 89.51 but the XML output is 89. The XML in my last email was copied directly from the XMLBeans output file. And yes, now that I look at it, 89.51 will not equal 89.510, but that's a problem for another day.

 

I just found the email my co-worker sent just before he left, and it turns out he was referencing the same bug I referenced below, so there is a high probability that he had no idea what he was talking about. Nonetheless, we are clearly having a problem.

 

Paul

 

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
Sent: Thursday, September 23, 2010 10:26 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

 

Paul,

you'll have to explain a bit more what the bug is.

Can you excerpt the part of your schema that defines the type of the E19_03 element?

Also, how is the value of the element set?

Is the bug that you're setting E19_03 to 89.51 but when the XMLObject marshalled, you get 89 in E19_03?

 

What version of XMLBeans are you using? Am I correct in my understanding that you were using 2.5 and seeing a bug consistently, and then you switched to using XMLBeans built from the latest in the svn trunk and now see the bug intermittently?

There haven't been that many code checkins since 2.5 was released. How did your co-worker know that the bug was "fixed in the source but NOT fixed in version 2.5" (meaning fixed after 2.5?)?

 

- Wing Yew

 

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Thursday, September 23, 2010 7:20 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Wow, I was hoping someone on the list would instantly know what I was talking about.   J

 

We are building an XML file from Oracle data. Periodically we get the following error when validating the XML:

 

W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

 

Here is the section of the XML that is in question:

 

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>

 

As you see above, there are two E19_01_0 sections, one has a E19_03 value of 89.392, and the other has the value of 89. Unfortunately, the second value SHOULD be 89.51. My cow-orker (who has since left the company) indicated that this was a known problem with the version of XMLBeans we were using, and had been fixed in the source but NOT fixed in version 2.5..we'd have to download the source and build it ourselves. Prior to building and deploying the most recent source, we were having this truncation problem on every one of these records. Now, we get it randomly.

 

Thanks for the quick response!

 

Paul

 

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
Sent: Thursday, September 23, 2010 7:07 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

 

Paul,

what is this BigDecimal truncation bug that you speak of?

- Wing Yew

 

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema

Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

 

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

 

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd

Time to build schema type system: 2.124 seconds

Time to generate code: 4.917 seconds

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

4 errors

 

BUILD FAILED

 

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

 

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web.a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

 

Any help would be HUGELY appreciated.

 

Paul Cooper

Project Manager

EMS Performance Improvement Center

100 Market Street

Chapel Hill, NC  27516

(919) 843-0201

RE: Error compiling schema

Posted by Paul Cooper <pc...@emspic.org>.
Paul,

You have correctly identified my issue. And yes, the schema I'm attempting to compile is the EMSDataSet.xsd from the NEMSIS web site. There is a JIRA bug (XMLBEANS-396) that mentions that the current version of the compiler fails with these errors. Did you modify the source to include the suggested fix? The latest and greatest code DOES have the fix in it, and still generates exactly those errors.

I'm beginning to have a bit more sympathy for the vendors who have to submit XML to us...

Original Paul

From: Gillen, Paul [mailto:paul.gillen@nscorp.com]
Sent: Friday, September 24, 2010 12:19 PM
To: 'user@xmlbeans.apache.org'
Subject: RE: Error compiling schema

Different Paul here, but this looked interesting.

Presuming from original report this that is EMSDataSet.xsd and related XSDs available from http://www.nemsis.org/softwaredevelopers/downloads/emsDataset.html, and presuming I understand the problem report correctly.

Using downloaded binaries XMLBeans 2.3 and 2.4 compile cleanly.  XMLBeans 2.5 (which despite what is noted below is not listed as the current release on http://xmlbeans.apache.org/sourceAndBinaries/) generates:

C:\development\downloads>C:\development\xmlbeans-2.5.0\bin\scomp xsd\EMSDataSet.xsd -out lib\EMSDataSet.jar
Time to build schema type system: 2.652 seconds
Time to generate code: 21.917 seconds
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml
.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml
.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xm
l.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED
________________________________
From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Friday, September 24, 2010 3:00 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

The code to set the E19_03 element value is simple:
procInfo.setE1903(proc.getProcedurePerformed().getCode());

Paul,
you might try to print out what you are actually setting E19_03 to (what is the value of proc.getProcedurePerformed().getCode()?).
And how did that code get set in the ProcedurePerformed object?
What I'm getting at is that you should try to trace where your "89" first appeared in your system. Did it come from XMLBeans or did it come from some input to XMLBeans?
- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Friday, September 24, 2010 12:04 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
Wing Yew,

Thanks for the response. I have no idea what version of XMLBeans we *were* using....I downloaded it and built our schema jar in March of 2006. We did not find this error until we started attempting to export data earlier this year. And yes, the version I'm using now is built from the latest code checked out from the repository.

Here's the section of the schema in question:
-<http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd> <  <xs:element name="E19_03" type="Procedure">
-<http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd> <       <xs:annotation>
  <             <xs:documentation>The procedure performed on the patient</xs:documentation>
 </xs:annotation>
  </xs:element>

Here's the definition of the "Procedure" type:
<xs:simpleType name="Procedure">
<xs:annotation>
<xs:documentation>The procedure performed on the patient</xs:documentation>
</xs:annotation>
<xs:union memberTypes="ProcedureCPTCode NullValues" />
</xs:simpleType>

And here's the definition of the "ProcedureCPTCode" referenced above (this is a subset, it's a long list; these are EMS procedure codes):
<xs:simpleType name="ProcedureCPTCode">
<xs:restriction base="xs:decimal">
<xs:enumeration value="89.391">
<xs:annotation>
<xs:documentation>Capnography (CO2 Measurement)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="89.392">
<xs:annotation>
<xs:documentation>Pulse Oximetry</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="89.510">
<xs:annotation>
<xs:documentation>Cardiac Monitor</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>

The code to set the E19_03 element value is simple:
procInfo.setE1903(proc.getProcedurePerformed().getCode());

And the method getCode() is defined:
private BigDecimal myCode;
public void setCode(BigDecimal code) {
myCode = code;
}
public BigDecimal getCode() {
return myCode;
}

You are correct about the bug we are seeing: we are setting the value to 89.51 but the XML output is 89. The XML in my last email was copied directly from the XMLBeans output file. And yes, now that I look at it, 89.51 will not equal 89.510, but that's a problem for another day.

I just found the email my co-worker sent just before he left, and it turns out he was referencing the same bug I referenced below, so there is a high probability that he had no idea what he was talking about. Nonetheless, we are clearly having a problem...

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Thursday, September 23, 2010 10:26 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
you'll have to explain a bit more what the bug is.
Can you excerpt the part of your schema that defines the type of the E19_03 element?
Also, how is the value of the element set?
Is the bug that you're setting E19_03 to 89.51 but when the XMLObject marshalled, you get 89 in E19_03?

What version of XMLBeans are you using? Am I correct in my understanding that you were using 2.5 and seeing a bug consistently, and then you switched to using XMLBeans built from the latest in the svn trunk and now see the bug intermittently?
There haven't been that many code checkins since 2.5 was released. How did your co-worker know that the bug was "fixed in the source but NOT fixed in version 2.5" (meaning fixed after 2.5?)?

- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 7:20 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
Wow, I was hoping someone on the list would instantly know what I was talking about.   :)

We are building an XML file from Oracle data. Periodically we get the following error when validating the XML:

W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Here is the section of the XML that is in question:

      <E19>
        <E19_01_0>
          <E19_01>2010-08-23T17:15:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89.392</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
        <E19_01_0>
          <E19_01>2010-08-23T17:16:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
      </E19>

As you see above, there are two E19_01_0 sections, one has a E19_03 value of 89.392, and the other has the value of 89. Unfortunately, the second value SHOULD be 89.51. My cow-orker (who has since left the company) indicated that this was a known problem with the version of XMLBeans we were using, and had been fixed in the source but NOT fixed in version 2.5....we'd have to download the source and build it ourselves. Prior to building and deploying the most recent source, we were having this truncation problem on every one of these records. Now, we get it randomly.

Thanks for the quick response!

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Thursday, September 23, 2010 7:07 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
what is this BigDecimal truncation bug that you speak of?
- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema
Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
Time to build schema type system: 2.124 seconds
Time to generate code: 4.917 seconds
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web...a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

Any help would be HUGELY appreciated.

Paul Cooper
Project Manager
EMS Performance Improvement Center
100 Market Street
Chapel Hill, NC  27516
(919) 843-0201

RE: Error compiling schema

Posted by "Gillen, Paul" <pa...@nscorp.com>.
Different Paul here, but this looked interesting.

Presuming from original report this that is EMSDataSet.xsd and related XSDs available from http://www.nemsis.org/softwaredevelopers/downloads/emsDataset.html, and presuming I understand the problem report correctly.

Using downloaded binaries XMLBeans 2.3 and 2.4 compile cleanly.  XMLBeans 2.5 (which despite what is noted below is not listed as the current release on http://xmlbeans.apache.org/sourceAndBinaries/) generates:

C:\development\downloads>C:\development\xmlbeans-2.5.0\bin\scomp xsd\EMSDataSet.xsd -out lib\EMSDataSet.jar
Time to build schema type system: 2.652 seconds
Time to generate code: 21.917 seconds
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml
.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml
.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\DOCUME~1\xxxxx\LOCALS~1\Temp\xbean50429.d\src\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xm
l.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED
________________________________
From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Friday, September 24, 2010 3:00 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

The code to set the E19_03 element value is simple:
procInfo.setE1903(proc.getProcedurePerformed().getCode());

Paul,
you might try to print out what you are actually setting E19_03 to (what is the value of proc.getProcedurePerformed().getCode()?).
And how did that code get set in the ProcedurePerformed object?
What I'm getting at is that you should try to trace where your "89" first appeared in your system. Did it come from XMLBeans or did it come from some input to XMLBeans?
- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Friday, September 24, 2010 12:04 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
Wing Yew,

Thanks for the response. I have no idea what version of XMLBeans we *were* using....I downloaded it and built our schema jar in March of 2006. We did not find this error until we started attempting to export data earlier this year. And yes, the version I'm using now is built from the latest code checked out from the repository.

Here's the section of the schema in question:
-<http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd> <  <xs:element name="E19_03" type="Procedure">
-<http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd> <       <xs:annotation>
  <             <xs:documentation>The procedure performed on the patient</xs:documentation>
 </xs:annotation>
  </xs:element>

Here's the definition of the "Procedure" type:
<xs:simpleType name="Procedure">
<xs:annotation>
<xs:documentation>The procedure performed on the patient</xs:documentation>
</xs:annotation>
<xs:union memberTypes="ProcedureCPTCode NullValues" />
</xs:simpleType>

And here's the definition of the "ProcedureCPTCode" referenced above (this is a subset, it's a long list; these are EMS procedure codes):
<xs:simpleType name="ProcedureCPTCode">
<xs:restriction base="xs:decimal">
<xs:enumeration value="89.391">
<xs:annotation>
<xs:documentation>Capnography (CO2 Measurement)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="89.392">
<xs:annotation>
<xs:documentation>Pulse Oximetry</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="89.510">
<xs:annotation>
<xs:documentation>Cardiac Monitor</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>

The code to set the E19_03 element value is simple:
procInfo.setE1903(proc.getProcedurePerformed().getCode());

And the method getCode() is defined:
private BigDecimal myCode;
public void setCode(BigDecimal code) {
myCode = code;
}
public BigDecimal getCode() {
return myCode;
}

You are correct about the bug we are seeing: we are setting the value to 89.51 but the XML output is 89. The XML in my last email was copied directly from the XMLBeans output file. And yes, now that I look at it, 89.51 will not equal 89.510, but that's a problem for another day.

I just found the email my co-worker sent just before he left, and it turns out he was referencing the same bug I referenced below, so there is a high probability that he had no idea what he was talking about. Nonetheless, we are clearly having a problem...

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Thursday, September 23, 2010 10:26 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
you'll have to explain a bit more what the bug is.
Can you excerpt the part of your schema that defines the type of the E19_03 element?
Also, how is the value of the element set?
Is the bug that you're setting E19_03 to 89.51 but when the XMLObject marshalled, you get 89 in E19_03?

What version of XMLBeans are you using? Am I correct in my understanding that you were using 2.5 and seeing a bug consistently, and then you switched to using XMLBeans built from the latest in the svn trunk and now see the bug intermittently?
There haven't been that many code checkins since 2.5 was released. How did your co-worker know that the bug was "fixed in the source but NOT fixed in version 2.5" (meaning fixed after 2.5?)?

- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 7:20 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
Wow, I was hoping someone on the list would instantly know what I was talking about.   :)

We are building an XML file from Oracle data. Periodically we get the following error when validating the XML:

W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Here is the section of the XML that is in question:

      <E19>
        <E19_01_0>
          <E19_01>2010-08-23T17:15:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89.392</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
        <E19_01_0>
          <E19_01>2010-08-23T17:16:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
      </E19>

As you see above, there are two E19_01_0 sections, one has a E19_03 value of 89.392, and the other has the value of 89. Unfortunately, the second value SHOULD be 89.51. My cow-orker (who has since left the company) indicated that this was a known problem with the version of XMLBeans we were using, and had been fixed in the source but NOT fixed in version 2.5....we'd have to download the source and build it ourselves. Prior to building and deploying the most recent source, we were having this truncation problem on every one of these records. Now, we get it randomly.

Thanks for the quick response!

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Thursday, September 23, 2010 7:07 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
what is this BigDecimal truncation bug that you speak of?
- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema
Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
Time to build schema type system: 2.124 seconds
Time to generate code: 4.917 seconds
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web...a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

Any help would be HUGELY appreciated.

Paul Cooper
Project Manager
EMS Performance Improvement Center
100 Market Street
Chapel Hill, NC  27516
(919) 843-0201

RE: Error compiling schema

Posted by Wing Yew Poon <wi...@oracle.com>.
The code to set the E19_03 element value is simple:

procInfo.setE1903(proc.getProcedurePerformed().getCode());

 

Paul,

you might try to print out what you are actually setting E19_03 to (what is the value of proc.getProcedurePerformed().getCode()?).

And how did that code get set in the ProcedurePerformed object?

What I'm getting at is that you should try to trace where your "89" first appeared in your system. Did it come from XMLBeans or did it come from some input to XMLBeans?

- Wing Yew

 
  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Friday, September 24, 2010 12:04 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema



Wing Yew,

 

Thanks for the response. I have no idea what version of XMLBeans we *were* using..I downloaded it and built our schema jar in March of 2006. We did not find this error until we started attempting to export data earlier this year. And yes, the version I'm using now is built from the latest code checked out from the repository.

 

Here's the section of the schema in question:

HYPERLINK "http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd"- <  <xs:element name="E19_03" type="Procedure">

HYPERLINK "http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd"- <       <xs:annotation>

  <             <xs:documentation>The procedure performed on the patient</xs:documentation> 

 </xs:annotation>

  </xs:element>

 

Here's the definition of the "Procedure" type:

<xs:simpleType name="Procedure">

<xs:annotation>

<xs:documentation>The procedure performed on the patient</xs:documentation> 

</xs:annotation>

<xs:union memberTypes="ProcedureCPTCode NullValues" /> 

</xs:simpleType>

 

And here's the definition of the "ProcedureCPTCode" referenced above (this is a subset, it's a long list; these are EMS procedure codes):

<xs:simpleType name="ProcedureCPTCode">

<xs:restriction base="xs:decimal">

<xs:enumeration value="89.391">

<xs:annotation>

<xs:documentation>Capnography (CO2 Measurement)</xs:documentation> 

</xs:annotation>

</xs:enumeration>

<xs:enumeration value="89.392">

<xs:annotation>

<xs:documentation>Pulse Oximetry</xs:documentation> 

</xs:annotation>

</xs:enumeration>

<xs:enumeration value="89.510">

<xs:annotation>

<xs:documentation>Cardiac Monitor</xs:documentation> 

</xs:annotation>

</xs:enumeration>

</xs:restriction>

</xs:simpleType>

 

The code to set the E19_03 element value is simple:

procInfo.setE1903(proc.getProcedurePerformed().getCode());

 

And the method getCode() is defined:

private BigDecimal myCode;

public void setCode(BigDecimal code) {

myCode = code;

}

public BigDecimal getCode() {

return myCode;

}

 

You are correct about the bug we are seeing: we are setting the value to 89.51 but the XML output is 89. The XML in my last email was copied directly from the XMLBeans output file. And yes, now that I look at it, 89.51 will not equal 89.510, but that's a problem for another day.

 

I just found the email my co-worker sent just before he left, and it turns out he was referencing the same bug I referenced below, so there is a high probability that he had no idea what he was talking about. Nonetheless, we are clearly having a problem.

 

Paul

 

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
Sent: Thursday, September 23, 2010 10:26 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

 

Paul,

you'll have to explain a bit more what the bug is.

Can you excerpt the part of your schema that defines the type of the E19_03 element?

Also, how is the value of the element set?

Is the bug that you're setting E19_03 to 89.51 but when the XMLObject marshalled, you get 89 in E19_03?

 

What version of XMLBeans are you using? Am I correct in my understanding that you were using 2.5 and seeing a bug consistently, and then you switched to using XMLBeans built from the latest in the svn trunk and now see the bug intermittently?

There haven't been that many code checkins since 2.5 was released. How did your co-worker know that the bug was "fixed in the source but NOT fixed in version 2.5" (meaning fixed after 2.5?)?

 

- Wing Yew

 

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Thursday, September 23, 2010 7:20 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Wow, I was hoping someone on the list would instantly know what I was talking about.   J

 

We are building an XML file from Oracle data. Periodically we get the following error when validating the XML:

 

W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

 

Here is the section of the XML that is in question:

 

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>

 

As you see above, there are two E19_01_0 sections, one has a E19_03 value of 89.392, and the other has the value of 89. Unfortunately, the second value SHOULD be 89.51. My cow-orker (who has since left the company) indicated that this was a known problem with the version of XMLBeans we were using, and had been fixed in the source but NOT fixed in version 2.5..we'd have to download the source and build it ourselves. Prior to building and deploying the most recent source, we were having this truncation problem on every one of these records. Now, we get it randomly.

 

Thanks for the quick response!

 

Paul

 

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
Sent: Thursday, September 23, 2010 7:07 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

 

Paul,

what is this BigDecimal truncation bug that you speak of?

- Wing Yew

 

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema

Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

 

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

 

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd

Time to build schema type system: 2.124 seconds

Time to generate code: 4.917 seconds

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

4 errors

 

BUILD FAILED

 

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

 

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web.a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

 

Any help would be HUGELY appreciated.

 

Paul Cooper

Project Manager

EMS Performance Improvement Center

100 Market Street

Chapel Hill, NC  27516

(919) 843-0201

RE: Error compiling schema

Posted by Paul Cooper <pc...@emspic.org>.
Tim,

Thanks for the reply. This schema is a national standard for the submission of Emergency Medical Services incident data, and has been in the public for 5 years. I can't change the schema. The database column SHOULD have been a string, and since it isn't, is going to cause some major issues (the 89.510 is being truncated to 89.51 by the database). I suspect I will HAVE to change it.

And the form would be a combobox of values, so validation isn't really an issue.

The XML is being generated from a web application, a standard servlet-based app (using a proprietary framework, the bane of my existence)...and the provided XML snippet is generated in a loop....the first time through the loop the 89.51 gets truncated, the second time the 89.392 is generated. It's very odd....

But thanks for the ideas!

Paul

-----Original Message-----
From: Tim Watts [mailto:tim@cliftonfarm.org] 
Sent: Friday, September 24, 2010 6:20 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Intermittent errors usually lead me to suspect a threading issue -- either in your code or XmlBeans. Is the marshaling in your code being handled in another thread? Or perhaps there are multiple threads doing the export work from the database?

Can anyone on the list assert how thread-safe the XmlBeans marshaling is? Are there circumstances in which the marshaling would NOT be thread-safe?

As a workaround, would it be possible to convert CPTCode to a string and see if the problem persists?

(Side issue: Unless you're doing actual math with the value, it seems like string would be a better base since it's an enum. And you could validate the form with a reg-ex.)


On Fri, 2010-09-24 at 03:03 -0400, Paul Cooper wrote:
> Wing Yew,
> 
>  
> 
> Thanks for the response. I have no idea what version of XMLBeans we
> *were* using….I downloaded it and built our schema jar in March of 
> 2006. We did not find this error until we started attempting to export 
> data earlier this year. And yes, the version I’m using now is built 
> from the latest code checked out from the repository.
> 
>  
> 
> Here’s the section of the schema in question:
> 
> - <  <xs:element name="E19_03" type="Procedure">
> 
> - <       <xs:annotation>
> 
>   <             <xs:documentation>The procedure performed on the
> patient</xs:documentation>
> 
>  </xs:annotation>
> 
>   </xs:element>
> 
>  
> 
> Here’s the definition of the “Procedure” type:
> 
> <xs:simpleType name="Procedure">
> 
> <xs:annotation>
> 
> <xs:documentation>The procedure performed on the 
> patient</xs:documentation>
> 
> </xs:annotation>
> 
> <xs:union memberTypes="ProcedureCPTCode NullValues" />
> 
> </xs:simpleType>
> 
>  
> 
> And here’s the definition of the “ProcedureCPTCode” referenced above 
> (this is a subset, it’s a long list; these are EMS procedure codes):
> 
> <xs:simpleType name="ProcedureCPTCode">
> 
> <xs:restriction base="xs:decimal">
> 
> <xs:enumeration value="89.391">
> 
> <xs:annotation>
> 
> <xs:documentation>Capnography (CO2 Measurement)</xs:documentation>
> 
> </xs:annotation>
> 
> </xs:enumeration>
> 
> <xs:enumeration value="89.392">
> 
> <xs:annotation>
> 
> <xs:documentation>Pulse Oximetry</xs:documentation>
> 
> </xs:annotation>
> 
> </xs:enumeration>
> 
> <xs:enumeration value="89.510">
> 
> <xs:annotation>
> 
> <xs:documentation>Cardiac Monitor</xs:documentation>
> 
> </xs:annotation>
> 
> </xs:enumeration>
> 
> </xs:restriction>
> 
> </xs:simpleType>
> 
>  
> 
> The code to set the E19_03 element value is simple:
> 
> procInfo.setE1903(proc.getProcedurePerformed().getCode());
> 
>  
> 
> And the method getCode() is defined:
> 
> private BigDecimal myCode;
> 
> public void setCode(BigDecimal code) {
> 
> myCode = code;
> 
> }
> 
> public BigDecimal getCode() {
> 
> return myCode;
> 
> }
> 
>  
> 
> You are correct about the bug we are seeing: we are setting the value 
> to 89.51 but the XML output is 89. The XML in my last email was copied 
> directly from the XMLBeans output file. And yes, now that I look at 
> it, 89.51 will not equal 89.510, but that’s a problem for another day.
> 
>  
> 
> I just found the email my co-worker sent just before he left, and it 
> turns out he was referencing the same bug I referenced below, so there 
> is a high probability that he had no idea what he was talking about.
> Nonetheless, we are clearly having a problem…
> 
>  
> 
> Paul
> 
>  
> 
> From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
> Sent: Thursday, September 23, 2010 10:26 PM
> To: user@xmlbeans.apache.org
> Subject: RE: Error compiling schema
> 
> 
>  
> 
> Paul,
> 
> you'll have to explain a bit more what the bug is.
> 
> Can you excerpt the part of your schema that defines the type of the
> E19_03 element?
> 
> Also, how is the value of the element set?
> 
> Is the bug that you're setting E19_03 to 89.51 but when the XMLObject 
> marshalled, you get 89 in E19_03?
> 
> 
>  
> 
> 
> What version of XMLBeans are you using? Am I correct in my 
> understanding that you were using 2.5 and seeing a bug consistently, 
> and then you switched to using XMLBeans built from the latest in the 
> svn trunk and now see the bug intermittently?
> 
> 
> There haven't been that many code checkins since 2.5 was released. How 
> did your co-worker know that the bug was "fixed in the source but NOT 
> fixed in version 2.5" (meaning fixed after 2.5?)?
> 
> 
>  
> 
> 
> - Wing Yew
> 
> 
>  
> 
> 
>                                    
> ______________________________________________________________________
> From: Paul Cooper [mailto:pcooper@emspic.org]
> Sent: Thursday, September 23, 2010 7:20 PM
> To: user@xmlbeans.apache.org
> Subject: RE: Error compiling schema
> 
> Wow, I was hoping someone on the list would instantly know what I was
> talking about.   J
> 
>  
> 
> We are building an XML file from Oracle data. Periodically we get the 
> following error when validating the XML:
> 
>  
> 
> W5329436 -- union value '89' does not match any members of 'Procedure 
> in namespace http://www.nemsis.org'
> 
>  
> 
> Here is the section of the XML that is in question:
> 
>  
> 
>       <E19>
> 
>         <E19_01_0>
> 
>           <E19_01>2010-08-23T17:15:00.000Z</E19_01>
> 
>           <E19_02>0</E19_02>
> 
>           <E19_03>89.392</E19_03>
> 
>           <E19_05>1</E19_05>
> 
>           <E19_06>1</E19_06>
> 
>           <E19_07>4500</E19_07>
> 
>           <E19_08>4605</E19_08>
> 
>           <E19_09>SC008406</E19_09>
> 
>           <E19_10>4625</E19_10>
> 
>           <E19_11>-15</E19_11>
> 
>         </E19_01_0>
> 
>         <E19_01_0>
> 
>           <E19_01>2010-08-23T17:16:00.000Z</E19_01>
> 
>           <E19_02>0</E19_02>
> 
>           <E19_03>89</E19_03>
> 
>           <E19_05>1</E19_05>
> 
>           <E19_06>1</E19_06>
> 
>           <E19_07>4500</E19_07>
> 
>           <E19_08>4605</E19_08>
> 
>           <E19_09>SC008406</E19_09>
> 
>           <E19_10>4625</E19_10>
> 
>           <E19_11>-15</E19_11>
> 
>         </E19_01_0>
> 
>       </E19>
> 
>  
> 
> As you see above, there are two E19_01_0 sections, one has a E19_03 
> value of 89.392, and the other has the value of 89. Unfortunately, the 
> second value SHOULD be 89.51. My cow-orker (who has since left the
> company) indicated that this was a known problem with the version of 
> XMLBeans we were using, and had been fixed in the source but NOT fixed 
> in version 2.5….we’d have to download the source and build it 
> ourselves. Prior to building and deploying the most recent source, we 
> were having this truncation problem on every one of these records.
> Now, we get it randomly.
> 
>  
> 
> Thanks for the quick response!
> 
>  
> 
> Paul
> 
>  
> 
> From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
> Sent: Thursday, September 23, 2010 7:07 PM
> To: user@xmlbeans.apache.org
> Subject: RE: Error compiling schema
> 
> 
>  
> 
> Paul,
> 
> what is this BigDecimal truncation bug that you speak of?
> 
> - Wing Yew
> 
>  
> 
>                                    
> ______________________________________________________________________
> From: Paul Cooper [mailto:pcooper@emspic.org]
> Sent: Thursday, September 23, 2010 6:59 PM
> To: user@xmlbeans.apache.org
> Subject: Error compiling schema
> 
> Greetings, list. Longtime user of older versions of XMLBeans, and now 
> am trying to work around BigDecimal truncations when generating XML 
> from data.
> 
>  
> 
> I have downloaded the source from svn, compiled it, and am attempting 
> to build my schema library. My compilation fails with the following
> errors:
> 
>  
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src 
> genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
> 
> Time to build schema type system: 2.124 seconds
> 
> Time to generate code: 4.917 seconds
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E08Impl.java:147:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.name
> space.QName,int,short) in 
> org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to 
> (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e0801, E0801$0, i, 
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYI
> TEM);
> 
>         ^
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E09Impl.java:151:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.name
> space.QName,int,short) in 
> org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to 
> (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e0901, E0901$0, i, 
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYI
> TEM);
> 
>         ^
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E12Impl.java:817:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.name
> space.QName,int,short) in 
> org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to 
> (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e1208, E1208$10, i, 
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYI
> TEM);
> 
>         ^
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E12Impl.java:1225:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.name
> space.QName,int,short) in 
> org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to 
> (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e1210, E1210$14, i, 
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYI
> TEM);
> 
>         ^
> 
> 4 errors
> 
>  
> 
> BUILD FAILED
> 
>  
> 
> A web search reveals a JIRA bug (XMLBEANS-396) logged on this very 
> problem. I have investigated the referenced XMLBeans source to apply 
> the suggested fix, and I find that both instances of the fix have 
> already been applied in SchemaTypeCodePrinter.java.
> 
>  
> 
> All of this is to work around the BigDecimal truncation bug, which I 
> can seem to find no reference to on the web…a cow-orker who was 
> originally assigned this issue indicated that there was a fix for this 
> bug that had been checked in but was not included in the latest build.
> We have checked out the source from SVN, built the three required jar 
> files, but we are still randomly having the issue with BigDecimal 
> values being truncated.
> 
>  
> 
> Any help would be HUGELY appreciated.
> 
>  
> 
> Paul Cooper
> 
> Project Manager
> 
> EMS Performance Improvement Center
> 
> 100 Market Street
> 
> Chapel Hill, NC  27516
> 
> (919) 843-0201
> 
> 

________
It has been my experience that folks who have no vices have very few virtues.
-- Abraham Lincoln



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Error compiling schema

Posted by Tim Watts <ti...@cliftonfarm.org>.
Intermittent errors usually lead me to suspect a threading issue --
either in your code or XmlBeans. Is the marshaling in your code being
handled in another thread? Or perhaps there are multiple threads doing
the export work from the database?

Can anyone on the list assert how thread-safe the XmlBeans marshaling
is? Are there circumstances in which the marshaling would NOT be
thread-safe?

As a workaround, would it be possible to convert CPTCode to a string and
see if the problem persists?

(Side issue: Unless you're doing actual math with the value, it seems
like string would be a better base since it's an enum. And you could
validate the form with a reg-ex.)


On Fri, 2010-09-24 at 03:03 -0400, Paul Cooper wrote:
> Wing Yew,
> 
>  
> 
> Thanks for the response. I have no idea what version of XMLBeans we
> *were* using….I downloaded it and built our schema jar in March of
> 2006. We did not find this error until we started attempting to export
> data earlier this year. And yes, the version I’m using now is built
> from the latest code checked out from the repository.
> 
>  
> 
> Here’s the section of the schema in question:
> 
> - <  <xs:element name="E19_03" type="Procedure">
> 
> - <       <xs:annotation>
> 
>   <             <xs:documentation>The procedure performed on the
> patient</xs:documentation> 
> 
>  </xs:annotation>
> 
>   </xs:element>
> 
>  
> 
> Here’s the definition of the “Procedure” type:
> 
> <xs:simpleType name="Procedure">
> 
> <xs:annotation>
> 
> <xs:documentation>The procedure performed on the
> patient</xs:documentation> 
> 
> </xs:annotation>
> 
> <xs:union memberTypes="ProcedureCPTCode NullValues" /> 
> 
> </xs:simpleType>
> 
>  
> 
> And here’s the definition of the “ProcedureCPTCode” referenced above
> (this is a subset, it’s a long list; these are EMS procedure codes):
> 
> <xs:simpleType name="ProcedureCPTCode">
> 
> <xs:restriction base="xs:decimal">
> 
> <xs:enumeration value="89.391">
> 
> <xs:annotation>
> 
> <xs:documentation>Capnography (CO2 Measurement)</xs:documentation> 
> 
> </xs:annotation>
> 
> </xs:enumeration>
> 
> <xs:enumeration value="89.392">
> 
> <xs:annotation>
> 
> <xs:documentation>Pulse Oximetry</xs:documentation> 
> 
> </xs:annotation>
> 
> </xs:enumeration>
> 
> <xs:enumeration value="89.510">
> 
> <xs:annotation>
> 
> <xs:documentation>Cardiac Monitor</xs:documentation> 
> 
> </xs:annotation>
> 
> </xs:enumeration>
> 
> </xs:restriction>
> 
> </xs:simpleType>
> 
>  
> 
> The code to set the E19_03 element value is simple:
> 
> procInfo.setE1903(proc.getProcedurePerformed().getCode());
> 
>  
> 
> And the method getCode() is defined:
> 
> private BigDecimal myCode;
> 
> public void setCode(BigDecimal code) {
> 
> myCode = code;
> 
> }
> 
> public BigDecimal getCode() {
> 
> return myCode;
> 
> }
> 
>  
> 
> You are correct about the bug we are seeing: we are setting the value
> to 89.51 but the XML output is 89. The XML in my last email was copied
> directly from the XMLBeans output file. And yes, now that I look at
> it, 89.51 will not equal 89.510, but that’s a problem for another day.
> 
>  
> 
> I just found the email my co-worker sent just before he left, and it
> turns out he was referencing the same bug I referenced below, so there
> is a high probability that he had no idea what he was talking about.
> Nonetheless, we are clearly having a problem…
> 
>  
> 
> Paul
> 
>  
> 
> From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
> Sent: Thursday, September 23, 2010 10:26 PM
> To: user@xmlbeans.apache.org
> Subject: RE: Error compiling schema
> 
> 
>  
> 
> Paul,
> 
> you'll have to explain a bit more what the bug is.
> 
> Can you excerpt the part of your schema that defines the type of the
> E19_03 element?
> 
> Also, how is the value of the element set?
> 
> Is the bug that you're setting E19_03 to 89.51 but when the
> XMLObject marshalled, you get 89 in E19_03?
> 
> 
>  
> 
> 
> What version of XMLBeans are you using? Am I correct in my
> understanding that you were using 2.5 and seeing a bug consistently,
> and then you switched to using XMLBeans built from the latest in the
> svn trunk and now see the bug intermittently?
> 
> 
> There haven't been that many code checkins since 2.5 was released. How
> did your co-worker know that the bug was "fixed in the source but NOT
> fixed in version 2.5" (meaning fixed after 2.5?)?
> 
> 
>  
> 
> 
> - Wing Yew
> 
> 
>  
> 
> 
>                                    
> ______________________________________________________________________
> From: Paul Cooper [mailto:pcooper@emspic.org] 
> Sent: Thursday, September 23, 2010 7:20 PM
> To: user@xmlbeans.apache.org
> Subject: RE: Error compiling schema
> 
> Wow, I was hoping someone on the list would instantly know what I was
> talking about.   J
> 
>  
> 
> We are building an XML file from Oracle data. Periodically we get the
> following error when validating the XML:
> 
>  
> 
> W5329436 -- union value '89' does not match any members of 'Procedure
> in namespace http://www.nemsis.org'
> 
>  
> 
> Here is the section of the XML that is in question:
> 
>  
> 
>       <E19>
> 
>         <E19_01_0>
> 
>           <E19_01>2010-08-23T17:15:00.000Z</E19_01>
> 
>           <E19_02>0</E19_02>
> 
>           <E19_03>89.392</E19_03>
> 
>           <E19_05>1</E19_05>
> 
>           <E19_06>1</E19_06>
> 
>           <E19_07>4500</E19_07>
> 
>           <E19_08>4605</E19_08>
> 
>           <E19_09>SC008406</E19_09>
> 
>           <E19_10>4625</E19_10>
> 
>           <E19_11>-15</E19_11>
> 
>         </E19_01_0>
> 
>         <E19_01_0>
> 
>           <E19_01>2010-08-23T17:16:00.000Z</E19_01>
> 
>           <E19_02>0</E19_02>
> 
>           <E19_03>89</E19_03>
> 
>           <E19_05>1</E19_05>
> 
>           <E19_06>1</E19_06>
> 
>           <E19_07>4500</E19_07>
> 
>           <E19_08>4605</E19_08>
> 
>           <E19_09>SC008406</E19_09>
> 
>           <E19_10>4625</E19_10>
> 
>           <E19_11>-15</E19_11>
> 
>         </E19_01_0>
> 
>       </E19>
> 
>  
> 
> As you see above, there are two E19_01_0 sections, one has a E19_03
> value of 89.392, and the other has the value of 89. Unfortunately, the
> second value SHOULD be 89.51. My cow-orker (who has since left the
> company) indicated that this was a known problem with the version of
> XMLBeans we were using, and had been fixed in the source but NOT fixed
> in version 2.5….we’d have to download the source and build it
> ourselves. Prior to building and deploying the most recent source, we
> were having this truncation problem on every one of these records.
> Now, we get it randomly.
> 
>  
> 
> Thanks for the quick response!
> 
>  
> 
> Paul
> 
>  
> 
> From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
> Sent: Thursday, September 23, 2010 7:07 PM
> To: user@xmlbeans.apache.org
> Subject: RE: Error compiling schema
> 
> 
>  
> 
> Paul,
> 
> what is this BigDecimal truncation bug that you speak of?
> 
> - Wing Yew
> 
>  
> 
>                                    
> ______________________________________________________________________
> From: Paul Cooper [mailto:pcooper@emspic.org] 
> Sent: Thursday, September 23, 2010 6:59 PM
> To: user@xmlbeans.apache.org
> Subject: Error compiling schema
> 
> Greetings, list. Longtime user of older versions of XMLBeans, and now
> am trying to work around BigDecimal truncations when generating XML
> from data.
> 
>  
> 
> I have downloaded the source from svn, compiled it, and am attempting
> to build my schema library. My compilation fails with the following
> errors:
> 
>  
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src
> genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
> 
> Time to build schema type system: 2.124 seconds
> 
> Time to generate code: 4.917 seconds
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E08Impl.java:147:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e0801, E0801$0, i,
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
> 
>         ^
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E09Impl.java:151:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e0901, E0901$0, i,
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
> 
>         ^
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E12Impl.java:817:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e1208, E1208$10, i,
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
> 
>         ^
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E12Impl.java:1225:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e1210, E1210$14, i,
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
> 
>         ^
> 
> 4 errors
> 
>  
> 
> BUILD FAILED
> 
>  
> 
> A web search reveals a JIRA bug (XMLBEANS-396) logged on this very
> problem. I have investigated the referenced XMLBeans source to apply
> the suggested fix, and I find that both instances of the fix have
> already been applied in SchemaTypeCodePrinter.java.
> 
>  
> 
> All of this is to work around the BigDecimal truncation bug, which I
> can seem to find no reference to on the web…a cow-orker who was
> originally assigned this issue indicated that there was a fix for this
> bug that had been checked in but was not included in the latest build.
> We have checked out the source from SVN, built the three required jar
> files, but we are still randomly having the issue with BigDecimal
> values being truncated.
> 
>  
> 
> Any help would be HUGELY appreciated.
> 
>  
> 
> Paul Cooper
> 
> Project Manager
> 
> EMS Performance Improvement Center
> 
> 100 Market Street
> 
> Chapel Hill, NC  27516
> 
> (919) 843-0201
> 
> 

________
It has been my experience that folks who have no vices have very few
virtues.
-- Abraham Lincoln



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Error compiling schema

Posted by Paul Cooper <pc...@emspic.org>.
Wing Yew,

Thanks for the response. I have no idea what version of XMLBeans we *were* using....I downloaded it and built our schema jar in March of 2006. We did not find this error until we started attempting to export data earlier this year. And yes, the version I'm using now is built from the latest code checked out from the repository.

Here's the section of the schema in question:
-<http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd> <  <xs:element name="E19_03" type="Procedure">
-<http://www.nemsis.org/media/XSD/E19_InterventionProcedure.xsd> <       <xs:annotation>
  <             <xs:documentation>The procedure performed on the patient</xs:documentation>
 </xs:annotation>
  </xs:element>

Here's the definition of the "Procedure" type:
<xs:simpleType name="Procedure">
<xs:annotation>
<xs:documentation>The procedure performed on the patient</xs:documentation>
</xs:annotation>
<xs:union memberTypes="ProcedureCPTCode NullValues" />
</xs:simpleType>

And here's the definition of the "ProcedureCPTCode" referenced above (this is a subset, it's a long list; these are EMS procedure codes):
<xs:simpleType name="ProcedureCPTCode">
<xs:restriction base="xs:decimal">
<xs:enumeration value="89.391">
<xs:annotation>
<xs:documentation>Capnography (CO2 Measurement)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="89.392">
<xs:annotation>
<xs:documentation>Pulse Oximetry</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="89.510">
<xs:annotation>
<xs:documentation>Cardiac Monitor</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>

The code to set the E19_03 element value is simple:
procInfo.setE1903(proc.getProcedurePerformed().getCode());

And the method getCode() is defined:
private BigDecimal myCode;
public void setCode(BigDecimal code) {
myCode = code;
}
public BigDecimal getCode() {
return myCode;
}

You are correct about the bug we are seeing: we are setting the value to 89.51 but the XML output is 89. The XML in my last email was copied directly from the XMLBeans output file. And yes, now that I look at it, 89.51 will not equal 89.510, but that's a problem for another day.

I just found the email my co-worker sent just before he left, and it turns out he was referencing the same bug I referenced below, so there is a high probability that he had no idea what he was talking about. Nonetheless, we are clearly having a problem...

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Thursday, September 23, 2010 10:26 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
you'll have to explain a bit more what the bug is.
Can you excerpt the part of your schema that defines the type of the E19_03 element?
Also, how is the value of the element set?
Is the bug that you're setting E19_03 to 89.51 but when the XMLObject marshalled, you get 89 in E19_03?

What version of XMLBeans are you using? Am I correct in my understanding that you were using 2.5 and seeing a bug consistently, and then you switched to using XMLBeans built from the latest in the svn trunk and now see the bug intermittently?
There haven't been that many code checkins since 2.5 was released. How did your co-worker know that the bug was "fixed in the source but NOT fixed in version 2.5" (meaning fixed after 2.5?)?

- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 7:20 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
Wow, I was hoping someone on the list would instantly know what I was talking about.   :)

We are building an XML file from Oracle data. Periodically we get the following error when validating the XML:

W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Here is the section of the XML that is in question:

      <E19>
        <E19_01_0>
          <E19_01>2010-08-23T17:15:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89.392</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
        <E19_01_0>
          <E19_01>2010-08-23T17:16:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
      </E19>

As you see above, there are two E19_01_0 sections, one has a E19_03 value of 89.392, and the other has the value of 89. Unfortunately, the second value SHOULD be 89.51. My cow-orker (who has since left the company) indicated that this was a known problem with the version of XMLBeans we were using, and had been fixed in the source but NOT fixed in version 2.5....we'd have to download the source and build it ourselves. Prior to building and deploying the most recent source, we were having this truncation problem on every one of these records. Now, we get it randomly.

Thanks for the quick response!

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Thursday, September 23, 2010 7:07 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
what is this BigDecimal truncation bug that you speak of?
- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema
Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
Time to build schema type system: 2.124 seconds
Time to generate code: 4.917 seconds
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web...a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

Any help would be HUGELY appreciated.

Paul Cooper
Project Manager
EMS Performance Improvement Center
100 Market Street
Chapel Hill, NC  27516
(919) 843-0201

RE: Error compiling schema

Posted by Wing Yew Poon <wi...@oracle.com>.
Paul,
you'll have to explain a bit more what the bug is.
Can you excerpt the part of your schema that defines the type of the E19_03 element?
Also, how is the value of the element set?
Is the bug that you're setting E19_03 to 89.51 but when the XMLObject marshalled, you get 89 in E19_03?
 
What version of XMLBeans are you using? Am I correct in my understanding that you were using 2.5 and seeing a bug consistently, and then you switched to using XMLBeans built from the latest in the svn trunk and now see the bug intermittently?
There haven't been that many code checkins since 2.5 was released. How did your co-worker know that the bug was "fixed in the source but NOT fixed in version 2.5" (meaning fixed after 2.5?)?
 
- Wing Yew


  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Thursday, September 23, 2010 7:20 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema



Wow, I was hoping someone on the list would instantly know what I was talking about.   J

 

We are building an XML file from Oracle data. Periodically we get the following error when validating the XML:

 

W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

 

Here is the section of the XML that is in question:

 

      <E19>

        <E19_01_0>

          <E19_01>2010-08-23T17:15:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89.392</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

        <E19_01_0>

          <E19_01>2010-08-23T17:16:00.000Z</E19_01>

          <E19_02>0</E19_02>

          <E19_03>89</E19_03>

          <E19_05>1</E19_05>

          <E19_06>1</E19_06>

          <E19_07>4500</E19_07>

          <E19_08>4605</E19_08>

          <E19_09>SC008406</E19_09>

          <E19_10>4625</E19_10>

          <E19_11>-15</E19_11>

        </E19_01_0>

      </E19>

 

As you see above, there are two E19_01_0 sections, one has a E19_03 value of 89.392, and the other has the value of 89. Unfortunately, the second value SHOULD be 89.51. My cow-orker (who has since left the company) indicated that this was a known problem with the version of XMLBeans we were using, and had been fixed in the source but NOT fixed in version 2.5..we'd have to download the source and build it ourselves. Prior to building and deploying the most recent source, we were having this truncation problem on every one of these records. Now, we get it randomly.

 

Thanks for the quick response!

 

Paul

 

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
Sent: Thursday, September 23, 2010 7:07 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

 

Paul,

what is this BigDecimal truncation bug that you speak of?

- Wing Yew

 

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema

Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

 

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

 

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd

Time to build schema type system: 2.124 seconds

Time to generate code: 4.917 seconds

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

4 errors

 

BUILD FAILED

 

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

 

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web.a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

 

Any help would be HUGELY appreciated.

 

Paul Cooper

Project Manager

EMS Performance Improvement Center

100 Market Street

Chapel Hill, NC  27516

(919) 843-0201

RE: Error compiling schema

Posted by Paul Cooper <pc...@emspic.org>.
Wow, I was hoping someone on the list would instantly know what I was talking about.   :)

We are building an XML file from Oracle data. Periodically we get the following error when validating the XML:

W5329436 -- union value '89' does not match any members of 'Procedure in namespace http://www.nemsis.org'

Here is the section of the XML that is in question:

      <E19>
        <E19_01_0>
          <E19_01>2010-08-23T17:15:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89.392</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
        <E19_01_0>
          <E19_01>2010-08-23T17:16:00.000Z</E19_01>
          <E19_02>0</E19_02>
          <E19_03>89</E19_03>
          <E19_05>1</E19_05>
          <E19_06>1</E19_06>
          <E19_07>4500</E19_07>
          <E19_08>4605</E19_08>
          <E19_09>SC008406</E19_09>
          <E19_10>4625</E19_10>
          <E19_11>-15</E19_11>
        </E19_01_0>
      </E19>

As you see above, there are two E19_01_0 sections, one has a E19_03 value of 89.392, and the other has the value of 89. Unfortunately, the second value SHOULD be 89.51. My cow-orker (who has since left the company) indicated that this was a known problem with the version of XMLBeans we were using, and had been fixed in the source but NOT fixed in version 2.5....we'd have to download the source and build it ourselves. Prior to building and deploying the most recent source, we were having this truncation problem on every one of these records. Now, we get it randomly.

Thanks for the quick response!

Paul

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Thursday, September 23, 2010 7:07 PM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
what is this BigDecimal truncation bug that you speak of?
- Wing Yew

________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema
Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
Time to build schema type system: 2.124 seconds
Time to generate code: 4.917 seconds
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web...a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

Any help would be HUGELY appreciated.

Paul Cooper
Project Manager
EMS Performance Improvement Center
100 Market Street
Chapel Hill, NC  27516
(919) 843-0201

RE: Error compiling schema

Posted by Wing Yew Poon <wi...@oracle.com>.
Paul,
what is this BigDecimal truncation bug that you speak of?
- Wing Yew

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema



Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

 

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

 

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd

Time to build schema type system: 2.124 seconds

Time to generate code: 4.917 seconds

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

4 errors

 

BUILD FAILED

 

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

 

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web.a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

 

Any help would be HUGELY appreciated.

 

Paul Cooper

Project Manager

EMS Performance Improvement Center

100 Market Street

Chapel Hill, NC  27516

(919) 843-0201

RE: Error compiling schema

Posted by Tim Watts <ti...@cliftonfarm.org>.
Hopefully 2.5.0 will fix things. But if it doesn't, since you mentioned
that a servlet is generating the XML (via XmlBeans) you've got a
multi-threaded context right there. Perhaps there are pertinent data
fields declared in the servlet scope (directly or indirectly)?


On Fri, 2010-09-24 at 14:33 -0400, Paul Cooper wrote:
> Hmmm. I hadn’t thought of that. I’ll try it and see what happens!
> Thanks.
> 
>  
> 
> Forest and trees and stuff…..
> 
>  
> 
> From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com] 
> Sent: Friday, September 24, 2010 11:10 AM
> To: user@xmlbeans.apache.org
> Subject: RE: Error compiling schema
> 
> 
>  
> 
> Paul,
> 
> since it appears that your former co-worker was thinking of a
> different bug than the truncation problem you're seeing, there is no
> gain for you to live on the bleeding edge of XMLBeans. Why don't you
> try using the released XMLBeans 2.5.0 and recompile your schema? Let
> us know if compilation still fails.
> 
> - Wing Yew
> 
> 
>                                    
> ______________________________________________________________________
> From: Paul Cooper [mailto:pcooper@emspic.org] 
> Sent: Friday, September 24, 2010 9:14 AM
> To: user@xmlbeans.apache.org
> Subject: RE: Error compiling schema
> 
> The compilation errors below are also a huge problem, because I cannot
> regenerate my schema jar.
> 
>  
> 
> From: Paul Cooper [mailto:pcooper@emspic.org] 
> Sent: Thursday, September 23, 2010 6:59 PM
> To: user@xmlbeans.apache.org
> Subject: Error compiling schema
> 
> 
>  
> 
> Greetings, list. Longtime user of older versions of XMLBeans, and now
> am trying to work around BigDecimal truncations when generating XML
> from data.
> 
>  
> 
> I have downloaded the source from svn, compiled it, and am attempting
> to build my schema library. My compilation fails with the following
> errors:
> 
>  
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src
> genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
> 
> Time to build schema type system: 2.124 seconds
> 
> Time to generate code: 4.917 seconds
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E08Impl.java:147:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e0801, E0801$0, i,
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
> 
>         ^
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E09Impl.java:151:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e0901, E0901$0, i,
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
> 
>         ^
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E12Impl.java:817:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e1208, E1208$10, i,
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
> 
>         ^
> 
> C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org
> \nemsis\impl\E12Impl.java:1225:
> generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
> 
>         generatedSetterHelperImpl(e1210, E1210$14, i,
> org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
> 
>         ^
> 
> 4 errors
> 
>  
> 
> BUILD FAILED
> 
>  
> 
> A web search reveals a JIRA bug (XMLBEANS-396) logged on this very
> problem. I have investigated the referenced XMLBeans source to apply
> the suggested fix, and I find that both instances of the fix have
> already been applied in SchemaTypeCodePrinter.java.
> 
>  
> 
> All of this is to work around the BigDecimal truncation bug, which I
> can seem to find no reference to on the web…a cow-orker who was
> originally assigned this issue indicated that there was a fix for this
> bug that had been checked in but was not included in the latest build.
> We have checked out the source from SVN, built the three required jar
> files, but we are still randomly having the issue with BigDecimal
> values being truncated.
> 
>  
> 
> Any help would be HUGELY appreciated.
> 
>  
> 
> Paul Cooper
> 
> Project Manager
> 
> EMS Performance Improvement Center
> 
> 100 Market Street
> 
> Chapel Hill, NC  27516
> 
> (919) 843-0201
> 
> 

________
The worst loneliness is not to be comfortable with yourself.
-- Mark Twain



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Error compiling schema

Posted by Paul Cooper <pc...@emspic.org>.
Hmmm. I hadn't thought of that. I'll try it and see what happens! Thanks.

Forest and trees and stuff.....

From: Wing Yew Poon [mailto:wing.yew.poon@oracle.com]
Sent: Friday, September 24, 2010 11:10 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema

Paul,
since it appears that your former co-worker was thinking of a different bug than the truncation problem you're seeing, there is no gain for you to live on the bleeding edge of XMLBeans. Why don't you try using the released XMLBeans 2.5.0 and recompile your schema? Let us know if compilation still fails.
- Wing Yew
________________________________
From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Friday, September 24, 2010 9:14 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema
The compilation errors below are also a huge problem, because I cannot regenerate my schema jar.

From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema

Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
Time to build schema type system: 2.124 seconds
Time to generate code: 4.917 seconds
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web...a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

Any help would be HUGELY appreciated.

Paul Cooper
Project Manager
EMS Performance Improvement Center
100 Market Street
Chapel Hill, NC  27516
(919) 843-0201

RE: Error compiling schema

Posted by Wing Yew Poon <wi...@oracle.com>.
Paul,
since it appears that your former co-worker was thinking of a different bug than the truncation problem you're seeing, there is no gain for you to live on the bleeding edge of XMLBeans. Why don't you try using the released XMLBeans 2.5.0 and recompile your schema? Let us know if compilation still fails.
- Wing Yew

  _____  

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Friday, September 24, 2010 9:14 AM
To: user@xmlbeans.apache.org
Subject: RE: Error compiling schema



The compilation errors below are also a huge problem, because I cannot regenerate my schema jar.

 

From: Paul Cooper [mailto:pcooper@emspic.org] 
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema

 

Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

 

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

 

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd

Time to build schema type system: 2.124 seconds

Time to generate code: 4.917 seconds

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)

        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);

        ^

4 errors

 

BUILD FAILED

 

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

 

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web.a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

 

Any help would be HUGELY appreciated.

 

Paul Cooper

Project Manager

EMS Performance Improvement Center

100 Market Street

Chapel Hill, NC  27516

(919) 843-0201

RE: Error compiling schema

Posted by Paul Cooper <pc...@emspic.org>.
The compilation errors below are also a huge problem, because I cannot regenerate my schema jar.

From: Paul Cooper [mailto:pcooper@emspic.org]
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema

Greetings, list. Longtime user of older versions of XMLBeans, and now am trying to work around BigDecimal truncations when generating XML from data.

I have downloaded the source from svn, compiled it, and am attempting to build my schema library. My compilation fails with the following errors:

C:\Dev\Projects\PreMIS_MultiState2\devlib\test>scomp -src genXmlBeansSrc -out EMSDataSetXMLBeans.jar NEMSIS\EMSDataSet.xsd
Time to build schema type system: 2.124 seconds
Time to generate code: 4.917 seconds
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E08Impl.java:147: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0801, E0801$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E09Impl.java:151: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e0901, E0901$0, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:817: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1208, E1208$10, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
C:\Dev\Projects\PreMIS_MultiState2\devlib\test\genXmlBeansSrc\org\nemsis\impl\E12Impl.java:1225: generatedSetterHelperImpl(org.apache.xmlbeans.XmlObject,javax.xml.namespace.QName,int,short) in org.apache.xmlbeans.impl.values.XmlObjectBase cannot be applied to (java.lang.Object,javax.xml.namespace.QName,int,short)
        generatedSetterHelperImpl(e1210, E1210$14, i, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_ARRAYITEM);
        ^
4 errors

BUILD FAILED

A web search reveals a JIRA bug (XMLBEANS-396) logged on this very problem. I have investigated the referenced XMLBeans source to apply the suggested fix, and I find that both instances of the fix have already been applied in SchemaTypeCodePrinter.java.

All of this is to work around the BigDecimal truncation bug, which I can seem to find no reference to on the web...a cow-orker who was originally assigned this issue indicated that there was a fix for this bug that had been checked in but was not included in the latest build. We have checked out the source from SVN, built the three required jar files, but we are still randomly having the issue with BigDecimal values being truncated.

Any help would be HUGELY appreciated.

Paul Cooper
Project Manager
EMS Performance Improvement Center
100 Market Street
Chapel Hill, NC  27516
(919) 843-0201