When you use a Spring ApplicationContext XML file to start the GemFire cacheserver process, you will see the following warning message in the cacheserver's log when GemFire cacheserver is starting and when you define index type in Spring ApplicationContext XML file:
[warning 2017/02/07 16:55:53.910 CST server1 tid=0x1] Invalid JavaBean property 'type' being accessed! Ambiguous write methods found next to actually used [public void org.springframework.data.gemfire.IndexFactoryBean.setType(org.springframework.data.gemfire.IndexType)]: [public void org.springframework.data.gemfire.IndexFactoryBean.setType(java.lang.String)]
An example script to start the cacheserver:
gfsh start server --name=server1 --server-port=7901 --mcast-port=0 --locators=pivhdsne.localdomain[7900] --spring-xml-location=file:/home/gpadmin/apps/test/server1/gemfire-spring-config.xml --include-system-classpath
An example index definition in the Spring ApplicationContext XML file:
<gfe:index id="exampleRegionKey1" type="PRIMARY_KEY" expression="exampleRegionKey1" from="/exampleRegion" />
See below the two 2 setter methods for the type
property:
( two `setType(..)` overloaded: --setType(String type) is to accept a `String` parameter. --setType(IndexType indexType) is to accept an `IndexType` enumerated value )
Due to the above overloaded methods, the Spring container will state that the write method for the type
property on the IndexFactoryBean
is ambiguous because there are 2 setter methods for the same property.
You can refer more details from IndexFactoryBean source code .
Since there is no side effect with this warning message, you can just dismiss this warning message.
Technically, the overloaded setType(String type)
method is probably not needed since Spring Data GemFire also creates and registers the following IndexTypeConverter
, so you may not see this warning message again in the future since Spring Data GemFire engineering team may remove setType(String type) in the future's version.