Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Blocker
-
Resolution: Complete
-
Affects Version/s: None
-
Fix Version/s: 2.2 M4 Sprint 1, 2.2 M4
-
Component/s: TCP/UDP Support
-
Labels:
-
Environment:Unix
Description
java.lang.NullPointerException at org.springframework.integration.ip.tcp.connection.support.DefaultTcpNioSSLConnectionSupport.createNewConnection(DefaultTcpNioSSLConnectionSupport.java:49) at org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory.obtainConnection(TcpNioClientConnectionFactory.java:93)
Looks like private volatile SSLContext sslContext; is not initialized.
Its a runtime issue. I have following defined within the appconfig.xml:
<bean id="sslContextSupport" class="org.springframework.integration.ip.tcp.connection.support.DefaultTcpSSLContextSupport"> <constructor-arg value="testkeystore"/> <constructor-arg value="testtruststore"/> <constructor-arg value="testing"/> <constructor-arg value="testing"/> </bean> <bean id="javaSerializer" class="org.springframework.core.serializer.DefaultSerializer"/> <bean id="javaDeserializer" class="org.springframework.core.serializer.DefaultDeserializer"/> <int-ip:tcp-connection-factory id="clientFactory" host="10.3.30.52" port="2017" single-use="true" type="client" deserializer="javaDeserializer" serializer="javaSerializer" using-nio="true" ssl-context-support="sslContextSupport"/> <int:channel id="requests"></int:channel> <int:channel id="replies"> <int:queue capacity="10"/> </int:channel> <int-ip:tcp-outbound-channel-adapter channel="requests" connection-factory="clientFactory" id="outboundClient"/> <int-ip:tcp-inbound-channel-adapter channel="replies" connection-factory="clientFactory" id="inboundClient"/>
Within the code if I am trying to send my login request to requests channel and where its failing. In case if I debug my code I see following:
public TcpNioConnection createNewConnection(SocketChannel socketChannel, boolean server, boolean lookupHost) throws Exception { SSLEngine sslEngine = this.sslContext.createSSLEngine(); // THIS IS WHERE ITS FAILING TcpNioSSLConnection tcpNioSSLConnection = new TcpNioSSLConnection(socketChannel, server, lookupHost, sslEngine); tcpNioSSLConnection.init(); return tcpNioSSLConnection; }