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

上面是错误的关键部分

错误原因:在one-to-many注解配置: @OneToMany (mappedBy = "Articles"),mappedBy指向的是要关联的属性,而不是要关联的类,
        如果这样配置,hibernate则会找com.wangzhe.model.Keyword类下面的Articles 属性。但实际上没有这个属性,就会报上面的异常
   方法:指定到实际关联的属性:即:@OneToMany (mappedBy = "articles ")

mappedBy reference an unknown target entity property解决方法的更多相关文章

  1. org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.entity.annotations.House.district in

    org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.entity. ...

  2. org.hibernate.AnnotationException: mappedBy reference an unknown target entity property

    org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: xxxxxxx 原因是 ...

  3. Module 'mysql' already loaded in Unknown on line 0解决方法

    Module 'mysql' already loaded in Unknown on line 0解决方法 直接进入php.ini 把;extension=mysql.so注释掉就好了

  4. Cannot make a static reference to the non-static method的解决方法

    报错原因:在一个类中写了一个public String getContent()方法和一个main()方法,getContent()方法中包含了getClass()方法,在main()方法中直接调用了 ...

  5. mysql碰到unknown variable 'xxxx' 的解决方法

    在使用mysqlbinlog查看日志的时候碰到了一个问题, 错误提示如下: /usr/local/mysql/bin/mysqlbinlog: unknown variable 'default-ch ...

  6. File targeting 'AMD64' is not compatible with the project's target platform 'x86' 解决方法

     我在使用vs2010制作64位安装包时出现了以下问题: File targeting 'AMD64' is not compatible with the project's target plat ...

  7. mount: unknown filesystem type ‘ntfs’ 解决方法

    问题: mount –t ntfs /dev/sde1 /mnt/mount: unknown filesystem type ‘ntfs’ 这是由于CentOS release 6.6(Final) ...

  8. centos7执行umount提示:device is busy或者target is busy解决方法

    问题描述: 因为挂载错了,想取消挂载,但是umount报告如下错误: [root@zabbix /]# umount /dev/sdc1 umount: /data1: target is busy. ...

  9. java.lang.IllegalStateException: Unknown Priority XXXX 的解决方法

    异常信息: java.lang.IllegalStateException: Unknown Priority SYS_ERR_SMS at org.apache.log4j.Category.pri ...

随机推荐

  1. GEOS库学习之三:空间关系、DE-9IM和谓词

    要判断两个多边形的关系,实际上属于几何图形空间关系判断.几何图形并不只有多边形一种,它包括点.线.面构成的任何图形,两两之间相互关系也有很多种,因此空间关系非常复杂.根据前人的研究,总结出了DE-9I ...

  2. 20145215《Java程序设计》第6周学习总结

    20145215<Java程序设计>第六周学习总结 教材学习内容总结 输入/输出 InputStream与OutputStream 从应用程序角度来看,如果要将数据从来源取出,可以使用输入 ...

  3. So... what's up?

    So... testing markdown editor what to learn in May? html5 canvas api codeigniter framework var test ...

  4. Linux下高频命令分类辑录(基本使用篇)

    本文目的:总结linux下常用命令的基本使用方法 文件权限: 文档权限设置命令:chmod 数字模式: 文档权限由-rwxrwxrwx十个字符组成,其中第一个代表文档类型,后面九个字符按照顺序分为三组 ...

  5. [USACO2005][POJ2226]Muddy Fields(二分图最小点覆盖)

    题目:http://poj.org/problem?id=2226 题意:给你一个字符矩阵,每个位置只能有"*"或者“.",连续的横着或者竖的“*"可以用一块木 ...

  6. js中的DOM操作(1)

    一.操作子节点 childNodes 通过该方式可以获取父节点下的所有子节点,但是由于浏览器的差异,这写节点中可能包含文本节点. <!DOCTYPE html> <html> ...

  7. FileStream大文件复制

    FileStream缓冲读取和写入可以提高性能.FileStream读取文件的时候,是先讲流放入内存,经Flash()方法后将内存中(缓冲中)的数据写入文件.如果文件非常大,势必消耗性能.特封装在Fi ...

  8. groovyConsole — the Groovy Swing console

    1. Groovy : Groovy Console The Groovy Swing Console allows a user to enter and run Groovy scripts. T ...

  9. HDU 3401 Trade dp+单调队列优化

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3401 Trade Time Limit: 2000/1000 MS (Java/Others)Mem ...

  10. Html设置图标icon

    html head添加: <link rel="icon" href="/favicon.ico" type="image/x-icon&quo ...