Invalid property 'connectionPoolSize' of bean class when using Hazelcast client using spring configuration.

346 views
Skip to first unread message

Ankit Singh

unread,
Apr 22, 2014, 1:59:09 AM4/22/14
to haze...@googlegroups.com
Hi,

I am trying to configure my client using spring configuration. Below is the configuration.

 <hz:client id="client">
        <hz:group name="dev" password="password" />
        <hz:network>
            <hz:member>10.164.195.114</hz:member>
        </hz:network>
    </hz:client>

But when i am launching my appln, I am getting below error ..

SRVE0283E: Exception caught while initializing context: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'client': Cannot create inner bean '(inner bean)' of type [com.hazelcast.client.config.ClientConfig] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'connectionPoolSize' of bean class [com.hazelcast.client.config.ClientConfig]: Bean property 'connectionPoolSize' 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.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:282)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:615)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:441)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1025)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:921)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2220)
    at [internal classes]
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'connectionPoolSize' of bean class [com.hazelcast.client.config.ClientConfig]: Bean property 'connectionPoolSize' 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.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1042)
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:902)
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1420)
    ... 23 more

It seems to be product issue as  i saw similar type of issue on another link -

Please provide resolution ASAP as we are going to use IMDG solution in our application and we are doing POC on different products avail (Gemfire/ExtremeScale/HazelCast) and i believe if this issue is not resolved, we ll going to use other product.

Thanks,
Ankit Singh


Peter Veentjer

unread,
Apr 22, 2014, 2:48:27 AM4/22/14
to haze...@googlegroups.com
Can you try with 3.2.1-SNAPSHOT? I checked the discussion you linked to, and it appears to be fixed in 3.2.1-SNAPSHOT.


--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at http://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/94b1bffd-c421-40b0-acb5-bffadb42d3fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Max Moldenhauer

unread,
Apr 23, 2014, 7:57:11 AM4/23/14
to haze...@googlegroups.com
I'm having this same problem and I don't think it is fixed in the latest code which I'm looking at here. https://github.com/hazelcast/hazelcast/blob/master/hazelcast-spring/src/main/java/com/hazelcast/spring/HazelcastClientBeanDefinitionParser.java

Shouldn't the call to handleSSLConfig be taking the child node and not the parent node? The same goes for the handleSocketInterceptorConfig call.
Thanks

Max Moldenhauer

unread,
Apr 23, 2014, 12:57:32 PM4/23/14
to haze...@googlegroups.com
I realized I'm getting a different error related to SSL for the following config:
<hz:network connection-attempt-limit="2147483647"
                    connection-attempt-period="10000">
            <hz:member>localhost:5701</hz:member>
            <hz:ssl enabled="true" factory-class-name="com.hazelcast.nio.ssl.BasicSSLContextFactory">
                    <hz:properties>
                        <hz:property name="keyStore">hazelcast-key-store.jks</hz:property>
                        <hz:property name="keyStorePassword">localHazelcastStorePass</hz:property>
                        <hz:property name="trustStore">hazelcast-trust-store.jks</hz:property>
                        <hz:property name="trustStorePassword">localHazelcastStorePass</hz:property>
                        <hz:property name="protocol">TLS</hz:property>
                    </hz:properties>
            </hz:ssl>
        </hz:network>

Here is the error:
Caused By: org.springframework.beans.NotWritablePropertyException: Invalid property 'connectionAttemptLimit' of bean class [com.hazelcast.config.SSLConfig]: Bean property 'connectionAttemptLimit' 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.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1042)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:902)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1420)
Truncated. see log file for complete stacktrace

Ankit Singh

unread,
Apr 24, 2014, 3:44:51 AM4/24/14
to haze...@googlegroups.com
Hi,

I found the root cause of such type of issues.
Issue is with xsd. While comparing hazelcast-spring-3.1.xsd and hazelcast-spring-3.2.xsd, i found that 'connectionPoolSize' tag is optional in 3.1 but its removed in 3.2, so, it tries to set the property which is not there in the ClientConfig file.

I downgraded the jars to hazelcast 3.1 version and error is removed .

I can see the "hazelcast-spring-3.2.xsd" is present in jar but not found in below url.

http://www.hazelcast.com/schema/spring/hazelcast-spring-3.2.xsd

Can you please publish the latest 3.2 xsd , so that we can use it with latest jars.

Max Moldenhauer

unread,
Apr 24, 2014, 8:55:22 AM4/24/14
to haze...@googlegroups.com
I don't think my problem is related to a xsd as it is available in my jar. I've added a pull request for some code changes that fixed the error for me to the issue referenced above.
Reply all
Reply to author
Forward
0 new messages