found参数类型不明确

h43kikqp  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(385)

我试图创建一个util类来在springxd中执行hadoop复制,我定义了如下配置

<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>

下面是snippetbean类import org.apache.hadoop.conf.configuration;公共类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)

请帮忙

eagi6jfj

eagi6jfj1#

必须为属性定义setter和getter方法 configuration 请测试这个,让我们知道它的工作或需要更多的帮助

相关问题