做作业的过程中发现页面一直出不来,出现如下报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [conf/applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\.......GoodsDao.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.hand.ssm.dto.Goods'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.hand.ssm.dto.Goods
看来看去是因为重复定义,之前不小心把文件放进同一个dao文件家里面了,打开报错内容中的文件位置[E:\.......GoodsDao.xml]'(根据的你的报错),发现GoodsDao.xml和NewsDao.xml中内容是一样的。删掉其中一个就可以运行了。