Tree [dccb26]
master
/
History
Read Me
2013.09.14
项目环境:
j2ee5规范
jdk1.6
spring 2.5.6
hibernate 3
servlet2.5
MySQL Server 5.5/mysql-connector-java-5.0.8.jar/Navicat 11.0
项目架构:
spring mvc + hibernate + spring
表结构:
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`uname` varchar(40) DEFAULT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
碰到的问题以及解决办法:
缺少jar包的问题一个一个根据错误信息解决了
一个错误no mapping entity:com.sxt.po.User这个问题困扰了我很多时间,
(起先以为是没有配置mysql数据库的缘故,其实和这个没有关系)应该是User类的注解没有起作用,
我debug了hibernateTemplate.save时执行的代码,打开AnnotationSessionFactoryBean类的源码,没有找到原因。
最后重启服务器,意外的发现少了cglib的jar,把这个jar加上,ok!
收获:
自己关联了spring的bean、orm等jar的source,第一次尝试读了一下。
×
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.