{"action":"created","issue":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/2399","labels_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/2399/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/2399/comments","events_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/2399/events","html_url":"https://github.com/jhipster/generator-jhipster/issues/2399","id":118817397,"number":2399,"title":"@Mapper produces BeanCreationException","user":{"login":"arushijain45","id":10897969,"avatar_url":"https://avatars.githubusercontent.com/u/10897969?v=3","gravatar_id":"","url":"https://api.github.com/users/arushijain45","html_url":"https://github.com/arushijain45","followers_url":"https://api.github.com/users/arushijain45/followers","following_url":"https://api.github.com/users/arushijain45/following{/other_user}","gists_url":"https://api.github.com/users/arushijain45/gists{/gist_id}","starred_url":"https://api.github.com/users/arushijain45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arushijain45/subscriptions","organizations_url":"https://api.github.com/users/arushijain45/orgs","repos_url":"https://api.github.com/users/arushijain45/repos","events_url":"https://api.github.com/users/arushijain45/events{/privacy}","received_events_url":"https://api.github.com/users/arushijain45/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jhipster/generator-jhipster/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-25T11:32:48Z","updated_at":"2015-11-26T07:29:45Z","closed_at":"2015-11-26T07:29:45Z","body":"I have created an application using JHipster with DTO enabled, mongo database, build system: gradle.\r\nWithout any changes in any of configuration file, I ran the application in spring.\r\nI got following issue:\r\n\r\n[WARN] org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userProfileResource': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sample.jhipster.web.rest.mapper.UserProfileMapper com.sample.jhipster.web.rest.UserProfileResource.userProfileMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.sample.jhipster.web.rest.mapper.UserProfileMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\r\n[INFO] com.sample.jhipster.config.CacheConfiguration - Closing Cache Manager\r\n[WARN] org.apache.catalina.loader.WebappClassLoaderBase - The web application [ROOT] appears to have started a thread named [cluster-1-localhost:27017] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\r\n sun.misc.Unsafe.park(Native Method)\r\n java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)\r\n java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)\r\n com.mongodb.ServerMonitor$ServerMonitorRunnable.waitForSignalOrTimeout(ServerMonitor.java:177)\r\n com.mongodb.ServerMonitor$ServerMonitorRunnable.waitForNext(ServerMonitor.java:158)\r\n com.mongodb.ServerMonitor$ServerMonitorRunnable.run(ServerMonitor.java:124)\r\n java.lang.Thread.run(Unknown Source)\r\n[WARN] org.apache.catalina.loader.WebappClassLoaderBase - The web application [ROOT] appears to have started a thread named [MongoCleaner1930932235] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\r\n java.lang.Thread.sleep(Native Method)\r\n com.mongodb.Mongo$CursorCleanerThread.run(Mongo.java:796)\r\n[ERROR] org.springframework.boot.SpringApplication - Application startup failed\r\norg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userProfileResource': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sample.jhipster.web.rest.mapper.UserProfileMapper com.sample.jhipster.web.rest.UserProfileResource.userProfileMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.sample.jhipster.web.rest.mapper.UserProfileMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:838) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]\r\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]\r\n\tat org.springframework.boot.SpringApplication.doRun(SpringApplication.java:347) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:295) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]\r\n\tat com.sample.jhipster.Application.main(Application.java:74) [bin/:na]\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_65]\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_65]\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_65]\r\n\tat java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_65]\r\n\tat org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.3.0.RELEASE.jar:1.3.0.RELEASE]\r\nCaused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sample.jhipster.web.rest.mapper.UserProfileMapper com.sample.jhipster.web.rest.UserProfileResource.userProfileMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.sample.jhipster.web.rest.mapper.UserProfileMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\t... 20 common frames omitted\r\nCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.sample.jhipster.web.rest.mapper.UserProfileMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]\r\n\t... 22 common frames omitted\r\n\r\nI could not find solution for this error. Any suggestion would be highly appreciated."},"comment":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/comments/159834933","html_url":"https://github.com/jhipster/generator-jhipster/issues/2399#issuecomment-159834933","issue_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/2399","id":159834933,"user":{"login":"jdubois","id":316835,"avatar_url":"https://avatars.githubusercontent.com/u/316835?v=3","gravatar_id":"","url":"https://api.github.com/users/jdubois","html_url":"https://github.com/jdubois","followers_url":"https://api.github.com/users/jdubois/followers","following_url":"https://api.github.com/users/jdubois/following{/other_user}","gists_url":"https://api.github.com/users/jdubois/gists{/gist_id}","starred_url":"https://api.github.com/users/jdubois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdubois/subscriptions","organizations_url":"https://api.github.com/users/jdubois/orgs","repos_url":"https://api.github.com/users/jdubois/repos","events_url":"https://api.github.com/users/jdubois/events{/privacy}","received_events_url":"https://api.github.com/users/jdubois/received_events","type":"User","site_admin":false},"created_at":"2015-11-26T07:29:45Z","updated_at":"2015-11-26T07:29:45Z","body":"This is probably an IDE misconfiguration (I'm not saying this is easy to configure! See http://jhipster.github.io/using_dtos.html ), as @atomfrede couldn't reproduce it with Mvn/Gradle."}}