mybatis+spring配置的时候出错了
Exceptionsendingcontextinitializedeventtolistenerinstanceofclassorg.springframework.w...
Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/classes/spring-config.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: 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 'User'. Cause: java.lang.ClassNotFoundException: Cannot find class: User
求大神指导啊 什么错误啊 展开
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/classes/spring-config.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: 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 'User'. Cause: java.lang.ClassNotFoundException: Cannot find class: User
求大神指导啊 什么错误啊 展开
3个回答
展开全部
Mapper 配置文件发出来
追问
为什么啊
追答
因为你的配置文件错了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2014-08-08 · 知道合伙人软件行家
关注
展开全部
这是说无法创建sqlsessionfactory
原因是你的mybatis-config.xml 找不到 User这个类
你看看mybatis里有没有生名这个User类
原因是你的mybatis-config.xml 找不到 User这个类
你看看mybatis里有没有生名这个User类
追问
找到错误拉,是因为数据结构设计外键设计错了,但是由于mysql连接的jar的版本问题,所以没有提示到正确的错误
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2014-08-07
展开全部
我建议你找个群。发群里带上截图这样很快就能解决
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询