naveen raavi

Greenhorn
+ Follow
since Mar 20, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by naveen raavi

Thanks James for reply, but i tried with Iteger , getting same Exception.
10 years ago
below is the Exception Stack Trace for org.springframework.beans.NotWritablePropertyException.

2013-03-20 10:01:28,421 FATAL [MeterMaidLauncher] [PLAT:config.error] Error creating beans: Error creating bean with name 'deliveryController' defined in class path resource [appContext/delivery.xml]: Cannot resolve reference to bean 'deliveryResponseService' while setting bean property 'responseService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deliveryResponseService' defined in class path resource [appContext/delivery.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'powerDownSeconds' of bean class [com.telenor.cinclus.metermaid.delivery.impl.DeliveryResponseServiceImpl]: Bean property 'powerDownSeconds' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?. Exiting.
10 years ago


Hi ,

Am getting NotWritablePropertyException.

Configurations:

delivery.xml

<bean id="deliveryResponseService" class="com.telenor.cinclus.metermaid.delivery.impl.DeliveryResponseServiceImpl">
<property name="estimationService" ref="estimationManager"/>
<property name="missingReadingDate" value="${delivery.qualityx.missing.date}" />
<property name="powerDownSeconds" value="10" />
</bean>

Below is the code.

public class DeliveryResponseServiceImpl implements DeliveryResponseService {

/** The logger. */
private Log logger = LogFactory.getLog(getClass());

/** Service for estimating missing values. */
private EstimationService estimationService;

private Date missingReadingDate;

private int powerDownSeconds;


/**
* Sets the estimation service.
*
* @param estimationService
* the new estimation service
*/
public void setEstimationService(final EstimationService estimationService) {
this.estimationService = estimationService;
}


public void setMissingReadingDate(String missingReadingDate) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss.SSS");
try {
this.missingReadingDate = sdf.parse(missingReadingDate);
} catch (ParseException pex) {
String defaultTime = "1900-Jan-01 00:00:00.000";
logger.error("Wrong dateformat: " + missingReadingDate + ". Using default. (" + defaultTime +")");
try { this.missingReadingDate = sdf.parse(defaultTime); }
catch (Exception ex) {}
}
}

public int getPowerDownSeconds() {
return powerDownSeconds;
}

public void setPowerDownSeconds(int powerDownSeconds) {
this.powerDownSeconds = powerDownSeconds;
}
}

Please help on this . I am using Maven to build the project. After generating jars , am checking the class file whether it is getting updated or not, the propety is updated with setter and getter methods.
Still i am not able to find the root cause this Exception. Spring Configuration files are loading in one application and this Class is in other application.

Please help to resolve this exception
10 years ago