org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'countryServiceImpl': Unsatisfied dependency expressed through field 'countrySearchRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'countrySearchRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No id property found for class com.amway.wrp.domain.Country!


Samebug tips1

If you're unit testing, you should instantiate only the service and mock the dependencies. If you're testing integration, you should add all the mocking to the configurations file.


5 months ago
Expert tip

Solutions on the web289

Solution icon of github
'countrySearchRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No id property found for class com.amway.wrp.domain.Country!

Solution icon of stackoverflow
Error creating bean with name 'dynamoDBController': Unsatisfied dependency expressed through field 'dynamoDBRep'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dynamoDBRep': Invocation of

Solution icon of stackoverflow
via Stack Overflow by Divi
, 3 months ago
Error creating bean with name 'EmployeeServiceImpl': Unsatisfied dependency expressed through field 'EmployeeRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EmployeeRepository

Solution icon of stackoverflow
Error creating bean with name 'clientMetierImpl': Unsatisfied dependency expressed through field 'clientRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientRepository

Solution icon of stackoverflow
Error creating bean with name 'logsController': Unsatisfied dependency expressed through field 'logRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logRepository': Invocation of

Solution icon of stackoverflow
Error creating bean with name 'adapterKindParserServiceImpl': Unsatisfied dependency expressed through field 'nodeAdapterInstanceDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name

Solution icon of stackoverflow
via Stack Overflow by Smahane
, 9 months ago
Error creating bean with name 'peticionServiceImpl': Unsatisfied dependency expressed through field 'peticionRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'peticionRepository

Solution icon of stackoverflow
via Stack Overflow by karim hagui
, 2 months ago
Error creating bean with name 'scheduledTasks': Unsatisfied dependency expressed through field 'appRepo'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'operationRepo': Invocation of init

Solution icon of stackoverflow
Error creating bean with name 'customerController': Unsatisfied dependency expressed through field 'customerDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerDAO': Invocation of

Solution icon of github
Error creating bean with name 'accountSaltAction': Unsatisfied dependency expressed through field 'accountSaltDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountSaltDAO

Stack trace

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'countryServiceImpl': Unsatisfied dependency expressed through field 'countrySearchRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'countrySearchRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No id property found for class com.amway.wrp.domain.Country!
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:592)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:370)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1219)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:754)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
	at com.amway.wrp.WrpServicesApp.main(WrpServicesApp.java:66)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'countrySearchRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No id property found for class com.amway.wrp.domain.Country!
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1131)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1059)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:589)
	... 22 more
Caused by: java.lang.IllegalArgumentException: No id property found for class com.amway.wrp.domain.Country!
	at org.springframework.util.Assert.notNull(Assert.java:115)
	at org.springframework.data.elasticsearch.repository.support.ElasticsearchEntityInformationCreatorImpl.getEntityInformation(ElasticsearchEntityInformationCreatorImpl.java:50)
	at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory.getEntityInformation(ElasticsearchRepositoryFactory.java:59)
	at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory.getTargetRepository(ElasticsearchRepositoryFactory.java:65)
	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:199)
	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:266)
	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:252)
	at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean.afterPropertiesSet(ElasticsearchRepositoryFactoryBean.java:55)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
	... 32 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

Once, 3 weeks ago
Samebug visitor profile picture
Unknown user
Once, 4 months ago
Samebug visitor profile picture
Unknown user
Once, 4 months ago
18 times, 4 months ago
16 times, 4 months ago
194 more bugmates