Skip to Content.
Sympa Menu

mace-opensaml-users - Fwd: SAMLException and StatusMessage element

Subject: OpenSAML user discussion

List archive

Fwd: SAMLException and StatusMessage element


Chronological Thread 
  • From: mochamaster <>
  • To: saml <>
  • Subject: Fwd: SAMLException and StatusMessage element
  • Date: Thu, 10 Apr 2003 13:45:36 -0700 (PDT)


i could get around the ctor ambiguitiy problem by
casting (String) null. But the bug still stands.

Note: forwarded message attached.


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
--- Begin Message ---
  • From: mochamaster <>
  • To:
  • Subject: SAMLException and StatusMessage element
  • Date: Thu, 10 Apr 2003 13:09:10 -0700 (PDT)
I receive a NullPointerException when "fromDOMing" a
Response with an empty StatusMessage:

<Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol"
xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"
InResponseTo="066c27af-771a-4a7c-a8f3-48854d519f1f"
IssueInstant="2003-04-10T19:34:11Z" MajorVersion="1"
MinorVersion="0"
ResponseID="f516b30f-83e6-4e85-8f31-29be55d2fbc9">
<Status>
<StatusCode Value="samlp:Success" />
<StatusMessage />
</Status>
<Assertion
xmlns="urn:oasis:names:tc:SAML:1.0:assertion"
AssertionID="a1bac44b-9e62-41d3-ae6a-0cb799617dc3"
IssueInstant="2003-04-10T19:34:11Z"
Issuer="DAS-NYSECAP" MajorVersion="1"
MinorVersion="0">
<Conditions NotBefore="2003-04-10T19:34:11Z"
NotOnOrAfter="2003-05-10T19:34:11Z" />
<AuthenticationStatement
AuthenticationInstant="2003-04-10T19:34:11Z"
AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password">
<Subject>
<NameIdentifier
NameQualifier="user">nxlabjp4</NameIdentifier>
</Subject>
</AuthenticationStatement>
</Assertion>
</Response>



java.lang.NullPointerException
at
org.opensaml.SAMLException.fromDOM(SAMLException.java:373)
at
org.opensaml.SAMLException.<init>(SAMLException.java:230)
at
org.opensaml.SAMLException.getInstance(SAMLException.java:184)
at
org.opensaml.SAMLResponse.fromDOM(SAMLResponse.java:180)
at
org.opensaml.SAMLResponse.<init>(SAMLResponse.java:126)


I don't want to set a StatusMessage value. My code
uses

new SAMLException( SAMLException.SUCCESS, "")
in a new SAMLResponse(..) constructor

the "" indicates the status message and is converted
to <StatusMessage /> in toDOM(..). I recommend that
the element is not created if the value is "" (however
a null check is performed).

The existance of the StatusMessage element causes
fromDOM to assume that it has a value and the NPE
occurs there (msg=m.getFirstChild().getNodeValue()).

However there is no way to pass a null Status Message
to the constructor because it creates an ambiguous
ctor call case with SAMLException(QName,String) and
SAMLException(QName,Exception) ctors.



__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com


--- End Message ---



Archive powered by MHonArc 2.6.16.

Top of Page