geronimo-xbean-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashish Gupta (JIRA)" <>
Subject [jira] Created: (XBEAN-116) XmlValueOutOfRangeException
Date Thu, 30 Oct 2008 20:30:44 GMT

                 Key: XBEAN-116
             Project: XBean
          Issue Type: Bug
    Affects Versions: 2.4
         Environment: Windows XP, Java 1.5.0_12, Xbean 2.4, Eclipse 3.4
            Reporter: Ashish Gupta
            Priority: Critical


In our project, we are creating the xml messages using XMLBeans on the wire & send it
back to the client.

Snippet of code which creates the xml messages using XmlBeans is given below. 
Bold text is the place where I got the error. The String value of Enum which I am setting
up is "duplicateMessageID" (required as per business norms).
If I use string value as "invalidMessageID" the XmlBeans doesn't complaint. Is there any length
constrainst in setting up the string value.

StreamErrorBodyRequestT respType = cuppsIlType.addNewStreamErrorBodyRequest();

NOTE:  Error which I obtained is given below in red. The error which I got is XmlValueOutOfRangeException,
I checked for different postings on internet about it. On one posting I find out that guy
name Lawrence Jones mentioned about "JavaBase64Holder.lex() simply converts the String to
UTF-8 bytes and then passes those bytes into Base64.decode() which must be returning null
for you to see this error". So I created a simple test case shown below 

	String temp ="duplicateMessageID";
	byte[] utf8Bytes = temp.getBytes("UTF8");
	String value = org.apache.xerces.impl.dv.util.Base64.encode(utf8Bytes);
	System.out.println(" The value is "+value);
	It produces the result :  The value is ZHVwbGljYXRlTWVzc2FnZUlE
	Which shows that string is coming correct but somehow XmlBeans is not liking something in

Can you please let me know is this a Bug or I am soing something wrong in the code. I would
really appreciate if I get any reply asap.

org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: Invalid value: not encoded properly
	at org.apache.xmlbeans.impl.values.XmlObjectBase$ValueOutOfRangeValidationContext.invalid(
	at org.apache.xmlbeans.impl.values.JavaBase64Holder.lex(
	at org.apache.xmlbeans.impl.values.JavaBase64HolderEx.set_text(
	at org.apache.xmlbeans.impl.values.XmlObjectBase.update_from_wscanon_text(
	at org.apache.xmlbeans.impl.values.XmlObjectBase.set_String(
	at org.apache.xmlbeans.impl.values.XmlObjectBase.setStringValue(
	at com.arinc.afd.cupps.application.AppSocketHoldingPin.dispatchCuppsMessage(
	at com.arinc.afd.cupps.application.AppSocketHoldingPin.dispatchMessage(

Thanks & Regards,

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message