[INT-4448] NPE in the MessagingGatewayRegistrar when default-payload-expression but now any default-headers Created: 11/Apr/18  Updated: 18/Apr/18  Resolved: 18/Apr/18

Status: Resolved
Project: Spring Integration
Component/s: Core
Affects Version/s: 4.3.15
Fix Version/s: 5.1 M1, 5.0.5, 4.3.16

Type: Bug Priority: Minor
Reporter: Artem Bilan Assignee: Artem Bilan
Resolution: Complete Votes: 0
Labels: PullRequest
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Reference URL: https://stackoverflow.com/questions/49783344/using-gateway-to-consume-spring-boot-application-from-spring-integration-applica
Pull Request URL: https://github.com/spring-projects/spring-integration/pull/2420

 Description   
<int:gateway id="sampleGateway2"
				 service-interface="org.springframework.integration.gateway.GatewayInterfaceTests$Bar"
				 default-request-channel="requestChannelBaz" default-payload-expression="'foo'">
</int:gateway>
Caused by: java.lang.NullPointerException
	at org.springframework.integration.config.MessagingGatewayRegistrar.parse(MessagingGatewayRegistrar.java:107)
	at org.springframework.integration.config.xml.GatewayParser.parse(GatewayParser.java:137)
	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74)
	at org.springframework.integration.config.xml.AbstractIntegrationNamespaceHandler.parse(AbstractIntegrationNamespaceHandler.java:63)

The reason that defaultHeaders attribute is null, but we still step into the block to parse them because we meet this condition: if (hasDefaultHeaders || hasDefaultPayloadExpression) {.



 Comments   
Comment by Artem Bilan [ 17/Apr/18 ]

Turned out that after fixing this we can't proceed without fixing INT-4449.

Generated at Sun Dec 15 16:38:46 UTC 2019 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.