Exception in thread “main” org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘articleDaoImpl’: Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.wangzhe.model.Keyword.Articles in com.wangzhe.model.Article.keywords
The above is the key part of the error
The reason for the error: In the one-to-many annotation configuration: @OneToMany (mappedBy = “Articles”), mappedBy points to the attribute to be associated, not the class to be associated.
If this is configured, hibernate will find com.wangzhe. Articles property under the model.Keyword class. But in fact without this attribute, the above exception
method will be reported : Assign to the actual associated attribute: namely: @OneToMany (mappedBy = “articles”)
Similar Posts:
- mybatis: Property ‘configuration’ and ‘configLocation’ can not specified with together
- How to Solve the login error of Spring + Shiro CacheManager
- Cannot resolve reference to bean ‘entityManagerFactory’ while setting constructor argument
- [Solved] Springboot startup error: org.springframework.beans.factory.unsatisfieddependenceexception…
- Spring Error: Bean instantiation via factory method failed StackOverflowError
- Property ‘dataSource’ threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy
- [Solved] Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘custom.property.hello’ in value “${custom.property.hello}” config
- [Solved] JAVA Error: org.springframework.beans.factory.BeanCreationException
- Cannot resolve reference to bean ‘txPoint’ while setting bean property ‘pointcut’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘txPoint’
- Spring cloud consumer feign injection error [How to Solve]