您的位置:首页 > 移动开发

mappedBy reference an unknown target entity property

2016-01-12 16:15 369 查看
mappedBy reference an unknown target entity property: com.chinacache.oss.entity.resource.ChannelSmsUpStreamToIp.channelSmsUpStream in com.chinacache.oss.entity.resource.ChannelSmsUpStream.channelSmsUpStreamToIps
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:1094)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1044)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
... 80 more

如题: mappedBy  一个未知的实体属性channelSmsUpStream ,导致的错误,然而我在channelSmsUpStreamToIps里面已经定义了channelSmsUpStream 属性。最后经过三小时的排查 是因为getChannelSmsUpStream()方法多了一个l,即 getChannelSmsUpStreaml(), 属性channelSmsUpStream 的get方法写错导致无法找到对应的属性;

ps. 查到网上,出现这个问题的另一个原因:mappedBy是关联实体的某个属性(如channelSmsUpStream ),但是写成了这个属性对应的变量类型(如ChannelSmsUpStream )
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: