You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Tor Arne Kvaløy <to...@pvv.org> on 2008/10/01 12:43:39 UTC

Strange behaviour after element is set to null

Hello,

I am experiencing a very strange behavior when an element is set to null and
then assigned an value. 

invoice.setTermsOfPaymentId(null);
invoice.setTermsOfPaymentId(BigInteger.valueOf(10));
invoice.getTermsOfPaymentId();

What's really strange is that this works fine when i run this code from
within Eclipse, however when I run it with Maven it fails with the following
error:
java.lang.AssertionError
	at org.apache.xmlbeans.impl.store.Xobj.fetch_text(Xobj.java:1794)
	at
org.apache.xmlbeans.impl.values.XmlObjectBase.get_wscanon_text(XmlObjectBase.java:1332)
	at
org.apache.xmlbeans.impl.values.XmlObjectBase.check_dated(XmlObjectBase.java:1269)
	at
org.apache.xmlbeans.impl.values.JavaIntegerHolder.bigIntegerValue(JavaIntegerHolder.java:58)
	at
org.apache.xmlbeans.impl.values.XmlObjectBase.getBigIntegerValue(XmlObjectBase.java:1504)
	at
no.avinor.pub.domain.invoice.v1.impl.InvoiceImpl.getTermsOfPaymentId(Unknown
Source)
	at
no.avinor.invoiceservice.ws.SubmitInvoiceEndpointTest.noTermsOfPayment(SubmitInvoiceEndpointTest.java:367)

I have tried to figure out of there is a different jars, but they look the
same (the eclipse project is generated via maven).

So I am curious if anyone has any suggestions for what might be wrong?

My pom has this:
<dependency>
	<groupId>org.apache.xmlbeans</groupId>
	<artifactId>xmlbeans</artifactId>
	<version>2.4.0</version>
</dependency>
<dependency>
	<groupId>xerces</groupId>
	<artifactId>xercesImpl</artifactId>
	<version>2.8.1</version>
</dependency>
<dependency>
	<groupId>xalan</groupId>
	<artifactId>xalan</artifactId>
	<version>2.7.0</version>
</dependency>

Thanks,
Tor 

-- 
View this message in context: http://www.nabble.com/Strange-behaviour-after-element-is-set-to-null-tp19757955p19757955.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


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


RE: Strange behaviour after element is set to null

Posted by Radu Preotiuc-Pietro <ra...@oracle.com>.
Better late than never... I finally got around to trying this out myself, and what happens is that simply when you run the code in Maven, the JVM somehow is started with the "-ea" switch, while when running in Eclipse it is not.

I will have to open a JIRA issue for this to see if the assert is really correct since the code seems to be working well even when the assert gets fired.

Radu 

> -----Original Message-----
> From: Tor Arne Kvaløy [mailto:torarnek@pvv.org] 
> Sent: Wednesday, October 01, 2008 6:44 AM
> To: user@xmlbeans.apache.org
> Subject: Strange behaviour after element is set to null
> 
> 
> Hello,
> 
> I am experiencing a very strange behavior when an element is 
> set to null and then assigned an value.
> 
> invoice.setTermsOfPaymentId(null);
> invoice.setTermsOfPaymentId(BigInteger.valueOf(10));
> invoice.getTermsOfPaymentId();
> 
> What's really strange is that this works fine when i run this 
> code from within Eclipse, however when I run it with Maven it 
> fails with the following
> error:
> java.lang.AssertionError
> 	at 
> org.apache.xmlbeans.impl.store.Xobj.fetch_text(Xobj.java:1794)
> 	at
> org.apache.xmlbeans.impl.values.XmlObjectBase.get_wscanon_text
> (XmlObjectBase.java:1332)
> 	at
> org.apache.xmlbeans.impl.values.XmlObjectBase.check_dated(XmlO
> bjectBase.java:1269)
> 	at
> org.apache.xmlbeans.impl.values.JavaIntegerHolder.bigIntegerVa
> lue(JavaIntegerHolder.java:58)
> 	at
> org.apache.xmlbeans.impl.values.XmlObjectBase.getBigIntegerVal
> ue(XmlObjectBase.java:1504)
> 	at
> no.avinor.pub.domain.invoice.v1.impl.InvoiceImpl.getTermsOfPay
> mentId(Unknown
> Source)
> 	at
> no.avinor.invoiceservice.ws.SubmitInvoiceEndpointTest.noTermsO
> fPayment(SubmitInvoiceEndpointTest.java:367)
> 
> I have tried to figure out of there is a different jars, but 
> they look the same (the eclipse project is generated via maven).
> 
> So I am curious if anyone has any suggestions for what might be wrong?
> 
> My pom has this:
> <dependency>
> 	<groupId>org.apache.xmlbeans</groupId>
> 	<artifactId>xmlbeans</artifactId>
> 	<version>2.4.0</version>
> </dependency>
> <dependency>
> 	<groupId>xerces</groupId>
> 	<artifactId>xercesImpl</artifactId>
> 	<version>2.8.1</version>
> </dependency>
> <dependency>
> 	<groupId>xalan</groupId>
> 	<artifactId>xalan</artifactId>
> 	<version>2.7.0</version>
> </dependency>
> 
> Thanks,
> Tor
> 
> --
> View this message in context: 
> http://www.nabble.com/Strange-behaviour-after-element-is-set-t
> o-null-tp19757955p19757955.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 


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