RespondingGateway_PRPA_IN201305UV02 has thrown exception, unwinding now java.lang.NullPointerException

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RespondingGateway_PRPA_IN201305UV02 has thrown exception, unwinding now java.lang.NullPointerException

johnhd_at_zen
This post was updated on .
I'm receiving a test message (no PHI). (NOTE: All distinguishing marks such as oids and URLs have been removed/altered for the sake of cleanliness)

<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
	<env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
		<wsa:Action env:mustUnderstand="1">urn:hl7-org:v3:PRPA_IN201305UV02:CrossGatewayPatientDiscovery</wsa:Action>
		<wsa:To env:mustUnderstand="1" wsu:Id="_0">https://MYGATEWAY.org:14430/Gateway/PatientDiscovery/1_0/NhinService/NhinPatientDiscovery</wsa:To>
		<wsa:MessageID>urn:uuid:dd7d7ac8-672a-11e7-9670-5a2e6c51ec88</wsa:MessageID>
		<wsa:From>
			<wsa:Address>urn:oid:VALID.PATNER.OID</wsa:Address>
		</wsa:From>
		<wsse:Security env:mustUnderstand="1" xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
			<saml:Assertion ID="_1.3.6.1.4.1.21367.2010.1.2.345.172.28.27.85.131542.1499881946.2080" IssueInstant="2017-07-12T17:52:26Z" Version="2.0" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
				<saml:Issuer>self</saml:Issuer>
				<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
					<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
						<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
						<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
						<Reference URI="#_1.3.6.1.4.1.21367.2010.1.2.345.172.28.27.85.131542.1499881946.2080">
							<Transforms>
								<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
								<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
							</Transforms>
							<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
							<DigestValue>lEmT2Ey/XjZnO26a6QwT7NIxNKk=</DigestValue>
						</Reference>
					</SignedInfo>
					<SignatureValue>Hd+FeLANRqX3hOxcwUqhtVXrKEciEZvyf9+TvP4tPQmL97/yu+9nrEfRYcjpbfMzBQSTrE5FHimvpbIjwlQAfkOPkMfYKjsIjXTvyEqQmrSFN06TYyQJACy2zzJR8aCH8+A7oon32CGKaOFUItsx9iO0A+q+tNGa8s2ymMlofhKygkgoO5YzJ7Bfbhd3SuQHvnWuHRx1d8th3JFaXwGo9WXG8++2uFDb0PvUKa8rf7rfag6s3VSpMLaRBhRsS5LQV8r4Bv7PboKpe1XOjHCyIuVe46ZuW3I/lTVU9utIJpyPAnTalLNl4B/jispUDMR7nlI8Xak8ZND4jksD1VPD4w==</SignatureValue>
					<KeyInfo>
						<X509Data>
							<X509Certificate>REMOVED</X509Certificate>
						</X509Data>
					</KeyInfo>
				</Signature>
				<saml:Subject>
					<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"/>
				</saml:Subject>
				<saml:Conditions NotBefore="2017-07-12T17:52:26Z" NotOnOrAfter="2017-07-12T17:57:26Z">
					<saml:AudienceRestriction>
						<saml:Audience>https://MyGATEWAY.org:14430/Gateway/PatientDiscovery/1_0/NhinService/NhinPatientDiscovery</saml:Audience>
					</saml:AudienceRestriction>
				</saml:Conditions>
				<saml:AuthnStatement AuthnInstant="2017-07-12T17:52:26Z">
					<saml:AuthnContext>
						<saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
					</saml:AuthnContext>
				</saml:AuthnStatement>
				<saml:AttributeStatement>
					<saml:Attribute Name="urn:oasis:names:tc:xacml:1.0:subject:subject-id">
						<saml:AttributeValue>REMOVED</saml:AttributeValue>
					</saml:Attribute>
					<saml:Attribute Name="urn:oasis:names:tc:xpsa:1.0:subject:organization">
						<saml:AttributeValue>REMOVED</saml:AttributeValue>
					</saml:Attribute>
					<saml:Attribute Name="urn:oasis:names:tc:xacml:2.0:subject:role">
						<saml:AttributeValue>
							<Role code="223366009" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Healthcare professional" xmlns="urn:hl7-org:v3" xsi:type="CE"/>
						</saml:AttributeValue>
					</saml:Attribute>
					<saml:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:purposeofuse">
						<saml:AttributeValue>
							<PurposeOfUse code="TREATMENT" codeSystem="2.16.840.1.113883.18.7.1" codeSystemName="nhin-purpose" displayName="Treatment" xmlns="urn:hl7-org:v3" xsi:type="CE"/>
						</saml:AttributeValue>
					</saml:Attribute>
					<saml:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:organization-id">
						<saml:AttributeValue>urn:oid:VALID.PATNER.OID</saml:AttributeValue>
					</saml:Attribute>
					<saml:Attribute Name="urn:nhin:names:saml:homeCommunityId">
						<saml:AttributeValue>urn:oid:VALID.PATNER.OID</saml:AttributeValue>
					</saml:Attribute>
				</saml:AttributeStatement>
			</saml:Assertion>
		</wsse:Security>
	</env:Header>
	<env:Body>
		<PRPA_IN201305UV02 ITSVersion="XML_1.0" xmlns="urn:hl7-org:v3" xmlns:PARTNERNAME="urn:PARTNERNAME" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
			<id extension="1260915" root="2.16.840.1.113883.3.564.1.10"/>
			<creationTime value="20170712000000"/>
			<interactionId extension="PRPA_IN201305UV02" root="2.16.840.1.113883.1.6"/>
			<processingCode code="P"/>
			<processingModeCode code="T"/>
			<acceptAckCode code="AL"/>
			<receiver typeCode="RCV">
				<device classCode="DEV" determinerCode="INSTANCE">
					<id root="2.16.840.1.113883.3.290.100"/>
				</device>
			</receiver>
			<sender typeCode="SND">
				<device classCode="DEV" determinerCode="INSTANCE">
					<id root="2.16.840.1.113883.3.564.1"/>
					<asAgent classCode="AGNT">
						<representedOrganization classCode="ORG" determinerCode="INSTANCE">
							<id root="2.16.840.1.113883.3.564.1"/>
						</representedOrganization>
					</asAgent>
				</device>
			</sender>
			<controlActProcess classCode="CACT" moodCode="EVN">
				<code code="PRPA_TE201305UV02" codeSystem="2.16.840.1.113883.1.6"/>
				<queryByParameter>
					<queryId extension="1260915" root="2.16.840.1.113883.3.564.1.10"/>
					<statusCode code="new"/>
					<responseModalityCode code="R"/>
					<responsePriorityCode code="I"/>
					<parameterList>
						<patientAddress>
							<value>
								<streetAddressLine>123 Fake Street</streetAddressLine>
								<city>SOMEWHERE</city>
								<state>MA</state>
								<postalCode>99999</postalCode>
							</value>
							<semanticsText>Patient.addr</semanticsText>
						</patientAddress>
						<livingSubjectBirthTime>
							<value value="19010101"/>
							<semanticsText>LivingSubject.birthTime</semanticsText>
						</livingSubjectBirthTime>
						<patientTelecom>
							<value use="HP" value="tel:+1-999-999-9999"/>
							<semanticsText>Patient.telecom</semanticsText>
						</patientTelecom>
						<livingSubjectName>
							<value use="SRCH">
								<given>BRITTANY</given>
								<family>TEST</family>
							</value>
							<semanticsText>LivingSubject.name</semanticsText>
						</livingSubjectName>
						<patientTelecom>
							<value use="MC" value="tel:+1-999-999-9999"/>
							<semanticsText>Patient.telecom</semanticsText>
						</patientTelecom>
						<livingSubjectAdministrativeGender>
							<value code="F"/>
							<semanticsText>LivingSubject.administrativeGender</semanticsText>
						</livingSubjectAdministrativeGender>
						<livingSubjectId>
							<value extension="000000000" root="2.16.840.1.113883.4.1"/>
							<semanticsText>LivingSubject.id</semanticsText>
						</livingSubjectId>
					</parameterList>
				</queryByParameter>
			</controlActProcess>
		</PRPA_IN201305UV02>
	</env:Body>
</env:Envelope>

Which I've gone over with a fine-toothed comb and everything looks fine to me. We're getting a very vague NPE without a stacktrace though upon receipt and then reply with a 500 in CONNECT 4.4.1:

[#|2017-07-12T10:52:26.974-0700|WARNING|glassfish3.1.2|org.apache.cxf.phase.PhaseInterceptorChain|_ThreadID=321;_ThreadName=Thread-2;|Interceptor for {urn:ihe:iti:xcpd:2009}RespondingGateway_Service#{urn:ihe:iti:xcpd:2009}RespondingGateway_PRPA_IN201305UV02 has thrown exception, unwinding now
java.lang.NullPointerException
|#]


[#|2017-07-12T10:52:26.975-0700|INFO|glassfish3.1.2|org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor|_ThreadID=321;_ThreadName=Thread-2;|class org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor$Soap12FaultOutInterceptorInternalapplication/soap+xml|#]

[#|2017-07-12T10:52:26.975-0700|WARNING|glassfish3.1.2|gov.hhs.fha.nhinc.callback.SOAPHeaderHandler|_ThreadID=321;_ThreadName=Thread-2;|SoapHeaderHandler.handleFault|#]

[#|2017-07-12T10:52:26.976-0700|WARNING|glassfish3.1.2|gov.hhs.fha.nhinc.logging.transaction.TransactionHandler|_ThreadID=321;_ThreadName=Thread-2;|TransactionHandler.handleFault|#]

[#|2017-07-12T10:52:26.977-0700|INFO|glassfish3.1.2|org.apache.cxf.services.RespondingGateway_Service.RespondingGateway_Port_Soap.RespondingGateway_PortType|_ThreadID=321;_ThreadName=Thread-2;|Outbound Message
---------------------------
ID: 144273
Response-Code: 500
Encoding: UTF-8
Content-Type: application/soap+xml
Headers: {}
Payload: <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><Action xmlns="http://www.w3.org/2005/08/addressing" soap:mustUnderstand="true">urn:ihe:iti:xcpd:2009:RespondingGateway_PortType:RespondingGateway_PRPA_IN201305UV02:Fault:NullPointerException</Action><MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:eb8a00cf-604c-42de-b22c-7499fcdd72c8</MessageID><To xmlns="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</To><RelatesTo xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:dd7d7ac8-672a-11e7-9670-5a2e6c51ec88</RelatesTo></soap:Header><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Fault occurred while processing.</soap:Text></soap:Reason></soap:Fault></soap:Body></soap:Envelope>
--------------------------------------|#]

I dug into this some and I thought that this:

Might be pointing me to the "Receiver" element in the SOAP body. I noticed that the "Receiver" element did not have an "asAgent" element under the "device" element, which per some research it looked like CONNECT might require (http://exchange-specifications.wikispaces.com/share/view/40613129?replyId=40684511). But I had the partner add it:

            <receiver typeCode="RCV">
                <device classCode="DEV" determinerCode="INSTANCE">
                    <id root="GOOD.OID.HERE"/>
                    <asAgent classCode="AGNT">
                        <representedOrganization classCode="ORG" determinerCode="INSTANCE">
                            <id root="GOOD.OID.HERE"/>
                        </representedOrganization>
                    </asAgent>
                </device>
            </receiver>

And the "stacktrace" and response is identical.

A couple other thoughts:

Having the canonical declaration at the top, "<?xml version="1.0"?>", I don't see this often. I doubt this could be a problem but... It stands out?

Also I noticed this odd looking namespace: "<PRPA_IN201305UV02 ITSVersion="XML_1.0" xmlns="urn:hl7-org:v3" xmlns:PARTNERNAME="urn:PARTNERNAME" ". Again I think it'd just be ignored- it's not used anywhere- but I'm grasping at straws here. (To clarify, there's a real organization name there, I've just subbed it out for "PARTNERNAME")

I don't have much to go on in that error, unless I'm missing something obvious. Any thoughts would be appreciated. :)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RespondingGateway_PRPA_IN201305UV02 has thrown exception, unwinding now java.lang.NullPointerException

Sovann Huynh
Administrator
Hi John, that is a required element. As you're the responder, can you ask them to populate those GOOD.OID.HERE values with your actual HCID and see what that does?
Sovann
CONNECT Product Team Member
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RespondingGateway_PRPA_IN201305UV02 has thrown exception, unwinding now java.lang.NullPointerException

johnhd_at_zen
Thanks for the response Sovann,

They have our oid in there. I removed it for cleanliness purposes when posting it here to this forum.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RespondingGateway_PRPA_IN201305UV02 has thrown exception, unwinding now java.lang.NullPointerException

johnhd_at_zen
I've, I think, figured out two possible approaches.

One, I've turned logging to "Fine" on org.apache.cxf.phase.PhaseInterceptorChain in glassfish (our particular application server). Waiting for results.

Another, which I need advice on, is I think the stacktrace is being snipped for security/cleanliness purposes. Some research seems to point to, if I could add this "<entry key="faultStackTraceEnabled" value="true" />" config for cfx which I found here:

http://cxf.apache.org/docs/debugging-and-logging.html#DebuggingandLogging-Configurelogginglevels

It may not "hide" the stacktrace from me. However, I'm not sure exactly how to configure this (e.g. the values for:  id, address, wsdlURL, endpointName, serviceName, xmlns:s, etc:

<jaxws:endpoint id="server" address="http://localhost:9002/TestMessage"
   wsdlURL="ship.wsdl"
   endpointName="s:TestSoapEndpoint"
   serviceName="s:TestService"
   xmlns:s="http://test" >
   <jaxws:properties>     
      <entry key="faultStackTraceEnabled" value="true" />
   </jaxws:properties>
</jaxws:endpoint>

I'm also not sure which of the ~20 or so "cfx.xml" config files I'd need to add this to, I found them all at directories like: ..../domain1/generated/jsp/NHINC42Adapters/documentquery( or documentretrieve or patientdiscovery)_war/loader_######/META-INF/cxf/cxf.xml

So some guidance to enabling this would be much appreciated.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RespondingGateway_PRPA_IN201305UV02 has thrown exception, unwinding now java.lang.NullPointerException

johnhd_at_zen
This post was updated on .
In reply to this post by johnhd_at_zen
We resolved this issue. The root of the problem was this:

<saml:Issuer>self</saml:Issuer>

The problem boiled down to an expectation-vs-reality problem.

Per the Sequoia Authorization Framework , this Issuer element isn't "constrained" by the spec. I read this to mean it's optional. However, the code doesn't have a "not null" type check, hence, I'm throwing an NPE.

It's failing here in the CONNECT Gateway code:
 
    if (issuer.getFormat().equals("urn:oasis:names:tc:SAML:1.1:nameid-format:entity")) { 

Per SAML spec, section 8.3 HERE, we modified this to:

<saml:Issuer Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">self</saml:Issuer>

And got around this issue.

What helped was enabling the following loggers to FINE in Glassfish:

org.apache.cxf.ws.security.wss4j
org.apache.ws.security.processo
gov.hhs.fha.nhinc.callback.cxf

*EDIT:* I've found other messages are working now in this same environment, even without this Format attribute. We may have had an interaction with the must-trust-the-head-certificate issue outlined in my other post here that was causing confusion:
http://forums.connectopensource.org/org-apache-cxf-binding-soap-SoapFault-General-security-error-Error-during-certificate-path-validatioh-td7580669.html

Loading...