java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • {code} 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) {code} Looks like private volatile SSLContext sslContext; is not initialized. Its a runtime issue. I have following defined within the appconfig.xml: {code} <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"/> {code} 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: {code} 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; } {code}
    via by Sachin Sinha,
  • {code} 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) {code} Looks like private volatile SSLContext sslContext; is not initialized. Its a runtime issue. I have following defined within the appconfig.xml: {code} <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"/> {code} 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: {code} 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; } {code}
    via by Sachin Sinha,
    • 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)
    No Bugmate found.