Spring Boot's DAO layer inherits JPA boot error

Source: Internet
Author: User
Org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating Bean with Name ' Xxxcontroller ': Unsatisfied dependency expressed through field ' Xxxservice '; Nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating beans with Name ' Xxxtservice ': Unsatisfied dependency expressed through field ' Xxxdao '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Xxxdao ': Invocation of Init method failed; Nested exception is Java.lang.IllegalArgumentException:Not a managed type:class baoming.model.xxx at Org.springframewor K.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject ( autowiredannotationbeanpostprocessor.java:587) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.annotation.InjectionMetadata.inject (injectionmetadata.java:91) ~[ Spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beanS.factory.annotation.autowiredannotationbeanpostprocessor.postprocesspropertyvalues ( autowiredannotationbeanpostprocessor.java:373) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean ( abstractautowirecapablebeanfactory.java:1344) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:578) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:501) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.abstractbeanfactory.lambda$dogetbean$0 (AbstractBeanFactory.java:317) ~[spring-beans-5.0.5.release.jar:5.0.5.release] At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (Defaultsingletonbeanregistry.java:228) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:315) ~[ Spring-beans-5.0.5.release.jar:5.0.5.release] At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:199) ~[ Spring-beans-5.0.5.release.jar:5.0.5.release] At Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:760) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:869) ~[spring-context-5.0.5.release.jar:5.0.5.release] at Org.springframework.context.support.AbstractApplicationContext.refresh (abstractapplicationcontext.java:550) ~[ Spring-context-5.0.5.release.jar:5.0.5.release] At Org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.reFresh (servletwebserverapplicationcontext.java:140) ~[spring-boot-2.0.1.release.jar:2.0.1.release] at Org.springframework.boot.SpringApplication.refresh (springapplication.java:759) [Spring-boot-2.0.1.release.jar : 2.0.1.RELEASE] at Org.springframework.boot.SpringApplication.refreshContext (springapplication.java:395) [ Spring-boot-2.0.1.release.jar:2.0.1.release] at Org.springframework.boot.SpringApplication.run ( springapplication.java:327) [Spring-boot-2.0.1.release.jar:2.0.1.release] at Org.springframework.boot.SpringApplication.run (springapplication.java:1255) [Spring-boot-2.0.1.release.jar : 2.0.1.RELEASE] at Org.springframework.boot.SpringApplication.run (springapplication.java:1243) [ Spring-boot-2.0.1.release.jar:2.0.1.release] at baoming. Loveurlapplication.main (LOVEURLAPPLICATION.JAVA:14) [Classes/:na] caused by: Org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating Bean with Name ' Xxxservice ': Unsatisfied dependency expressed through field ' EFFECTISEGHTDAO '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Effectiseghtdao ': Invocation of Init method failed; Nested exception is Java.lang.IllegalArgumentException:Not a managed type:class baoming.model.xxx at Org.springframewor K.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject ( autowiredannotationbeanpostprocessor.java:587) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.annotation.InjectionMetadata.inject (injectionmetadata.java:91) ~[ Spring-beans-5.0.5.release.jar:5.0.5.release] At Org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues ( autowiredannotationbeanpostprocessor.java:373) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean ( abstractautowirecapablebeanfactory.java:1344) ~[spring-beans-5.0.5.release.Jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:578) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:501) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.abstractbeanfactory.lambda$dogetbean$0 (AbstractBeanFactory.java:317) ~[spring-beans-5.0.5.release.jar:5.0.5.release] At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:228) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:315) ~[ Spring-beans-5.0.5.release.jar:5.0.5.release] At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:199) ~[ Spring-beanS-5.0.5.release.jar:5.0.5.release] At Org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate (dependencydescriptor.java:251) ~ [Spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency ( defaultlistablebeanfactory.java:1138) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency ( defaultlistablebeanfactory.java:1065) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject (autowiredannotationbeanpostprocessor.java:584) ~[spring-beans-5.0.5.release.jar:5.0.5.release] ... Common frames omitted caused by:org.springframework.beans.factory.BeanCreationException:Error creating bean with Nam E ' Effectiseghtdao ': Invocation of Init method failed; Nested exception is java.lang.IllegalArgumentException:Not a managed Type:class baoming.model.xxx at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1702) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:579) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:501) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.abstractbeanfactory.lambda$dogetbean$0 (AbstractBeanFactory.java:317) ~[spring-beans-5.0.5.release.jar:5.0.5.release] At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:228) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractBeAnfactory.dogetbean (abstractbeanfactory.java:315) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:199) ~[ Spring-beans-5.0.5.release.jar:5.0.5.release] At Org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate (dependencydescriptor.java:251) ~ [Spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency ( defaultlistablebeanfactory.java:1138) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency ( defaultlistablebeanfactory.java:1065) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject (autowiredannotationbeanpostprocessor.java:584) ~[spring-beans-5.0.5.release.jar:5.0.5.release] ... Common FramesOmitted caused By:java.lang.IllegalArgumentException:Not a managed type:class baoming.model.xxx at Org.hibernate.metam
	Odel.internal.MetamodelImpl.managedType (metamodelimpl.java:472) ~[hibernate-core-5.2.16.final.jar:5.2.16.final] At Org.springframework.data.jpa.repository.support.jpametamodelentityinformation.<init> ( jpametamodelentityinformation.java:73) ~[spring-data-jpa-2.0.6.release.jar:2.0.6.release] at Org.springframework.data.jpa.repository.support.JpaEntityInformationSupport.getEntityInformation ( jpaentityinformationsupport.java:66) ~[spring-data-jpa-2.0.6.release.jar:2.0.6.release] at Org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getEntityInformation ( jparepositoryfactory.java:181) ~[spring-data-jpa-2.0.6.release.jar:2.0.6.release] at Org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository ( jparepositoryfactory.java:119) ~[spring-data-jpa-2.0.6.release.jar:2.0.6.release] at Org.springframework.data.jpa.repositoRy.support.JpaRepositoryFactory.getTargetRepository (jparepositoryfactory.java:102) ~[ Spring-data-jpa-2.0.6.release.jar:2.0.6.release] At Org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository ( repositoryfactorysupport.java:298) ~[spring-data-commons-2.0.6.release.jar:2.0.6.release] at Org.springframework.data.repository.core.support.repositoryfactorybeansupport.lambda$afterpropertiesset$3 ( repositoryfactorybeansupport.java:287) ~[spring-data-commons-2.0.6.release.jar:2.0.6.release] at Org.springframework.data.util.Lazy.getNullable (lazy.java:141) ~[spring-data-commons-2.0.6.release.jar:2.0.6. RELEASE] at Org.springframework.data.util.Lazy.get (lazy.java:63) ~[spring-data-commons-2.0.6.release.jar:2.0.6. RELEASE] at Org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet ( repositoryfactorybeansupport.java:290) ~[spring-data-commons-2.0.6.release.jar:2.0.6.release] at Org.springframework.data.jpa.repository.support.Jparepositoryfactorybean.afterpropertiesset (jparepositoryfactorybean.java:102) ~[ Spring-data-jpa-2.0.6.release.jar:2.0.6.release] At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1761) ~[spring-beans-5.0.5.release.jar:5.0.5.release] at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1698) ~[spring-beans-5.0.5.release.jar:5.0.5.release] ... Common frames omitted

XXX is the name of the error

Solutions

DAO layer Inherits JPA Then there is the entity class corresponding to the database, then this entity class XXX must have annotations--@Entity--

Import javax.persistence.Entity;



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.