{"action":"created","issue":{"url":"https://api.github.com/repos/dadoonet/spring-elasticsearch/issues/68","labels_url":"https://api.github.com/repos/dadoonet/spring-elasticsearch/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/dadoonet/spring-elasticsearch/issues/68/comments","events_url":"https://api.github.com/repos/dadoonet/spring-elasticsearch/issues/68/events","html_url":"https://github.com/dadoonet/spring-elasticsearch/issues/68","id":73123508,"number":68,"title":"This Spring config works in 1.4.0, crashes on 1.4.1 and 1.4.2","user":{"login":"iwhitfield","id":5376378,"avatar_url":"https://avatars.githubusercontent.com/u/5376378?v=3","gravatar_id":"","url":"https://api.github.com/users/iwhitfield","html_url":"https://github.com/iwhitfield","followers_url":"https://api.github.com/users/iwhitfield/followers","following_url":"https://api.github.com/users/iwhitfield/following{/other_user}","gists_url":"https://api.github.com/users/iwhitfield/gists{/gist_id}","starred_url":"https://api.github.com/users/iwhitfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwhitfield/subscriptions","organizations_url":"https://api.github.com/users/iwhitfield/orgs","repos_url":"https://api.github.com/users/iwhitfield/repos","events_url":"https://api.github.com/users/iwhitfield/events{/privacy}","received_events_url":"https://api.github.com/users/iwhitfield/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-04T20:42:32Z","updated_at":"2015-05-05T19:17:47Z","closed_at":null,"body":"I've been using this library for a while, on version 1.4.0 and everything has been working just fine with this configuration:\r\n\r\n```xml\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n \r\n<beans xmlns=\"http://www.springframework.org/schema/beans\"\r\n       xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n       xmlns:context=\"http://www.springframework.org/schema/context\"\r\n       xmlns:aop=\"http://www.springframework.org/schema/aop\"\r\n       xmlns:elasticsearch=\"http://www.pilato.fr/schema/elasticsearch\"\r\n       xsi:schemaLocation=\"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd\r\n        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd\r\n        http://www.pilato.fr/schema/elasticsearch http://www.pilato.fr/schema/elasticsearch/elasticsearch-0.3.xsd\r\n        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd\">\r\n \r\n    <!-- Enable annotation configuration -->\r\n    <context:annotation-config/>\r\n \r\n    <!-- enable AOP annotation access -->\r\n    <aop:aspectj-autoproxy/>\r\n \r\n    <bean id=\"esProperties\"\r\n          class=\"org.springframework.beans.factory.config.PropertiesFactoryBean\">\r\n        <property name=\"properties\">\r\n            <props>\r\n                <prop key=\"cluster.name\">${es.clustername}</prop>\r\n                <prop key=\"client.transport.sniff\">false</prop>\r\n            </props>\r\n        </property>\r\n    </bean>\r\n \r\n    <elasticsearch:client id=\"esClient\" esNodes=\"${es.nodes}\" properties=\"esProperties\"/>\r\n \r\n</beans>\r\n```\r\n\r\nI noticed today that 1.4.2 is out so I decided to try and upgrade, but whenever I do so, my unit tests fail with this stack trace (happens on both 1.4.1 and 1.4.2):\r\n\r\n```\r\njava.lang.IllegalStateException: Failed to load ApplicationContext\r\n\tat java.net.URLClassLoader$1.run(URLClassLoader.java:372)\r\n\tat java.net.URLClassLoader$1.run(URLClassLoader.java:361)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat java.net.URLClassLoader.findClass(URLClassLoader.java:360)\r\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:424)\r\n\tat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)\r\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:357)\r\n\tat fr.pilato.spring.elasticsearch.ElasticsearchAbstractClientFactoryBean.<clinit>(ElasticsearchAbstractClientFactoryBean.java:156)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:408)\r\n\tat org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)\r\n\tat org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1086)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1038)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:860)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:790)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:542)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:436)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:412)\r\n\tat org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:187)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1112)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)\r\n\tat org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)\r\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)\r\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)\r\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)\r\n\tat org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)\r\n\tat org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)\r\n\tat org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:109)\r\n\tat org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:261)\r\n\tat org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)\r\n\tat org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)\r\n\tat org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)\r\n\tat org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)\r\n\tat org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)\r\n\tat org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)\r\n\tat org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextPrepareTestInstance(AbstractTestNGSpringContextTests.java:145)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)\r\n\tat org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)\r\n\tat org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)\r\n\tat org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)\r\n\tat org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175)\r\n\tat org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107)\r\n\tat org.testng.TestRunner.privateRun(TestRunner.java:767)\r\n\tat org.testng.TestRunner.run(TestRunner.java:617)\r\n\tat org.testng.SuiteRunner.runTest(SuiteRunner.java:334)\r\n\tat org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)\r\n\tat org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)\r\n\tat org.testng.SuiteRunner.run(SuiteRunner.java:240)\r\n\tat org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)\r\n\tat org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)\r\n\tat org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)\r\n\tat org.testng.TestNG.runSuitesLocally(TestNG.java:1149)\r\n\tat org.testng.TestNG.run(TestNG.java:1057)\r\n\tat org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:77)\r\n\tat org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:189)\r\n\tat org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:105)\r\n\tat org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:117)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)\r\n\tat org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:158)\r\n\tat org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)\r\n\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)\r\n```\r\n\r\nPlease note the configuration is identical, only the library version changed. I can try find more info if needed, but this is all I have at this point!"},"comment":{"url":"https://api.github.com/repos/dadoonet/spring-elasticsearch/issues/comments/99189778","html_url":"https://github.com/dadoonet/spring-elasticsearch/issues/68#issuecomment-99189778","issue_url":"https://api.github.com/repos/dadoonet/spring-elasticsearch/issues/68","id":99189778,"user":{"login":"iwhitfield","id":5376378,"avatar_url":"https://avatars.githubusercontent.com/u/5376378?v=3","gravatar_id":"","url":"https://api.github.com/users/iwhitfield","html_url":"https://github.com/iwhitfield","followers_url":"https://api.github.com/users/iwhitfield/followers","following_url":"https://api.github.com/users/iwhitfield/following{/other_user}","gists_url":"https://api.github.com/users/iwhitfield/gists{/gist_id}","starred_url":"https://api.github.com/users/iwhitfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwhitfield/subscriptions","organizations_url":"https://api.github.com/users/iwhitfield/orgs","repos_url":"https://api.github.com/users/iwhitfield/repos","events_url":"https://api.github.com/users/iwhitfield/events{/privacy}","received_events_url":"https://api.github.com/users/iwhitfield/received_events","type":"User","site_admin":false},"created_at":"2015-05-05T19:17:47Z","updated_at":"2015-05-05T19:17:47Z","body":"@dadoonet this is covered in a set of tests using TestNG via a Maven build - unfortunately I can't narrow it down to a specific test in the suite (I'm not sure where exactly it fails, since the stack is thrown via Spring). The autowiring, however, is done at the top of all classes (i.e. before tests have even been loaded). "}}