You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by yucigou <yu...@gmail.com> on 2016/08/25 14:06:39 UTC

failureDetectionTimeout NotWritablePropertyException

Wonder if anyone understands why I get the following error? All I want to do
is set the failureDetectionTimeout property:

Aug 25, 2016 2:52:31 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance of
class org.apache.ignite.startup.servlet.ServletContextListenerStartup
class org.apache.ignite.IgniteException: Failed to load Ignite
configuration.
        at
org.apache.ignite.startup.servlet.ServletContextListenerStartup.contextInitialized(ServletContextListenerStartup.java:135)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)
        at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)
        at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
        at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
        at
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1862)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
instantiate Spring XML application context
[springUrl=jndi:/localhost/ukpmc/META-INF/apache-ignite.xml, err=Error
creating bean with name 'ignite.cfg' defined in URL
[jndi:/localhost/ukpmc/META-INF/apache-ignite.xml]: Error setting pr
operty values; nested exception is
org.springframework.beans.NotWritablePropertyException: Invalid property
'failureDetectionTimeout' of bean class
[org.apache.ignite.configuration.IgniteConfiguration]: Bean property
'failureDetectionTimeout' is not writable or has an invalid setter method.
Does the pa
rameter type of the setter match the return type of the getter?]
        at
org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.applicationContext(IgniteSpringHelperImpl.java:391)
        at
org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.loadConfigurations(IgniteSpringHelperImpl.java:104)
        at
org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.loadConfigurations(IgniteSpringHelperImpl.java:98)
        at
org.apache.ignite.internal.IgnitionEx.loadConfigurations(IgnitionEx.java:639)
        at
org.apache.ignite.startup.servlet.ServletContextListenerStartup.contextInitialized(ServletContextListenerStartup.java:132)
        ... 13 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'ignite.cfg' defined in URL
[jndi:/localhost/ukpmc/META-INF/apache-ignite.xml]: Error setting property
values; nested exception is
org.springframework.beans.NotWritablePropertyException: Invalid property '
failureDetectionTimeout' of bean class
[org.apache.ignite.configuration.IgniteConfiguration]: Bean property
'failureDetectionTimeout' is not writable or has an invalid setter method.
Does the parameter type of the setter match the return type of the getter?
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
        at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
        at
org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.applicationContext(IgniteSpringHelperImpl.java:381)
        ... 17 more
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid
property 'failureDetectionTimeout' of bean class
[org.apache.ignite.configuration.IgniteConfiguration]: Bean property
'failureDetectionTimeout' is not writable or has an invalid setter method.
Does the parameter type of the sett
er match the return type of the getter?
        at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1064)
        at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:924)
        at
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
        at
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
        ... 28 more

*I'm using Ignite 1.7.0, and my configuration is like below:*

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">
                    
	<bean id="ignite.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">	
	    
		<property name="cacheConfiguration">
			<list>
				
				<bean class="org.apache.ignite.configuration.CacheConfiguration">
					<property name="name" value="session-cache" />

					<property name="cacheMode" value="PARTITIONED"/>
					<property name="backups" value="1"/>
										
					
					<property name="memoryMode" value="OFFHEAP_VALUES"/>
					
					
  					<property name="offHeapMaxMemory" value="#{2 * 1024L * 1024L *
1024L}"/>
  					
					
				    <property name="evictionPolicy">
				        <bean
class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
				            <property name="maxSize" value="10000"/>
				        </bean>
				    </property>  					
					
				</bean>
			</list>
		</property>

		<property name="failureDetectionTimeout" value="15000" /> 

		<property name="discoverySpi">
			<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">	
			
			    <property name="localPort" value="48100"/>
			    <property name="localPortRange" value="10" />
			    			
				<property name="ipFinder">
					<bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.zk.TcpDiscoveryZookeeperIpFinder">
                    	<property name="zkConnectionString"
value="ves-hx-40:2181,ves-hx-41:2181"/>
                	</bean>
                	
				</property>
			</bean>
		</property>
		
		<property name="communicationSpi">
			<bean
class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
				<property name="localPort" value="48500" />
				<property name="localPortRange" value="10" />
			</bean>
		</property>
		
		<property name="binaryConfiguration">
		    <bean class="org.apache.ignite.configuration.BinaryConfiguration">
		        <property name="compactFooter" value="false"/>
		    </bean>
		</property>		
	</bean>
</beans>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/failureDetectionTimeout-NotWritablePropertyException-tp7304.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: failureDetectionTimeout NotWritablePropertyException

Posted by yucigou <yu...@gmail.com>.
Hi Val,

I've just upgraded Spring from version 3.1.2.RELEASE to 3.2.17, and the
problem of setting failureDetectionTimeout is now gone.

(I'm not upgrading to 4.1.0.RELEASE, to keep other modules in my application
happy.)

Thanks for your help.
Yuci



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/failureDetectionTimeout-NotWritablePropertyException-tp7304p7345.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: failureDetectionTimeout NotWritablePropertyException

Posted by yucigou <yu...@gmail.com>.
I just thought of the same thing, the version of Spring :-) But thanks very
much for the explanation. 

I'm currently using Spring version 3.1.2.RELEASE. I'll try a newer version
of Spring today, and hope it won't break any existing functionalities of the
application.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/failureDetectionTimeout-NotWritablePropertyException-tp7304p7333.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: failureDetectionTimeout NotWritablePropertyException

Posted by vkulichenko <va...@gmail.com>.
You config works fine for me. But I noticed that the property accepts
primitive long in setter, but returns Long from getter. I guess this could
cause issues on older versions of Spring?

What version of Spring do you have? Is it the one Ignite depends on?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/failureDetectionTimeout-NotWritablePropertyException-tp7304p7326.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: failureDetectionTimeout NotWritablePropertyException

Posted by yucigou <yu...@gmail.com>.
It does not help.

If I add the following method to IgniteConfiguration.java

    public IgniteConfiguration setFailureTimeout(long
failureDetectionTimeout) {
    	this.failureDetectionTimeout = failureDetectionTimeout;

        return this;
    }

And change the configuration to:

<property name="failureTimeout" value="15000" />

It works. But I really don't understand what is the difference, and why
failureDetectionTimeout does not work for me.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/failureDetectionTimeout-NotWritablePropertyException-tp7304p7310.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: failureDetectionTimeout NotWritablePropertyException

Posted by Vladislav Pyatkov <vl...@gmail.com>.
Hi,

I think you need to use value of long directly, like this:

<property name="failureDetectionTimeout" value="10000L"/>

On Thu, Aug 25, 2016 at 5:06 PM, yucigou <yu...@gmail.com> wrote:

> Wonder if anyone understands why I get the following error? All I want to
> do
> is set the failureDetectionTimeout property:
>
> Aug 25, 2016 2:52:31 PM org.apache.catalina.core.StandardContext
> listenerStart
> SEVERE: Exception sending context initialized event to listener instance of
> class org.apache.ignite.startup.servlet.ServletContextListenerStartup
> class org.apache.ignite.IgniteException: Failed to load Ignite
> configuration.
>         at
> org.apache.ignite.startup.servlet.ServletContextListenerStartup.
> contextInitialized(ServletContextListenerStartup.java:135)
>         at
> org.apache.catalina.core.StandardContext.listenerStart(
> StandardContext.java:4992)
>         at
> org.apache.catalina.core.StandardContext.startInternal(
> StandardContext.java:5490)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>         at
> org.apache.catalina.core.ContainerBase.addChildInternal(
> ContainerBase.java:901)
>         at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
>         at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
>         at
> org.apache.catalina.startup.HostConfig.deployDescriptor(
> HostConfig.java:672)
>         at
> org.apache.catalina.startup.HostConfig$DeployDescriptor.
> run(HostConfig.java:1862)
>         at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
> instantiate Spring XML application context
> [springUrl=jndi:/localhost/ukpmc/META-INF/apache-ignite.xml, err=Error
> creating bean with name 'ignite.cfg' defined in URL
> [jndi:/localhost/ukpmc/META-INF/apache-ignite.xml]: Error setting pr
> operty values; nested exception is
> org.springframework.beans.NotWritablePropertyException: Invalid property
> 'failureDetectionTimeout' of bean class
> [org.apache.ignite.configuration.IgniteConfiguration]: Bean property
> 'failureDetectionTimeout' is not writable or has an invalid setter method.
> Does the pa
> rameter type of the setter match the return type of the getter?]
>         at
> org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.
> applicationContext(IgniteSpringHelperImpl.java:391)
>         at
> org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.
> loadConfigurations(IgniteSpringHelperImpl.java:104)
>         at
> org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.
> loadConfigurations(IgniteSpringHelperImpl.java:98)
>         at
> org.apache.ignite.internal.IgnitionEx.loadConfigurations(
> IgnitionEx.java:639)
>         at
> org.apache.ignite.startup.servlet.ServletContextListenerStartup.
> contextInitialized(ServletContextListenerStartup.java:132)
>         ... 13 more
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'ignite.cfg' defined in URL
> [jndi:/localhost/ukpmc/META-INF/apache-ignite.xml]: Error setting property
> values; nested exception is
> org.springframework.beans.NotWritablePropertyException: Invalid property '
> failureDetectionTimeout' of bean class
> [org.apache.ignite.configuration.IgniteConfiguration]: Bean property
> 'failureDetectionTimeout' is not writable or has an invalid setter method.
> Does the parameter type of the setter match the return type of the getter?
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.createBean(AbstractAutowireCapableBeanFactory.java:456)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.
> getObject(AbstractBeanFactory.java:294)
>         at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.
> getSingleton(DefaultSingletonBeanRegistry.java:225)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
> AbstractBeanFactory.java:291)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
> AbstractBeanFactory.java:193)
>         at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.
> preInstantiateSingletons(DefaultListableBeanFactory.java:609)
>         at
> org.springframework.context.support.AbstractApplicationContext.
> finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(
> AbstractApplicationContext.java:469)
>         at
> org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.
> applicationContext(IgniteSpringHelperImpl.java:381)
>         ... 17 more
> Caused by: org.springframework.beans.NotWritablePropertyException: Invalid
> property 'failureDetectionTimeout' of bean class
> [org.apache.ignite.configuration.IgniteConfiguration]: Bean property
> 'failureDetectionTimeout' is not writable or has an invalid setter method.
> Does the parameter type of the sett
> er match the return type of the getter?
>         at
> org.springframework.beans.BeanWrapperImpl.setPropertyValue(
> BeanWrapperImpl.java:1064)
>         at
> org.springframework.beans.BeanWrapperImpl.setPropertyValue(
> BeanWrapperImpl.java:924)
>         at
> org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(
> AbstractPropertyAccessor.java:76)
>         at
> org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(
> AbstractPropertyAccessor.java:58)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
>         ... 28 more
>
> *I'm using Ignite 1.7.0, and my configuration is like below:*
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans.xsd">
>
>         <bean id="ignite.cfg"
> class="org.apache.ignite.configuration.IgniteConfiguration">
>
>                 <property name="cacheConfiguration">
>                         <list>
>
>                                 <bean class="org.apache.ignite.
> configuration.CacheConfiguration">
>                                         <property name="name"
> value="session-cache" />
>
>                                         <property name="cacheMode"
> value="PARTITIONED"/>
>                                         <property name="backups"
> value="1"/>
>
>
>                                         <property name="memoryMode"
> value="OFFHEAP_VALUES"/>
>
>
>                                         <property name="offHeapMaxMemory"
> value="#{2 * 1024L * 1024L *
> 1024L}"/>
>
>
>                                     <property name="evictionPolicy">
>                                         <bean
> class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
>                                             <property name="maxSize"
> value="10000"/>
>                                         </bean>
>                                     </property>
>
>                                 </bean>
>                         </list>
>                 </property>
>
>                 <property name="failureDetectionTimeout" value="15000" />
>
>                 <property name="discoverySpi">
>                         <bean class="org.apache.ignite.spi.
> discovery.tcp.TcpDiscoverySpi">
>
>                             <property name="localPort" value="48100"/>
>                             <property name="localPortRange" value="10" />
>
>                                 <property name="ipFinder">
>                                         <bean
> class="org.apache.ignite.spi.discovery.tcp.ipfinder.zk.
> TcpDiscoveryZookeeperIpFinder">
>                         <property name="zkConnectionString"
> value="ves-hx-40:2181,ves-hx-41:2181"/>
>                         </bean>
>
>                                 </property>
>                         </bean>
>                 </property>
>
>                 <property name="communicationSpi">
>                         <bean
> class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
>                                 <property name="localPort" value="48500" />
>                                 <property name="localPortRange" value="10"
> />
>                         </bean>
>                 </property>
>
>                 <property name="binaryConfiguration">
>                     <bean class="org.apache.ignite.configuration.
> BinaryConfiguration">
>                         <property name="compactFooter" value="false"/>
>                     </bean>
>                 </property>
>         </bean>
> </beans>
>
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/failureDetectionTimeout-NotWritablePropertyException-
> tp7304.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Vladislav Pyatkov