given code is the sample code to demonstrate the problem that i'm facing in my real application
when i run this code it throws an exception : org.springframework.beans.factory.BeanCreationExce ption
: Error creating bean with name 'ITestInterface' defined in file [E:\myhibernet\src\spring-config\ITest-Interface-Bean.xml]: Cannot resolve reference to bean 'testImplementation' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'testImplementation' defined in file [E:\myhibernet\src\spring-config\Test-Implementation-Bean.xml]: Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException : Invalid property 'iPrimeNo' of bean class [com.TestImplementation]: No property 'iPrimeNo' found
Code:file: TestImplementation.java package com; interface ITestInterface { public void setIPrimeNo(Integer iPrimeNo) throws SufalamException; } public class TestImplementation implements ITestInterface{ private Integer iPrimeNo; public void setIPrimeNo(Integer iPrimeNo) throws SufalamException{ this.iPrimeNo = iPrimeNo; } public Integer getIPrimeNo() throws SufalamException{ return iPrimeNo; } } file: ITest-Interface-Bean.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans > <bean id="ITestInterface" class="org.springframework.aop.framework.ProxyFactoryBean" autowire="byName"> <property name="proxyInterfaces"> <value>com.ITestInterface</value> </property> <property name="target"> <ref bean="testImplementation"/> </property> </bean> </beans> file: Test-Implementation-Bean.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans > <bean id="testImplementation" class="com.TestImplementation" > <property name="iPrimeNo"> <value>10</value> </property> </bean> </beans>
when i change the property to name="IPrimeNo" in Test-Implementation-Bean.xml file the error gets solved.
but it is illegal as my property name is iPrimeNo.
I've observed this problem occurs with the property names starts with "i".
Can Anyone help me what's the problem is ??
Thanks In Advance.


Reply With Quote
,
.