Reputation: 9986
I have an Invalid property 'tempsReglementaireBusiness' of bean class in my web application
My class:
public class ExportDepassement12HeuresCSV {
@Autowired
private TempsReglementaireBusiness tempsReglementaireBusiness;
...
}
My application context service:
<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>
...
All is declared but when i compil i have this error:
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
Thx.
Upvotes: 0
Views: 1250
Reputation: 10632
As you have autowired TempsReglementaireBusiness
in your ExportDepassement12HeuresCSV
class, you don't need to have a property
entry defined for this while defining ExportDepassement12HeuresCSV
in your config file. Change the bean definition of ExportDepassement12HeuresCSV
to this:
<bean id="exportDepassement12heuresCSV"
class="fr.edfgdf.tamaris.intervention.goulotte.export.ExportDepassement12HeuresCSV">
</bean>
Upvotes: 1