gpt4 book ai didi

java - bean 类的属性 'tempsReglementaireBusiness' 无效

转载 作者:行者123 更新时间:2023-12-01 13:47:38 25 4
gpt4 key购买 nike

我的 Web 应用程序中有一个无效的 Bean 类属性“tempsReglementaireBusiness”

我的类(class):

public class ExportDepassement12HeuresCSV {

@Autowired
private TempsReglementaireBusiness tempsReglementaireBusiness;

...
}

我的应用程序上下文服务:

    <bean id="exportDepassement12heuresCSV"
class="fr.edfgdf.tamaris.intervention.goulotte.export.ExportDepassement12HeuresCSV">
<property name="tempsReglementaireBusiness" ref="tempsReglementaireBusiness"></property>
</bean>

....
<bean id="tempsReglementaireBusiness"
class="fr.edfgdf.tamaris.intervention.goulotte.service.impl.TempsReglementaireBusinessImpl">
<property name="ressourceManager" ref="ressourceManager" />
<property name="affectationRessourceManager" ref="affectationRessourceManager" />
<property name="cacheManager" ref="cacheManager" />
<property name="affectationActiviteManager" ref="affectationActiviteManager" />
<property name="mainOeuvreManager" ref="mainOeuvreManager" />
<property name="reportingReposService" ref="reportingReposService" />
<property name="tourneeManager" ref="tourneeManager" />
<property name="entiteManager" ref="entiteManager" />
<property name="rvaEntiteRegionaleManager" ref="rvaEntiteRegionaleManager" />
<property name="rvaEntiteRegionaleDtoTranslator" ref="rvaEntiteRegionaleDtoTranslator" />
<property name="exportService" ref="exportService" />
<property name="exportMessageSender" ref="exportMessageSender" />
<property name="motifDepassementManager" ref="motifDepassementManager" />
<property name="activiteLocaleManager" ref="activiteLocaleManager" />
<property name="activiteNationaleManager" ref="activiteNationaleManager" />
<property name="interventionManager" ref="interventionManager" />
<property name="depassementTempsManager" ref="depassementTempsManager" />
</bean>

...

所有内容均已声明,但当我编译时出现此错误:

Caused By: org.springframework.beans.NotWritablePropertyException: Invalid property 'tempsReglementaireBusiness' of bean class [fr.edfgdf.tamaris.intervention.goulotte.export.ExportDepassement12HeuresCSV]: Bean property 'tempsReglementaireBusiness' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1064) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:924) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393) Truncated. see log file for complete stacktrace

谢谢。

最佳答案

由于您已在 ExportDepassement12HeuresCSV 类中 Autowiring TempsReglementaireBusiness,因此在定义 时无需为此定义 property 条目code>ExportDepassement12HeuresCSV 在您的配置文件中。将 ExportDepassement12HeuresCSV 的 bean 定义更改为:

<bean id="exportDepassement12heuresCSV"
class="fr.edfgdf.tamaris.intervention.goulotte.export.ExportDepassement12HeuresCSV">

</bean>

关于java - bean 类的属性 'tempsReglementaireBusiness' 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20240202/

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