org.springframework.beans.factory.BeanCreationException

Error creating bean with name 'hazelcastRunner' defined in class path resource [springConfigs/hazelcast/hazelcastRunner.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.bmudda.hazelcast.docker.test.HazelcastRunner]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: PortableFactory[-22] is already registered! com.hazelcast.replicatedmap.impl.client.ReplicatedMapPortableHook$1@7e2d773b -> com.hazelcast.replicatedmap.impl.client.ReplicatedMapPortableHook$1@2173f6d9


Solutions on the web19752

Solution icon of github
via GitHub by bitsofinfo
, 7 months ago
Error creating bean with name 'hazelcastRunner' defined in class path resource [springConfigs/hazelcast/hazelcastRunner.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed

Solution icon of github
via GitHub by bmudda
, 8 months ago
Error creating bean with name 'hazelcastRunner' defined in class path resource [springConfigs/hazelcast/hazelcastRunner.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed

Solution icon of stackoverflow
via Stack Overflow by Unknown author, 1 year ago
Error creating bean with name 'networkElement' defined in class path resource [META-INF/spring/parameterChange.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException

Solution icon of web
Error creating bean with name 'duke' defined in class path resource [springTest/spring-idol.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean

Solution icon of stackoverflow
Error creating bean with name 'hibernateConfiguration' defined in class path resource [pl/wicia/projector/spring/db_beans.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException

Solution icon of github
[com.hazelcast.core.HazelcastInstance]: : Error creating bean with name 'hazelcastInstance' defined in class path resource [com/mycompany/myapp/config/CacheConfiguration.class]: Bean instantiation via factory method failed; nested exception is

Solution icon of spring
via Spring JIRA by Glenn renfro, 1 year ago
Error creating bean with name 'twitterTemplate' defined in class path resource [config/twitterstream.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.social.twitter.api.impl.TwitterTemplate]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/http/impl/client/HttpClients

Solution icon of stackoverflow
Error creating bean with name 'mongoTemplate' defined in class path resource [Beans.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate

Solution icon of spring
via Spring JIRA by Glenn renfro, 1 year ago
Error creating bean with name 'twitterTemplate' defined in class path resource [config/twitterstream.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.social.twitter.api.impl.TwitterTemplate]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/http/impl/client/HttpClients

Solution icon of stackoverflow
Error creating bean with name 'org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$ThymeleafDefaultConfiguration': Bean instantiation via constructor failed; nested exception is

Stack trace

  • org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastRunner' defined in class path resource [springConfigs/hazelcast/hazelcastRunner.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.bmudda.hazelcast.docker.test.HazelcastRunner]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: PortableFactory[-22] is already registered! com.hazelcast.replicatedmap.impl.client.ReplicatedMapPortableHook$1@7e2d773b -> com.hazelcast.replicatedmap.impl.client.ReplicatedMapPortableHook$1@2173f6d9 at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:279)[classes!/:na] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1148)[classes!/:na] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050)[classes!/:na] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)[classes!/:na] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[classes!/:na] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[classes!/:na] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[classes!/:na] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[classes!/:na] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[classes!/:na] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:754)[classes!/:na] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)[classes!/:na] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)[classes!/:na] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)[classes!/:na] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)[classes!/:na] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)[classes!/:na] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)[classes!/:na] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)[classes!/:na] at com.bmudda.util.boot.Application.main(Application.java:21)[classes!/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_45] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_45] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_45] at java.lang.reflect.Method.invoke(Method.java:497)[na:1.8.0_45] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)[hazelcast-docker-spring-test-1.0-RC1.jar:na] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)[hazelcast-docker-spring-test-1.0-RC1.jar:na] at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)[hazelcast-docker-spring-test-1.0-RC1.jar:na] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)[hazelcast-docker-spring-test-1.0-RC1.jar:na] Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.bmudda.hazelcast.docker.test.HazelcastRunner]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: PortableFactory[-22] is already registered! com.hazelcast.replicatedmap.impl.client.ReplicatedMapPortableHook$1@7e2d773b -> com.hazelcast.replicatedmap.impl.client.ReplicatedMapPortableHook$1@2173f6d9 at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)[classes!/:na] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)[classes!/:na] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)[classes!/:na] ... 25 more Caused by: java.lang.IllegalArgumentException: PortableFactory[-22] is already registered! com.hazelcast.replicatedmap.impl.client.ReplicatedMapPortableHook$1@7e2d773b -> com.hazelcast.replicatedmap.impl.client.ReplicatedMapPortableHook$1@2173f6d9 at com.hazelcast.internal.serialization.impl.PortableHookLoader.register(PortableHookLoader.java:87)[classes!/:na] at com.hazelcast.internal.serialization.impl.PortableHookLoader.load(PortableHookLoader.java:54)[classes!/:na] at com.hazelcast.internal.serialization.impl.PortableHookLoader.<init>(PortableHookLoader.java:44)[classes!/:na] at com.hazelcast.internal.serialization.impl.SerializationServiceV1.<init>(SerializationServiceV1.java:88)[classes!/:na] at com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder.createSerializationService(DefaultSerializationServiceBuilder.java:264)[classes!/:na] at com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder.build(DefaultSerializationServiceBuilder.java:218)[classes!/:na] at com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder.build(DefaultSerializationServiceBuilder.java:46)[classes!/:na] at com.hazelcast.instance.DefaultNodeExtension.createSerializationService(DefaultNodeExtension.java:126)[classes!/:na] at com.hazelcast.instance.Node.<init>(Node.java:181)[classes!/:na] at com.hazelcast.instance.HazelcastInstanceImpl.createNode(HazelcastInstanceImpl.java:155)[classes!/:na] at com.hazelcast.instance.HazelcastInstanceImpl.<init>(HazelcastInstanceImpl.java:126)[classes!/:na] at com.hazelcast.instance.HazelcastInstanceFactory.constructHazelcastInstance(HazelcastInstanceFactory.java:218)[classes!/:na] at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:176)[classes!/:na] at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:126)[classes!/:na] at com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:58)[classes!/:na] at com.bmudda.hazelcast.docker.test.HazelcastRunner.<init>(HazelcastRunner.java:39)[classes!/:na] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[na:1.8.0_45] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[na:1.8.0_45] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[na:1.8.0_45] at java.lang.reflect.Constructor.newInstance(Constructor.java:422)[na:1.8.0_45] at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)[classes!/:na] ... 27 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 11 months ago