[Spring-Elasticsearch] java.lang.reflect.MalformedParameterizedTypeException when trying to inject esClient into Spring bean


(Neal Ang) #1

Hi,

I'm trying to use elasticsearch with spring using
dadoonet/spring-elasticsearch.

But I keep hitting this exception
"java.lang.reflect.MalformedParameterizedTypeException"

Heres the stacktrace:

10 Sep 2013 16:19:44 [main] ERROR
org.springframework.web.context.ContextLoader - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'esClient' defined in class path resource [springES.xml]:
Initialization of bean failed; nested exception is
java.lang.reflect.MalformedParameterizedTypeException
Caused by:
java.lang.reflect.MalformedParameterizedTypeException
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:42)
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.(ParameterizedTypeImpl.java:35)
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:77)
at
sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:86)
at
sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:122)
at
sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
at
sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:82)
at java.lang.Class.getGenericInterfaces(Class.java:794)
at
org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate.getDeclaredInterfaces(Java15ReflectionBasedReferenceTypeDelegate.java:121)
at
org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:430)
at
org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65)
at
org.aspectj.weaver.JoinPointSignatureIterator.findSignaturesFromSupertypes(JoinPointSignatureIterator.java:164)
at
org.aspectj.weaver.JoinPointSignatureIterator.hasNext(JoinPointSignatureIterator.java:69)
at
org.aspectj.weaver.patterns.SignaturePattern.matches(SignaturePattern.java:287)
at
org.aspectj.weaver.patterns.KindedPointcut.matchInternal(KindedPointcut.java:106)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:146)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.getShadowMatch(PointcutExpressionImpl.java:235)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesExecution(PointcutExpressionImpl.java:101)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesMethodExecution(PointcutExpressionImpl.java:92)
at
org.springframework.aop.aspectj.AspectJExpressionPointcut.getShadowMatch(AspectJExpressionPointcut.java:349)
at
org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:231)
at
org.springframework.aop.support.AopUtils.canApply(AopUtils.java:205)
at
org.springframework.aop.support.AopUtils.canApply(AopUtils.java:244)
at
org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:278)
at
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:83)
at
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:66)
at
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:296)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:313)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1176)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:285)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
at
com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at
com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at
org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)

This is the contect file that I'm using. Its a file that will be added to a
'main' spring.xml:

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

<!-- util:map id="esproperties">
    <entry key="cluster.name" value="es_neal" />
</util:map -->

<bean id="esClient" 

class="fr.pilato.spring.elasticsearch.ElasticsearchTransportClientFactoryBean"

    <!-- If ElasticsearchTransportClientFactoryBean -->
    <property name="esNodes">
        <list>
            <value>com.sg.neal1:9300</value>
            <value>com.sg.neal2:9300</value>
        </list>
    </property>
</bean>  

Heres the list of spring jars i have in my lib/
spring-agent.jar
spring-aspects.jar
spring-elasticsearch-0.2.0.jar
spring.jar
spring-ldap-1.2-RC1.jar
spring-mock.jar
xbean-spring-2.8.jar

based on the MANIFEST.MF of the jars, I'm using Spring-Version: 2.0.7

Any ideas how I can resolve the exception?

TIA
Neal

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(clandestino_bgd-2) #2

Your spring version is ancient. Try upgrading to 3.x.
hth,
Milan

On Tue, Sep 10, 2013 at 10:28 AM, Neal Ang cyph3rd@gmail.com wrote:

Hi,

I'm trying to use elasticsearch with spring using
dadoonet/spring-elasticsearch.

But I keep hitting this exception
"java.lang.reflect.MalformedParameterizedTypeException"

Heres the stacktrace:

10 Sep 2013 16:19:44 [main] ERROR
org.springframework.web.context.ContextLoader - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'esClient' defined in class path resource [springES.xml]:
Initialization of bean failed; nested exception is
java.lang.reflect.MalformedParameterizedTypeException
Caused by:
java.lang.reflect.MalformedParameterizedTypeException
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:42)
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.(ParameterizedTypeImpl.java:35)
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:77)
at
sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:86)
at
sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:122)
at
sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
at
sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:82)
at java.lang.Class.getGenericInterfaces(Class.java:794)
at
org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate.getDeclaredInterfaces(Java15ReflectionBasedReferenceTypeDelegate.java:121)
at
org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:430)
at
org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65)
at
org.aspectj.weaver.JoinPointSignatureIterator.findSignaturesFromSupertypes(JoinPointSignatureIterator.java:164)
at
org.aspectj.weaver.JoinPointSignatureIterator.hasNext(JoinPointSignatureIterator.java:69)
at
org.aspectj.weaver.patterns.SignaturePattern.matches(SignaturePattern.java:287)
at
org.aspectj.weaver.patterns.KindedPointcut.matchInternal(KindedPointcut.java:106)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:146)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.getShadowMatch(PointcutExpressionImpl.java:235)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesExecution(PointcutExpressionImpl.java:101)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesMethodExecution(PointcutExpressionImpl.java:92)
at
org.springframework.aop.aspectj.AspectJExpressionPointcut.getShadowMatch(AspectJExpressionPointcut.java:349)
at
org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:231)
at
org.springframework.aop.support.AopUtils.canApply(AopUtils.java:205)
at
org.springframework.aop.support.AopUtils.canApply(AopUtils.java:244)
at
org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:278)
at
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:83)
at
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:66)
at
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:296)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:313)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1176)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:285)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
at
com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at
com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at
org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at
org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)

This is the contect file that I'm using. Its a file that will be added to
a 'main' spring.xml:

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

<!-- util:map id="esproperties">
    <entry key="cluster.name" value="es_neal" />
</util:map -->

<bean id="esClient"

class="fr.pilato.spring.elasticsearch.ElasticsearchTransportClientFactoryBean"

    <!-- If ElasticsearchTransportClientFactoryBean -->
    <property name="esNodes">
        <list>
            <value>com.sg.neal1:9300</value>
            <value>com.sg.neal2:9300</value>
        </list>
    </property>
</bean>

Heres the list of spring jars i have in my lib/
spring-agent.jar
spring-aspects.jar
spring-elasticsearch-0.2.0.jar
spring.jar
spring-ldap-1.2-RC1.jar
spring-mock.jar
xbean-spring-2.8.jar

based on the MANIFEST.MF of the jars, I'm using Spring-Version: 2.0.7

Any ideas how I can resolve the exception?

TIA
Neal

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Neal Ang) #3

Hi Milan,

Thanks for your reply. My spring version is admittedly old, unfortunately
the project was done quite awhile ago and lots of codes depends on the
older spring version. Will try to see if I can upgrade the Spring jars.

thanks
Neal

On Tuesday, 10 September 2013 23:19:44 UTC+8, clandestino_bgd wrote:

Your spring version is ancient. Try upgrading to 3.x.
hth,
Milan

On Tue, Sep 10, 2013 at 10:28 AM, Neal Ang <cyp...@gmail.com <javascript:>

wrote:

Hi,

I'm trying to use elasticsearch with spring using
dadoonet/spring-elasticsearch.

But I keep hitting this exception
"java.lang.reflect.MalformedParameterizedTypeException"

Heres the stacktrace:

10 Sep 2013 16:19:44 [main] ERROR
org.springframework.web.context.ContextLoader - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'esClient' defined in class path resource [springES.xml]:
Initialization of bean failed; nested exception is
java.lang.reflect.MalformedParameterizedTypeException
Caused by:
java.lang.reflect.MalformedParameterizedTypeException
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:42)
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.(ParameterizedTypeImpl.java:35)
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:77)
at
sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:86)
at
sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:122)
at
sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
at
sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:82)
at java.lang.Class.getGenericInterfaces(Class.java:794)
at
org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate.getDeclaredInterfaces(Java15ReflectionBasedReferenceTypeDelegate.java:121)
at
org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:430)
at
org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65)
at
org.aspectj.weaver.JoinPointSignatureIterator.findSignaturesFromSupertypes(JoinPointSignatureIterator.java:164)
at
org.aspectj.weaver.JoinPointSignatureIterator.hasNext(JoinPointSignatureIterator.java:69)
at
org.aspectj.weaver.patterns.SignaturePattern.matches(SignaturePattern.java:287)
at
org.aspectj.weaver.patterns.KindedPointcut.matchInternal(KindedPointcut.java:106)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:146)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.getShadowMatch(PointcutExpressionImpl.java:235)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesExecution(PointcutExpressionImpl.java:101)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesMethodExecution(PointcutExpressionImpl.java:92)
at
org.springframework.aop.aspectj.AspectJExpressionPointcut.getShadowMatch(AspectJExpressionPointcut.java:349)
at
org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:231)
at
org.springframework.aop.support.AopUtils.canApply(AopUtils.java:205)
at
org.springframework.aop.support.AopUtils.canApply(AopUtils.java:244)
at
org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:278)
at
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:83)
at
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:66)
at
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:296)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:313)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1176)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:285)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
at
com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at
com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at
org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at
org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)

This is the contect file that I'm using. Its a file that will be added to
a 'main' spring.xml:

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

<!-- util:map id="esproperties">
    <entry key="cluster.name" value="es_neal" />
</util:map -->

<bean id="esClient" 

class="fr.pilato.spring.elasticsearch.ElasticsearchTransportClientFactoryBean"

    <!-- If ElasticsearchTransportClientFactoryBean -->
    <property name="esNodes">
        <list>
            <value>com.sg.neal1:9300</value>
            <value>com.sg.neal2:9300</value>
        </list>
    </property>
</bean>  

Heres the list of spring jars i have in my lib/
spring-agent.jar
spring-aspects.jar
spring-elasticsearch-0.2.0.jar
spring.jar
spring-ldap-1.2-RC1.jar
spring-mock.jar
xbean-spring-2.8.jar

based on the MANIFEST.MF of the jars, I'm using Spring-Version: 2.0.7

Any ideas how I can resolve the exception?

TIA
Neal

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Neal Ang) #4

Hi Milan,

Have managed to upgrade Spring to 3.2.2 after a long hard fight with the
jars and now I'm back to the
same "java.lang.reflect.MalformedParameterizedTypeException".

Please help .

regards
Neal

On Wednesday, 11 September 2013 10:03:40 UTC+8, Neal Ang wrote:

Hi Milan,

Thanks for your reply. My spring version is admittedly old, unfortunately
the project was done quite awhile ago and lots of codes depends on the
older spring version. Will try to see if I can upgrade the Spring jars.

thanks
Neal

On Tuesday, 10 September 2013 23:19:44 UTC+8, clandestino_bgd wrote:

Your spring version is ancient. Try upgrading to 3.x.
hth,
Milan

On Tue, Sep 10, 2013 at 10:28 AM, Neal Ang cyp...@gmail.com wrote:

Hi,

I'm trying to use elasticsearch with spring using
dadoonet/spring-elasticsearch.

But I keep hitting this exception
"java.lang.reflect.MalformedParameterizedTypeException"

Heres the stacktrace:

10 Sep 2013 16:19:44 [main] ERROR
org.springframework.web.context.ContextLoader - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'esClient' defined in class path resource [springES.xml]:
Initialization of bean failed; nested exception is
java.lang.reflect.MalformedParameterizedTypeException
Caused by:
java.lang.reflect.MalformedParameterizedTypeException
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:42)
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.(ParameterizedTypeImpl.java:35)
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:77)
at
sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:86)
at
sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:122)
at
sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
at
sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:82)
at java.lang.Class.getGenericInterfaces(Class.java:794)
at
org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate.getDeclaredInterfaces(Java15ReflectionBasedReferenceTypeDelegate.java:121)
at
org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:430)
at
org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65)
at
org.aspectj.weaver.JoinPointSignatureIterator.findSignaturesFromSupertypes(JoinPointSignatureIterator.java:164)
at
org.aspectj.weaver.JoinPointSignatureIterator.hasNext(JoinPointSignatureIterator.java:69)
at
org.aspectj.weaver.patterns.SignaturePattern.matches(SignaturePattern.java:287)
at
org.aspectj.weaver.patterns.KindedPointcut.matchInternal(KindedPointcut.java:106)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:146)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.getShadowMatch(PointcutExpressionImpl.java:235)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesExecution(PointcutExpressionImpl.java:101)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesMethodExecution(PointcutExpressionImpl.java:92)
at
org.springframework.aop.aspectj.AspectJExpressionPointcut.getShadowMatch(AspectJExpressionPointcut.java:349)
at
org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:231)
at
org.springframework.aop.support.AopUtils.canApply(AopUtils.java:205)
at
org.springframework.aop.support.AopUtils.canApply(AopUtils.java:244)
at
org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:278)
at
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:83)
at
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:66)
at
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:296)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:313)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1176)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:285)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
at
com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at
com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at
org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at
org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at
org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)

This is the contect file that I'm using. Its a file that will be added
to a 'main' spring.xml:

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

<!-- util:map id="esproperties">
    <entry key="cluster.name" value="es_neal" />
</util:map -->

<bean id="esClient" 

class="fr.pilato.spring.elasticsearch.ElasticsearchTransportClientFactoryBean"

    <!-- If ElasticsearchTransportClientFactoryBean -->
    <property name="esNodes">
        <list>
            <value>com.sg.neal1:9300</value>
            <value>com.sg.neal2:9300</value>
        </list>
    </property>
</bean>  

Heres the list of spring jars i have in my lib/
spring-agent.jar
spring-aspects.jar
spring-elasticsearch-0.2.0.jar
spring.jar
spring-ldap-1.2-RC1.jar
spring-mock.jar
xbean-spring-2.8.jar

based on the MANIFEST.MF of the jars, I'm using Spring-Version: 2.0.7

Any ideas how I can resolve the exception?

TIA
Neal

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Prasanth Nair) #5

Hey Neal

2 things to note, make sure spring is 3.XX and keep es version to be .9.0,
now you also need to make sure that you did not keep any solr jars in your
POM dependency

Here is a snap shot of my context xml

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

<beans xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf=
"http://cxf.apache.org/core"

xmlns:context="http://www.springframework.org/schema/context"

xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:amq=
"http://activemq.apache.org/schema/core"

xmlns:jms="http://www.springframework.org/schema/jms" xmlns:util=
"http://www.springframework.org/schema/util"

xmlns:elasticsearch="http://www.pilato.fr/schema/elasticsearch"

xsi:schemaLocation="

   http://www.springframework.org/schema/beans 

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

   http://www.springframework.org/schema/jms 

http://www.springframework.org/schema/jms/spring-jms-3.0.xsd

   http://www.springframework.org/schema/context 

http://www.springframework.org/schema/context/spring-context-3.0.xsd

   http://www.springframework.org/schema/util 

http://www.springframework.org/schema/util/spring-util-3.0.xsd

   http://activemq.apache.org/schema/core 

http://activemq.apache.org/schema/core/activemq-core-5.5.0.xsd

   http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd

   http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd

   http://www.pilato.fr/schema/elasticsearch 

http://www.pilato.fr/schema/elasticsearch/elasticsearch-0.2.xsd">

<util:map id="esproperties">

</util:map>

<bean id="esNode"

class="fr.pilato.spring.elasticsearch.ElasticsearchNodeFactoryBean">

<bean id="esClient"

class=
"fr.pilato.spring.elasticsearch.ElasticsearchTransportClientFactoryBean">

localhost:9300

localhost:9301

On Wednesday, September 11, 2013 7:33:40 AM UTC+5:30, Neal Ang wrote:

Hi Milan,

Thanks for your reply. My spring version is admittedly old, unfortunately
the project was done quite awhile ago and lots of codes depends on the
older spring version. Will try to see if I can upgrade the Spring jars.

thanks
Neal

On Tuesday, 10 September 2013 23:19:44 UTC+8, clandestino_bgd wrote:

Your spring version is ancient. Try upgrading to 3.x.
hth,
Milan

On Tue, Sep 10, 2013 at 10:28 AM, Neal Ang cyp...@gmail.com wrote:

Hi,

I'm trying to use elasticsearch with spring using
dadoonet/spring-elasticsearch.

But I keep hitting this exception
"java.lang.reflect.MalformedParameterizedTypeException"

Heres the stacktrace:

10 Sep 2013 16:19:44 [main] ERROR
org.springframework.web.context.ContextLoader - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'esClient' defined in class path resource [springES.xml]:
Initialization of bean failed; nested exception is
java.lang.reflect.MalformedParameterizedTypeException
Caused by:
java.lang.reflect.MalformedParameterizedTypeException
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:42)
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.(ParameterizedTypeImpl.java:35)
at
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:77)
at
sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:86)
at
sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:122)
at
sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
at
sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:82)
at java.lang.Class.getGenericInterfaces(Class.java:794)
at
org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate.getDeclaredInterfaces(Java15ReflectionBasedReferenceTypeDelegate.java:121)
at
org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:430)
at
org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65)
at
org.aspectj.weaver.JoinPointSignatureIterator.findSignaturesFromSupertypes(JoinPointSignatureIterator.java:164)
at
org.aspectj.weaver.JoinPointSignatureIterator.hasNext(JoinPointSignatureIterator.java:69)
at
org.aspectj.weaver.patterns.SignaturePattern.matches(SignaturePattern.java:287)
at
org.aspectj.weaver.patterns.KindedPointcut.matchInternal(KindedPointcut.java:106)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:146)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.getShadowMatch(PointcutExpressionImpl.java:235)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesExecution(PointcutExpressionImpl.java:101)
at
org.aspectj.weaver.internal.tools.PointcutExpressionImpl.matchesMethodExecution(PointcutExpressionImpl.java:92)
at
org.springframework.aop.aspectj.AspectJExpressionPointcut.getShadowMatch(AspectJExpressionPointcut.java:349)
at
org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:231)
at
org.springframework.aop.support.AopUtils.canApply(AopUtils.java:205)
at
org.springframework.aop.support.AopUtils.canApply(AopUtils.java:244)
at
org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:278)
at
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:83)
at
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:66)
at
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:296)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:313)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1176)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:285)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
at
com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at
com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at
org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at
org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at
org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
at
com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at
com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at
com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at
com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)

This is the contect file that I'm using. Its a file that will be added
to a 'main' spring.xml:

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

<!-- util:map id="esproperties">
    <entry key="cluster.name" value="es_neal" />
</util:map -->

<bean id="esClient" 

class="fr.pilato.spring.elasticsearch.ElasticsearchTransportClientFactoryBean"

    <!-- If ElasticsearchTransportClientFactoryBean -->
    <property name="esNodes">
        <list>
            <value>com.sg.neal1:9300</value>
            <value>com.sg.neal2:9300</value>
        </list>
    </property>
</bean>  

Heres the list of spring jars i have in my lib/
spring-agent.jar
spring-aspects.jar
spring-elasticsearch-0.2.0.jar
spring.jar
spring-ldap-1.2-RC1.jar
spring-mock.jar
xbean-spring-2.8.jar

based on the MANIFEST.MF of the jars, I'm using Spring-Version: 2.0.7

Any ideas how I can resolve the exception?

TIA
Neal

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #6