Spring boot integrationn smpp: null pointer












0















I am trying to implement spring-boot-integration-smpp, but getting null pointer exception.



integration-context.xml



<!--smpp integration-->
<int-smpp:outbound-gateway
id="smppIntegrationOutboundGateway"
request-channel="toSMPPChannel"
source-address="Indosat"
smpp-session-ref="smppSession"
reply-channel="fromSMPPChannel"/>

<int:service-activator ref="printService" method="print" input-channel="fromSMPPChannel">
<int:poller fixed-delay="1"/>
</int:service-activator>

<int:gateway id="smsGateway" service-interface="com.omexit.niger.smsworker.service.SMSGateway" default-request-channel="toSMPPChannel"/>

<!-- connect to the local broker using the default user name and password -->
<bean id="rabbitConnectionFactory" class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory">
<constructor-arg value="${spring.rabbitmq.host}"/>
<constructor-arg value="${spring.rabbitmq.port}"/>
<property name="username" value="${spring.rabbitmq.username}"/>
<property name="password" value="${spring.rabbitmq.password}"/>
</bean>

<bean id="smppSession" class="org.springframework.integration.smpp.session.SmppSessionFactoryBean">
<property name="host" value="xxxx"/>
<property name="port" value="xx"/>
<property name="systemId" value="LBS1"/>
<property name="password" value="Bsl04n1"/>
<property name="systemType" value="TCP"/>
<property name="addrTon" value="INTERNATIONAL"/>
<property name="addrNpi" value="ISDN"/>
<property name="autoStartup" value="true"/>
</bean>


send message



System.err.println(strMessage);
Message<String> message = MessageBuilder.withPayload(strMessage)
.setHeader(SmppConstants.SRC_ADDR, "xyz")
.setHeader(SmppConstants.DST_ADDR, "6285781029162")
.setHeader(SmppConstants.REGISTERED_DELIVERY_MODE, SMSCDeliveryReceipt.SUCCESS)
.build();
String res = (String) smsGateway.send(message).getPayload();
System.err.println("Res: " +res);


Exception:



    2018-11-27 14:56:21.414 ERROR [-,,,] 24620 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.smpp.outbound.SmppOutboundGateway#0': Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at com.mode.indosat.smsworker.SmsWorkerApplication.main(SmsWorkerApplication.java:31) [classes/:na]
Caused by: java.lang.NullPointerException: null
at org.springframework.integration.smpp.session.SmppSessionFactoryBean$AutoReconnectLifecycle.scheduleReconnect(SmppSessionFactoryBean.java:548) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
at org.springframework.integration.smpp.session.SmppSessionFactoryBean$AutoReconnectLifecycle.start(SmppSessionFactoryBean.java:487) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
at org.springframework.integration.smpp.session.ExtendedSmppSessionAdaptingDelegate.start(ExtendedSmppSessionAdaptingDelegate.java:78) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
at org.springframework.integration.smpp.outbound.SmppOutboundGateway.doInit(SmppOutboundGateway.java:62) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.onInit(AbstractReplyProducingMessageHandler.java:94) ~[spring-integration-core-5.1.0.RELEASE.jar:5.1.0.RELEASE]
at org.springframework.integration.context.IntegrationObjectSupport.afterPropertiesSet(IntegrationObjectSupport.java:178) ~[spring-integration-core-5.1.0.RELEASE.jar:5.1.0.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
... 16 common frames omitted









share|improve this question





























    0















    I am trying to implement spring-boot-integration-smpp, but getting null pointer exception.



    integration-context.xml



    <!--smpp integration-->
    <int-smpp:outbound-gateway
    id="smppIntegrationOutboundGateway"
    request-channel="toSMPPChannel"
    source-address="Indosat"
    smpp-session-ref="smppSession"
    reply-channel="fromSMPPChannel"/>

    <int:service-activator ref="printService" method="print" input-channel="fromSMPPChannel">
    <int:poller fixed-delay="1"/>
    </int:service-activator>

    <int:gateway id="smsGateway" service-interface="com.omexit.niger.smsworker.service.SMSGateway" default-request-channel="toSMPPChannel"/>

    <!-- connect to the local broker using the default user name and password -->
    <bean id="rabbitConnectionFactory" class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory">
    <constructor-arg value="${spring.rabbitmq.host}"/>
    <constructor-arg value="${spring.rabbitmq.port}"/>
    <property name="username" value="${spring.rabbitmq.username}"/>
    <property name="password" value="${spring.rabbitmq.password}"/>
    </bean>

    <bean id="smppSession" class="org.springframework.integration.smpp.session.SmppSessionFactoryBean">
    <property name="host" value="xxxx"/>
    <property name="port" value="xx"/>
    <property name="systemId" value="LBS1"/>
    <property name="password" value="Bsl04n1"/>
    <property name="systemType" value="TCP"/>
    <property name="addrTon" value="INTERNATIONAL"/>
    <property name="addrNpi" value="ISDN"/>
    <property name="autoStartup" value="true"/>
    </bean>


    send message



    System.err.println(strMessage);
    Message<String> message = MessageBuilder.withPayload(strMessage)
    .setHeader(SmppConstants.SRC_ADDR, "xyz")
    .setHeader(SmppConstants.DST_ADDR, "6285781029162")
    .setHeader(SmppConstants.REGISTERED_DELIVERY_MODE, SMSCDeliveryReceipt.SUCCESS)
    .build();
    String res = (String) smsGateway.send(message).getPayload();
    System.err.println("Res: " +res);


    Exception:



        2018-11-27 14:56:21.414 ERROR [-,,,] 24620 --- [           main] o.s.boot.SpringApplication               : Application run failed

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.smpp.outbound.SmppOutboundGateway#0': Invocation of init method failed; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    at com.mode.indosat.smsworker.SmsWorkerApplication.main(SmsWorkerApplication.java:31) [classes/:na]
    Caused by: java.lang.NullPointerException: null
    at org.springframework.integration.smpp.session.SmppSessionFactoryBean$AutoReconnectLifecycle.scheduleReconnect(SmppSessionFactoryBean.java:548) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
    at org.springframework.integration.smpp.session.SmppSessionFactoryBean$AutoReconnectLifecycle.start(SmppSessionFactoryBean.java:487) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
    at org.springframework.integration.smpp.session.ExtendedSmppSessionAdaptingDelegate.start(ExtendedSmppSessionAdaptingDelegate.java:78) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
    at org.springframework.integration.smpp.outbound.SmppOutboundGateway.doInit(SmppOutboundGateway.java:62) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.onInit(AbstractReplyProducingMessageHandler.java:94) ~[spring-integration-core-5.1.0.RELEASE.jar:5.1.0.RELEASE]
    at org.springframework.integration.context.IntegrationObjectSupport.afterPropertiesSet(IntegrationObjectSupport.java:178) ~[spring-integration-core-5.1.0.RELEASE.jar:5.1.0.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    ... 16 common frames omitted









    share|improve this question



























      0












      0








      0








      I am trying to implement spring-boot-integration-smpp, but getting null pointer exception.



      integration-context.xml



      <!--smpp integration-->
      <int-smpp:outbound-gateway
      id="smppIntegrationOutboundGateway"
      request-channel="toSMPPChannel"
      source-address="Indosat"
      smpp-session-ref="smppSession"
      reply-channel="fromSMPPChannel"/>

      <int:service-activator ref="printService" method="print" input-channel="fromSMPPChannel">
      <int:poller fixed-delay="1"/>
      </int:service-activator>

      <int:gateway id="smsGateway" service-interface="com.omexit.niger.smsworker.service.SMSGateway" default-request-channel="toSMPPChannel"/>

      <!-- connect to the local broker using the default user name and password -->
      <bean id="rabbitConnectionFactory" class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory">
      <constructor-arg value="${spring.rabbitmq.host}"/>
      <constructor-arg value="${spring.rabbitmq.port}"/>
      <property name="username" value="${spring.rabbitmq.username}"/>
      <property name="password" value="${spring.rabbitmq.password}"/>
      </bean>

      <bean id="smppSession" class="org.springframework.integration.smpp.session.SmppSessionFactoryBean">
      <property name="host" value="xxxx"/>
      <property name="port" value="xx"/>
      <property name="systemId" value="LBS1"/>
      <property name="password" value="Bsl04n1"/>
      <property name="systemType" value="TCP"/>
      <property name="addrTon" value="INTERNATIONAL"/>
      <property name="addrNpi" value="ISDN"/>
      <property name="autoStartup" value="true"/>
      </bean>


      send message



      System.err.println(strMessage);
      Message<String> message = MessageBuilder.withPayload(strMessage)
      .setHeader(SmppConstants.SRC_ADDR, "xyz")
      .setHeader(SmppConstants.DST_ADDR, "6285781029162")
      .setHeader(SmppConstants.REGISTERED_DELIVERY_MODE, SMSCDeliveryReceipt.SUCCESS)
      .build();
      String res = (String) smsGateway.send(message).getPayload();
      System.err.println("Res: " +res);


      Exception:



          2018-11-27 14:56:21.414 ERROR [-,,,] 24620 --- [           main] o.s.boot.SpringApplication               : Application run failed

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.smpp.outbound.SmppOutboundGateway#0': Invocation of init method failed; nested exception is java.lang.NullPointerException
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at com.mode.indosat.smsworker.SmsWorkerApplication.main(SmsWorkerApplication.java:31) [classes/:na]
      Caused by: java.lang.NullPointerException: null
      at org.springframework.integration.smpp.session.SmppSessionFactoryBean$AutoReconnectLifecycle.scheduleReconnect(SmppSessionFactoryBean.java:548) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
      at org.springframework.integration.smpp.session.SmppSessionFactoryBean$AutoReconnectLifecycle.start(SmppSessionFactoryBean.java:487) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
      at org.springframework.integration.smpp.session.ExtendedSmppSessionAdaptingDelegate.start(ExtendedSmppSessionAdaptingDelegate.java:78) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
      at org.springframework.integration.smpp.outbound.SmppOutboundGateway.doInit(SmppOutboundGateway.java:62) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
      at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.onInit(AbstractReplyProducingMessageHandler.java:94) ~[spring-integration-core-5.1.0.RELEASE.jar:5.1.0.RELEASE]
      at org.springframework.integration.context.IntegrationObjectSupport.afterPropertiesSet(IntegrationObjectSupport.java:178) ~[spring-integration-core-5.1.0.RELEASE.jar:5.1.0.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      ... 16 common frames omitted









      share|improve this question
















      I am trying to implement spring-boot-integration-smpp, but getting null pointer exception.



      integration-context.xml



      <!--smpp integration-->
      <int-smpp:outbound-gateway
      id="smppIntegrationOutboundGateway"
      request-channel="toSMPPChannel"
      source-address="Indosat"
      smpp-session-ref="smppSession"
      reply-channel="fromSMPPChannel"/>

      <int:service-activator ref="printService" method="print" input-channel="fromSMPPChannel">
      <int:poller fixed-delay="1"/>
      </int:service-activator>

      <int:gateway id="smsGateway" service-interface="com.omexit.niger.smsworker.service.SMSGateway" default-request-channel="toSMPPChannel"/>

      <!-- connect to the local broker using the default user name and password -->
      <bean id="rabbitConnectionFactory" class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory">
      <constructor-arg value="${spring.rabbitmq.host}"/>
      <constructor-arg value="${spring.rabbitmq.port}"/>
      <property name="username" value="${spring.rabbitmq.username}"/>
      <property name="password" value="${spring.rabbitmq.password}"/>
      </bean>

      <bean id="smppSession" class="org.springframework.integration.smpp.session.SmppSessionFactoryBean">
      <property name="host" value="xxxx"/>
      <property name="port" value="xx"/>
      <property name="systemId" value="LBS1"/>
      <property name="password" value="Bsl04n1"/>
      <property name="systemType" value="TCP"/>
      <property name="addrTon" value="INTERNATIONAL"/>
      <property name="addrNpi" value="ISDN"/>
      <property name="autoStartup" value="true"/>
      </bean>


      send message



      System.err.println(strMessage);
      Message<String> message = MessageBuilder.withPayload(strMessage)
      .setHeader(SmppConstants.SRC_ADDR, "xyz")
      .setHeader(SmppConstants.DST_ADDR, "6285781029162")
      .setHeader(SmppConstants.REGISTERED_DELIVERY_MODE, SMSCDeliveryReceipt.SUCCESS)
      .build();
      String res = (String) smsGateway.send(message).getPayload();
      System.err.println("Res: " +res);


      Exception:



          2018-11-27 14:56:21.414 ERROR [-,,,] 24620 --- [           main] o.s.boot.SpringApplication               : Application run failed

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.smpp.outbound.SmppOutboundGateway#0': Invocation of init method failed; nested exception is java.lang.NullPointerException
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
      at com.mode.indosat.smsworker.SmsWorkerApplication.main(SmsWorkerApplication.java:31) [classes/:na]
      Caused by: java.lang.NullPointerException: null
      at org.springframework.integration.smpp.session.SmppSessionFactoryBean$AutoReconnectLifecycle.scheduleReconnect(SmppSessionFactoryBean.java:548) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
      at org.springframework.integration.smpp.session.SmppSessionFactoryBean$AutoReconnectLifecycle.start(SmppSessionFactoryBean.java:487) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
      at org.springframework.integration.smpp.session.ExtendedSmppSessionAdaptingDelegate.start(ExtendedSmppSessionAdaptingDelegate.java:78) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
      at org.springframework.integration.smpp.outbound.SmppOutboundGateway.doInit(SmppOutboundGateway.java:62) ~[spring-integration-smpp-1.0.0.RELEASE.jar:na]
      at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.onInit(AbstractReplyProducingMessageHandler.java:94) ~[spring-integration-core-5.1.0.RELEASE.jar:5.1.0.RELEASE]
      at org.springframework.integration.context.IntegrationObjectSupport.afterPropertiesSet(IntegrationObjectSupport.java:178) ~[spring-integration-core-5.1.0.RELEASE.jar:5.1.0.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
      ... 16 common frames omitted






      spring spring-boot spring-integration






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 27 '18 at 12:42









      Ishikawa Yoshi

      1,03541740




      1,03541740










      asked Nov 27 '18 at 12:01









      omexITomexIT

      343




      343
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Looks like a bug in the SmppOutboundGateway: we can't start session so early from the onInit(). Please, raise an issue against https://github.com/spring-projects/spring-integration-extensions project.



          Meanwhile as a workaround you can inject a reconnectingExecutor property on the SmppSessionFactoryBean:



          <bean id="smppSession" class="org.springframework.integration.smpp.session.SmppSessionFactoryBean">
          <property name="host" value="xxxx"/>
          <property name="port" value="xx"/>
          <property name="systemId" value="LBS1"/>
          <property name="password" value="Bsl04n1"/>
          <property name="systemType" value="TCP"/>
          <property name="addrTon" value="INTERNATIONAL"/>
          <property name="addrNpi" value="ISDN"/>
          <property name="autoStartup" value="true"/>
          <property name="reconnectingExecutor" ref="reconnectingExecutorService"/>
          </bean>





          share|improve this answer


























          • I don't quite understand how to add reconnectingExecutorService. I have tried the following and its not working: @Bean(name = "reconnectingExecutorService") public ExecutorService executorService(){ return Executors.newSingleThreadExecutor(); }

            – omexIT
            Nov 28 '18 at 10:39













          • I added your SmppSessionFactoryBean bean definition to my answer with the reconnectingExecutor property in the end. Is it clear now?

            – Artem Bilan
            Nov 28 '18 at 15:46











          • I am getting the following error. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smppIntegrationOutboundGateway': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context. ... Caused by: java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context

            – omexIT
            Nov 29 '18 at 7:55











          • That’s different story. Your toSMPPChannel is a queue and its subscriber can’t be without a poller. Or you should define a global default one. Please, consult with Docs on the matter

            – Artem Bilan
            Nov 29 '18 at 13:01











          • I agree. I already defined global poller and outboundgateway wont accept a poller

            – omexIT
            Nov 29 '18 at 17:23











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53499241%2fspring-boot-integrationn-smpp-null-pointer%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Looks like a bug in the SmppOutboundGateway: we can't start session so early from the onInit(). Please, raise an issue against https://github.com/spring-projects/spring-integration-extensions project.



          Meanwhile as a workaround you can inject a reconnectingExecutor property on the SmppSessionFactoryBean:



          <bean id="smppSession" class="org.springframework.integration.smpp.session.SmppSessionFactoryBean">
          <property name="host" value="xxxx"/>
          <property name="port" value="xx"/>
          <property name="systemId" value="LBS1"/>
          <property name="password" value="Bsl04n1"/>
          <property name="systemType" value="TCP"/>
          <property name="addrTon" value="INTERNATIONAL"/>
          <property name="addrNpi" value="ISDN"/>
          <property name="autoStartup" value="true"/>
          <property name="reconnectingExecutor" ref="reconnectingExecutorService"/>
          </bean>





          share|improve this answer


























          • I don't quite understand how to add reconnectingExecutorService. I have tried the following and its not working: @Bean(name = "reconnectingExecutorService") public ExecutorService executorService(){ return Executors.newSingleThreadExecutor(); }

            – omexIT
            Nov 28 '18 at 10:39













          • I added your SmppSessionFactoryBean bean definition to my answer with the reconnectingExecutor property in the end. Is it clear now?

            – Artem Bilan
            Nov 28 '18 at 15:46











          • I am getting the following error. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smppIntegrationOutboundGateway': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context. ... Caused by: java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context

            – omexIT
            Nov 29 '18 at 7:55











          • That’s different story. Your toSMPPChannel is a queue and its subscriber can’t be without a poller. Or you should define a global default one. Please, consult with Docs on the matter

            – Artem Bilan
            Nov 29 '18 at 13:01











          • I agree. I already defined global poller and outboundgateway wont accept a poller

            – omexIT
            Nov 29 '18 at 17:23
















          0














          Looks like a bug in the SmppOutboundGateway: we can't start session so early from the onInit(). Please, raise an issue against https://github.com/spring-projects/spring-integration-extensions project.



          Meanwhile as a workaround you can inject a reconnectingExecutor property on the SmppSessionFactoryBean:



          <bean id="smppSession" class="org.springframework.integration.smpp.session.SmppSessionFactoryBean">
          <property name="host" value="xxxx"/>
          <property name="port" value="xx"/>
          <property name="systemId" value="LBS1"/>
          <property name="password" value="Bsl04n1"/>
          <property name="systemType" value="TCP"/>
          <property name="addrTon" value="INTERNATIONAL"/>
          <property name="addrNpi" value="ISDN"/>
          <property name="autoStartup" value="true"/>
          <property name="reconnectingExecutor" ref="reconnectingExecutorService"/>
          </bean>





          share|improve this answer


























          • I don't quite understand how to add reconnectingExecutorService. I have tried the following and its not working: @Bean(name = "reconnectingExecutorService") public ExecutorService executorService(){ return Executors.newSingleThreadExecutor(); }

            – omexIT
            Nov 28 '18 at 10:39













          • I added your SmppSessionFactoryBean bean definition to my answer with the reconnectingExecutor property in the end. Is it clear now?

            – Artem Bilan
            Nov 28 '18 at 15:46











          • I am getting the following error. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smppIntegrationOutboundGateway': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context. ... Caused by: java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context

            – omexIT
            Nov 29 '18 at 7:55











          • That’s different story. Your toSMPPChannel is a queue and its subscriber can’t be without a poller. Or you should define a global default one. Please, consult with Docs on the matter

            – Artem Bilan
            Nov 29 '18 at 13:01











          • I agree. I already defined global poller and outboundgateway wont accept a poller

            – omexIT
            Nov 29 '18 at 17:23














          0












          0








          0







          Looks like a bug in the SmppOutboundGateway: we can't start session so early from the onInit(). Please, raise an issue against https://github.com/spring-projects/spring-integration-extensions project.



          Meanwhile as a workaround you can inject a reconnectingExecutor property on the SmppSessionFactoryBean:



          <bean id="smppSession" class="org.springframework.integration.smpp.session.SmppSessionFactoryBean">
          <property name="host" value="xxxx"/>
          <property name="port" value="xx"/>
          <property name="systemId" value="LBS1"/>
          <property name="password" value="Bsl04n1"/>
          <property name="systemType" value="TCP"/>
          <property name="addrTon" value="INTERNATIONAL"/>
          <property name="addrNpi" value="ISDN"/>
          <property name="autoStartup" value="true"/>
          <property name="reconnectingExecutor" ref="reconnectingExecutorService"/>
          </bean>





          share|improve this answer















          Looks like a bug in the SmppOutboundGateway: we can't start session so early from the onInit(). Please, raise an issue against https://github.com/spring-projects/spring-integration-extensions project.



          Meanwhile as a workaround you can inject a reconnectingExecutor property on the SmppSessionFactoryBean:



          <bean id="smppSession" class="org.springframework.integration.smpp.session.SmppSessionFactoryBean">
          <property name="host" value="xxxx"/>
          <property name="port" value="xx"/>
          <property name="systemId" value="LBS1"/>
          <property name="password" value="Bsl04n1"/>
          <property name="systemType" value="TCP"/>
          <property name="addrTon" value="INTERNATIONAL"/>
          <property name="addrNpi" value="ISDN"/>
          <property name="autoStartup" value="true"/>
          <property name="reconnectingExecutor" ref="reconnectingExecutorService"/>
          </bean>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 28 '18 at 15:45

























          answered Nov 27 '18 at 17:07









          Artem BilanArtem Bilan

          66.3k84972




          66.3k84972













          • I don't quite understand how to add reconnectingExecutorService. I have tried the following and its not working: @Bean(name = "reconnectingExecutorService") public ExecutorService executorService(){ return Executors.newSingleThreadExecutor(); }

            – omexIT
            Nov 28 '18 at 10:39













          • I added your SmppSessionFactoryBean bean definition to my answer with the reconnectingExecutor property in the end. Is it clear now?

            – Artem Bilan
            Nov 28 '18 at 15:46











          • I am getting the following error. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smppIntegrationOutboundGateway': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context. ... Caused by: java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context

            – omexIT
            Nov 29 '18 at 7:55











          • That’s different story. Your toSMPPChannel is a queue and its subscriber can’t be without a poller. Or you should define a global default one. Please, consult with Docs on the matter

            – Artem Bilan
            Nov 29 '18 at 13:01











          • I agree. I already defined global poller and outboundgateway wont accept a poller

            – omexIT
            Nov 29 '18 at 17:23



















          • I don't quite understand how to add reconnectingExecutorService. I have tried the following and its not working: @Bean(name = "reconnectingExecutorService") public ExecutorService executorService(){ return Executors.newSingleThreadExecutor(); }

            – omexIT
            Nov 28 '18 at 10:39













          • I added your SmppSessionFactoryBean bean definition to my answer with the reconnectingExecutor property in the end. Is it clear now?

            – Artem Bilan
            Nov 28 '18 at 15:46











          • I am getting the following error. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smppIntegrationOutboundGateway': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context. ... Caused by: java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context

            – omexIT
            Nov 29 '18 at 7:55











          • That’s different story. Your toSMPPChannel is a queue and its subscriber can’t be without a poller. Or you should define a global default one. Please, consult with Docs on the matter

            – Artem Bilan
            Nov 29 '18 at 13:01











          • I agree. I already defined global poller and outboundgateway wont accept a poller

            – omexIT
            Nov 29 '18 at 17:23

















          I don't quite understand how to add reconnectingExecutorService. I have tried the following and its not working: @Bean(name = "reconnectingExecutorService") public ExecutorService executorService(){ return Executors.newSingleThreadExecutor(); }

          – omexIT
          Nov 28 '18 at 10:39







          I don't quite understand how to add reconnectingExecutorService. I have tried the following and its not working: @Bean(name = "reconnectingExecutorService") public ExecutorService executorService(){ return Executors.newSingleThreadExecutor(); }

          – omexIT
          Nov 28 '18 at 10:39















          I added your SmppSessionFactoryBean bean definition to my answer with the reconnectingExecutor property in the end. Is it clear now?

          – Artem Bilan
          Nov 28 '18 at 15:46





          I added your SmppSessionFactoryBean bean definition to my answer with the reconnectingExecutor property in the end. Is it clear now?

          – Artem Bilan
          Nov 28 '18 at 15:46













          I am getting the following error. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smppIntegrationOutboundGateway': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context. ... Caused by: java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context

          – omexIT
          Nov 29 '18 at 7:55





          I am getting the following error. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smppIntegrationOutboundGateway': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context. ... Caused by: java.lang.IllegalArgumentException: No poller has been defined for endpoint 'smppIntegrationOutboundGateway', and no default poller is available within the context

          – omexIT
          Nov 29 '18 at 7:55













          That’s different story. Your toSMPPChannel is a queue and its subscriber can’t be without a poller. Or you should define a global default one. Please, consult with Docs on the matter

          – Artem Bilan
          Nov 29 '18 at 13:01





          That’s different story. Your toSMPPChannel is a queue and its subscriber can’t be without a poller. Or you should define a global default one. Please, consult with Docs on the matter

          – Artem Bilan
          Nov 29 '18 at 13:01













          I agree. I already defined global poller and outboundgateway wont accept a poller

          – omexIT
          Nov 29 '18 at 17:23





          I agree. I already defined global poller and outboundgateway wont accept a poller

          – omexIT
          Nov 29 '18 at 17:23




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53499241%2fspring-boot-integrationn-smpp-null-pointer%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Contact image not getting when fetch all contact list from iPhone by CNContact

          count number of partitions of a set with n elements into k subsets

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks