您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> Web开发 >> (jsp)ssh框架oracle连接测试出错

(jsp)ssh框架oracle连接测试出错

来源:网络整理     时间:2016/5/31 16:05:28     关键词:ORACLE,ssh框架

关于网友提出的“(jsp)ssh框架oracle连接测试出错”问题疑问,本网通过在网上对“(jsp)ssh框架oracle连接测试出错”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题:(jsp)ssh框架oracle连接测试出错
描述:

oraclessh开发java

测试类代码

@Test
public void test1() {
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:app*.xml");
    BaseService baseService = applicationContext.getBean("baseService",BaseService.class);
    
    NewsType entity = new NewsType(null, "aaaa", "aaada",null, null);
    
    baseService.saveOrUpdateObject(entity);
   
}

applicationContext.xml



www/csdn/news/domain/NewsType.hbm.xml
www/csdn/news/domain/Admin.hbm.xml
www/csdn/news/domain/Users.hbm.xml
www/csdn/news/domain/Books.hbm.xml
www/csdn/news/domain/Orders.hbm.xml



spring-dao.xml


<>
parent="hibernateDaoSupport" />
<>
parent="hibernateDaoSupport" scope="singleton" lazy-init="default" />
<>
parent="hibernateDaoSupport" scope="singleton" lazy-init="default" />
<>
parent="hibernateDaoSupport" scope="singleton" lazy-init="default" />
<>
parent="hibernateDaoSupport" scope="singleton" lazy-init="default" />

spring-service.xml





<>
parent="baseService">


<>
parent="baseService">


<>
parent="baseService">


<>
parent="baseService">




解决方案1:

错误信息61行:
 org.hibernate.PropertyNotFoundException: Could not find a getter for orcersnumber in class www.csdn.news.domain.Orders
这个错误是字段映射错误了,spring通过hbm文件到实体,找不到字段对应的getter方法而导致的错误。


以上介绍了“(jsp)ssh框架oracle连接测试出错”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/1435377.html

相关图片

相关文章