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. Hello,cnblog‘s world!

    纠结了许久,终于选在这个地方安家.之所以选在这里,是因为这里是个很干净的社区. 之前一直在其他博文网站里发文章,可是越到后来,发现页面广告越来越多.真正对自己有价值的内容越来越少,虽然已经使用过几年了 ...

  2. 一款Android开源的下拉刷新动画

    无意间在GitHub看到的,就Down了下来.但是作者是用AndroidStudio开发的,这边移动Eclipse供小伙伴们下载使用. 截图 这么好的东西因为字数不够不让分享,得了,贴段代码吧 pac ...

  3. C语言操作符优先级

    C语言操作符优先级 优先级 运算符 含    义 要求运算 对象的个数 结合方向 1 () [] -> . 圆括号 下标运算符 指向结构体成员运算符 结构体成员运算符 自左至右 2 ! 逻辑非运 ...

  4. matlab中fopen 和 fprintf函数总结

    matlab中fopen函数在指定文件打开的实例如下: *1)"fopen"打开文件,赋予文件代号. 语法1:FID= FOPEN(filename,permission) 用指定 ...

  5. WPF MVVM 写一个健壮的INotifyPropertyChanged基类

    当我们用MVVM的时候要实现INotifyPropertyChanged,如果你是基于.net4.5以下的framework(.net4.5已有新特性我这里就不说了) 你很可能会这么写 public ...

  6. Bootstrap系列 -- 19. 焦点状态

    表单主要用来与用户沟通,好的表单就能更好的与用户进行沟通,而好的表单一定离不开表单的控件状态. 表单状态的作用: 每一种状态都能给用户传递不同的信息,比如表单有焦点的状态可以告诉用户可以输入或选择东西 ...

  7. C# HttpWebRequest提交数据方式浅析

    C# HttpWebRequest提交数据方式学习之前我们先来看看什么是HttpWebRequest,它是 .net 基类库中的一个类,在命名空间 System.Net 下面,用来使用户通过HTTP协 ...

  8. js判断页面点击事件

    <input type="submit" name="sb1" id="sb1" onclick="queryclick() ...

  9. 求根号m(巴比伦算法)

    巴比伦算法是针对求根号m的近似值情况的,它的思想是这样的: 设根号m=X0,则如果枚举有答案X(X<X0),则m/X>X0,当精度要求不高的时候,我们可以看成X=m/X=X0,而如果精度要 ...

  10. android之imgView插件的使用

    在开发中我们经常要用到图片下载功能,但我们可以在github上淘一些比较好的插件,这里介绍一款叫smartImageView的插件. 这里是其地址https://github.com/loopj/an ...