当前位置: 首页 > 知识库问答 >
问题:

Spring云流报头充实器循环参考和NPE

欧阳嘉
2023-03-14

使用Spring Cloud Data Flow Server和shell 1.3.0.M1、Kafka绑定器,并从Bacon bit-ly URL(1.2.0.release)加载应用程序。

我在SCDF shell中创建/部署了一个流:

source | httpclient <args> | header-enricher --headers=\"key=payload\" | log
2017-08-29 16:37:16,991  WARN main o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext:550 - 
Exception encountered during context initialization - cancelling refresh attempt: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'org.springframework.cloud.stream.app.header.enricher.processor.
 HeaderEnricherProcessorConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'headerEnricher' defined in org.springframework.cloud.stream.app.header.enricher.processor.HeaderEnricherProcessorConfiguration: Bean instantiation via factory method failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.springframework.integration.transformer.HeaderEnricher]: Circular reference involving 
containing bean 
'org.springframework.cloud.stream.app.header.enricher.processor.
 HeaderEnricherProcessorConfiguration' - consider declaring the factory method as static 
 for independence from its containing instance. Factory method 'headerEnricher' 
 threw exception; nested exception is java.lang.NullPointerException

我做错什么了吗?

共有1个答案

鲍永春
2023-03-14

header-enricher的选项headers类型为properties,您可以将该选项指定为--headers='key=payload'

 类似资料:
  • 问题内容: 我有关于通函的问题。 我有Rest Webservices,它会将对象返回到前端,问题是当我尝试返回具有多个引用的对象时,结果是我得到一个无限的响应,该响应会生成 这些对象是由Hibernate Code Generation自动生成的,我需要在后端使用循环引用,我只需要删除它,然后再使用Jackson将信息发送到前端即可。 控制器方法标头为: 我没有做任何明确的转换为Json的事情,

  • 问题内容: 我开始在一个小型的足球联赛管理网站上工作(主要是出于学习目的),我无法确定Django模型的关系。为了简单起见,假设我有两种类型的对象-玩家和团队。自然,一个玩家属于一个团队,因此在Player模型中就是一个ForeignKey(Team)。所以我去: 然后,我希望每个团队都有一个队长,该队长将是其中一名球员,因此在团队模型中将成为一名ForeignKey(Player)。但这会产生循

  • 在我的应用程序中,我们使用多个数据源,因此我们有多个数据库配置(会话工厂)。在我们的本地(whindows机器)上一切正常,但当我们将war文件部署到Unix时,应用程序失败,出现以下异常: 组织。springframework。豆。工厂BeanCreationException:创建名为“cpnRepository”的bean时出错:自动连线依赖项的注入失败;嵌套的异常是org。springfr

  • 我想使用spring cloud stream手动提交偏移量-仅当消息处理成功时。这是我的代码应用程序。yml公司 但我的确认对象为空,因为在标头中,对象“kafka\u确认”本身不存在。 如何获取确认对象

  • 反应器中的项目包含循环引用:Vertex{tag='org.spigotmc: spiget-api: 1.8.8-R0.1-SNAPSHOT'}'和'Vertex{tag='org.spigotmc: spigot: 1.8.8-R0.1-SNAPSHOT'}'之间的边缘在图中引入循环org.spigotmc: spigot: 1.8.8-R0.1-SNAPSHOT- “Vertex { lab

  • 在std::unordered_映射上运行基于范围的for循环时,循环变量的类型似乎不使用引用类型: MSVC 2017、gcc 8.2和clang 7.0.0都在这里报告了一个失败的断言。与std::vector相反,它的断言不会失败,正如人们所期望的那样: 然而,在MSVC 2017和gcc 8.2上,修改局部变量r的循环将产生明显的副作用: 例如,此程序将打印(忽略订单): 我遗漏了什么?尽