我正在使用 spring 3.0 并尝试为Map<String ,String>
以下是配置和设置方法: Spring 配置如下:
<bean name="geocoder" class="com.g1.component.igeocode.RemoteGeocoder" >
<property name="geocoderConverters">
<map>
<entry key="Default" value="com.g1.component.igeocode.mapmarker.DefaultGeocoderConverter"/>
<entry key="4.8.1.51" value="com.g1.component.igeocode.mapmarker.GeocoderConverter_v4_8_1_51"/>
</map>
</property>
</bean>
远程地理编码器.java
private Map<String, String> geocoderConverters;
public Map<String, String> getGeocoderConverters() {
return geocoderConverters;
}
public void setGeocoderConverters(Map<String, String> geocoderConverters) {
this.geocoderConverters = geocoderConverters;
}
但是我在运行时遇到以下错误:
Error creating bean with name 'geocoder' defined in URL [file:/E:/Spectrum code/Spectrum 7/cdqplatform/platform/server/dist/target/g1server/server/app/tmp/igeocode-global-7.0.car-1643772799809108204-contents/resourcestage-config.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'geocoderConverters' threw exception; nested exception is java.lang.IllegalStateException: No Method invoker set on com.g1.component.igeocode.RemoteGeocoder@12a6f35
有人可以对此发表见解吗?
谢谢。