gpt4 book ai didi

Spring Hadoop : unable to set the configuration getting Found ambiguous parameter type

转载 作者:行者123 更新时间:2023-12-02 21:44:34 24 4
gpt4 key购买 nike

我试图在 Spring XD 中创建一个用于执行 Hadoop 复制的 util 类,我定义了如下配置

<int:channel id="input"/>
<int:service-activator input-channel="input" ref="utilhandler" />
<bean id="utilhandler" class="com.test.hadoop.HadoopUtil"/>
<hdp:configuration register-url-handler="false" properties-location="${xd.config.home}/hadoop.properties" >
fs.defaultFS=${fsUri}

</hdp:configuration>
</beans>

下面是片段 bean 类
导入 org.apache.hadoop.conf.Configuration;
公共(public)类 HadoopUtil 实现 InitializingBean{
      private String destinationDir;
private FsShell shell;
@Autowired
private Configuration configuration;
public Configuration getHadoopConfiguration()
{
return configuration;
}

当我执行时,我遇到了异常

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.ServiceActivatorFactor
yBean#0': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Found ambiguous parameter type [class java.lan
g.Void] for method match: [public org.apache.hadoop.conf.Configuration com.test.hadoop.HadoopUtil.getHadoopConfiguration(), public void com.test.hadoop.HadoopUtil.setConfiguration(org.apache.hadoop.conf.Configuration)]
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)

请帮忙

最佳答案

您必须为属性 configuration 定义 setter 和 getter 方法
请对此进行测试,让我们知道它有效或需要更多帮助

关于 Spring Hadoop : unable to set the configuration getting Found ambiguous parameter type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26493588/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com