I have this Java code:
public class GreetingServiceImpl implements IGreetingService {
@Resource(name="abc")
private String anotherMsg = null;
What should be the spring-config.xml? The following xml is giving error:
Error creating bean with name 'abc' defined in class path resource [greetingConfig.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'anotherMsg' of bean class [java.lang.String]: Bean property 'anotherMsg' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
This is the bean configuration in spring-config.xml:
<bean id="abc" class="java.lang.String">
<property name="anotherMsg" value="testing @Resource..."/>
</bean>