I am trying to configure a HostConfiguration bean. One of the properties that it has is called proxyHost. However, the Apache HostConfiguration class does not comply with the java beans convention. setter for proxyHost takes an argument of type ProxyHost whereas getter returns a string.
I have the following snippet in applicationContext.xml.
<bean id="proxyHost" class="org.apache.commons.httpclient.ProxyHost">
<constructor-arg index="0" type="java.lang.String" value="myproxy.com" />
<constructor-arg index="1" type="int" value="8087" />
</bean>
<bean id="hostConfiguration" class="org.apache.commons.httpclient.HostConfiguration">
<property name="proxyHost" ref="proxyHost" />
</bean>
When I try to load applicationContext for the application, I get the following error, since it HostConfigurationClassdoes not have getProxyHostwhich returns a ProxyHost or a setter that accepts a string: -
org.springframework.beans.NotWritablePropertyExcep: "proxyHost" bean class [org.apache.commons.httpclient.HostConfiguration]: bean "proxyHost" : ?
springsource thread, MethodInvokingFactoryBean, .
, MethodInvokingFactoryBean, proxyHost getProxyHost(), , ? , . , MethodInvokingFactoryBean. , - , MethodInvokingFactoryBean, .
beans HostConfiguration, spring?
!