Exception while unmarshalling Integer with an element bigger than 32-bit
Maxime Gregoire
Maxime.Gregoire at eidosmontreal.com
Mon Jun 4 15:20:05 BST 2012
Hello!
I am using OpenSAML 2.5.3 since its release, but recently I started
having the following exception:
java.lang.NumberFormatException: For input string: "2535285330239773"
at
java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.valueOf(Unknown Source)
at
org.opensaml.xml.schema.impl.XSIntegerUnmarshaller.processElementContent
(XSIntegerUnmarshaller.java:47)
at
org.opensaml.xml.io.AbstractXMLObjectUnmarshaller.unmarshallTextContent(
AbstractXMLObjectUnmarshaller.java:351)
at
org.opensaml.xml.io.AbstractXMLObjectUnmarshaller.unmarshall(AbstractXML
ObjectUnmarshaller.java:124)
at
org.opensaml.xml.io.AbstractXMLObjectUnmarshaller.unmarshallChildElement
(AbstractXMLObjectUnmarshaller.java:335)
at
org.opensaml.xml.io.AbstractXMLObjectUnmarshaller.unmarshall(AbstractXML
ObjectUnmarshaller.java:122)
at
org.opensaml.xml.io.AbstractXMLObjectUnmarshaller.unmarshallChildElement
(AbstractXMLObjectUnmarshaller.java:335)
at
org.opensaml.xml.io.AbstractXMLObjectUnmarshaller.unmarshall(AbstractXML
ObjectUnmarshaller.java:122)
at
org.opensaml.xml.io.AbstractXMLObjectUnmarshaller.unmarshallChildElement
(AbstractXMLObjectUnmarshaller.java:335)
at
org.opensaml.xml.io.AbstractXMLObjectUnmarshaller.unmarshall(AbstractXML
ObjectUnmarshaller.java:122)
at
org.opensaml.xml.encryption.Decrypter.decryptDataToList(Decrypter.java:4
68)
at
org.opensaml.xml.encryption.Decrypter.decryptData(Decrypter.java:401)
at
org.opensaml.saml2.encryption.Decrypter.decryptData(Decrypter.java:141)
at
org.opensaml.saml2.encryption.Decrypter.decrypt(Decrypter.java:69)
...
I started getting this since the provider sending me an encrypted
assertion added a new claim to the assertion that is based on the
http://www.w3.org/2001/XMLSchema#integer format. The value used for this
claim is 2535285330239773, which is a 64-bit value. Since
XSIntegerUnmarshaller tries to convert the received value into an
Integer using Integer.valueOf("2535285330239773"), I do get the
exception (2535285330239773 > 32-bit value).
I went to see what http://www.w3.org/2001/XMLSchema has to say about
#integer. Section 3.3.13 says that the value space of integer is the
infinite set. It specifically calls out that the value can be infinite,
so I'm guessing that sending a value bigger than 32-bit using #integer
is valid. Is there a reason why something received with #integer does
not fallback to a bigger format (Long) if the conversion fails because
of busting the size of a 32-bit value?
As it is almost impossible for me to change the
http://www.w3.org/2001/XMLSchema#integer type sent from the third-party
assertion provider, is there a way to fix this issue? Could it be a
problem on the OpenSAML/XMLTooling side?
Best Regards,
Maxime
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/users/attachments/20120604/e633a059/attachment-0001.html
More information about the users
mailing list