Hi,
Following is my configuration file :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="cacheFactory" class="com.tangosol.net.DefaultConfigurableCacheFa ctory">
<constructor-arg value="cache-config-client.xml" />
</bean>
<bean id="invocationService" factory-bean="cacheFactory" factory-method="ensureService">
<constructor-arg type="java.lang.String" value="remoteInvocationService"/>
</bean>
</beans>
and the code snippet creating beans from this file is :
context = new ClassPathXmlApplicationContext(
new String[] {"beans-bootstrap.xml"});
but this is not working and throwing the exception mentioned in the subject line.
Following is the error stack trace :
Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'invocationService' defined in class path resource [beans-coherence.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionSt oreException: Factory method [public com.tangosol.net.Service com.tangosol.net.DefaultConfigurableCacheFactory.e nsureService(java.lang.String)] threw exception; nested exception is com.tangosol.net.messaging.ConnectionException
Related cause: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'invocationService' defined in class path resource [beans-coherence.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.tangosol.run.xml.XmlElement]: Ambiguous factory method argument types - did you specify the correct bean references as factory method arguments?
at org.springframework.beans.factory.support.Construc torResolver.instantiateUsingFactoryMethod(Construc torResolver.java:396)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateUsingFactory Method(AbstractAutowireCapableBeanFactory.java:936 )
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:851)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:514)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:485)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 51)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:169)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:413)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:735)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:369)
at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:122)
at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:76)
at com.rbsfm.gss.cache.loader.BootStrap.main(BootStra p.java:22)
Caused by: org.springframework.beans.factory.BeanDefinitionSt oreException: Factory method [public com.tangosol.net.Service com.tangosol.net.DefaultConfigurableCacheFactory.e nsureService(java.lang.String)] threw exception; nested exception is com.tangosol.net.messaging.ConnectionException
at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:127)
at org.springframework.beans.factory.support.Construc torResolver.instantiateUsingFactoryMethod(Construc torResolver.java:387)
... 16 more
Can anyone suggest what is the problem with the configuration? Does the problem lies with spring container or the bean is not geting created because of com.tangosol.net.messaging.ConnectionException
I am using spring-core-2.5.0 and my java version is Java 1.5.0_14


Reply With Quote
