删除动态Spring集成流时的NPE

时间:2018-10-10 18:28:53

标签: spring spring-integration

您好,在我们的应用程序中,我们正在创建某些动态集成流程,该流程将在该流程上删除并创建。 通常情况下,一切都很正常,但是由于集成流程试图删除依赖的bean,有时有时会观察到以下错误。有人可以评论这是错误还是我们什么都没有。

以下的错误跟踪
     java.lang.NullPointerException: null 

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resetBeanDefinition(DefaultListableBeanFactory.java:912) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.removeBeanDefinition(DefaultListableBeanFactory.java:891) 
    at org.springframework.integration.dsl.context.IntegrationFlowContext.removeDependantBeans(IntegrationFlowContext.java:203) 
    at org.springframework.integration.dsl.context.IntegrationFlowContext.remove(IntegrationFlowContext.java:189) at 

删除集成流程的代码

 flowContext.remove("flowId");

调用代码的更新

 if (discoveryService.isFLowPresent(flowId))
  {
     LOG.debug("Removing and creating flow [{}]", flowId);
     discoveryService.removeIntegrationFlow(fc.getFeedId());
     LOG.debug("Removing Old Job and create fresh one with new params [{}]", flowId); 
     try
     {
        discoveryService.createFlow(fc.getFeedId());
     }
     catch (ExecutionException e)
     {
        throw new IllegalStateException("Error while starting flow for Integration adapter [{}]" + fc.getFeedId(), e);
     }
  }

0 个答案:

没有答案