为了账号安全,请及时绑定邮箱和手机立即绑定

请问这个什么问题

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in com/imooc/config/sqlxml/Message.xml
### The error occurred while processing mapper_resultMap[MessageResult]
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'UserAlias'.  Cause: java.lang.ClassNotFoundException: Cannot find class: UserAlias
org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:51)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:35)
com.imooc.db.DBAccess.getSqlSession(DBAccess.java:15)
com.imooc.daoImpl.MessageDaoImpl.show(MessageDaoImpl.java:27)
com.imooc.serviceImpl.MessageServiceImpl.show(MessageServiceImpl.java:15)
com.imooc.servlet.ListServlet.doGet(ListServlet.java:25)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause

org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'UserAlias'.  Cause: java.lang.ClassNotFoundException: Cannot find class: UserAlias
org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:105)
org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:88)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:49)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:35)
com.imooc.db.DBAccess.getSqlSession(DBAccess.java:15)
com.imooc.daoImpl.MessageDaoImpl.show(MessageDaoImpl.java:27)
com.imooc.serviceImpl.MessageServiceImpl.show(MessageServiceImpl.java:15)
com.imooc.servlet.ListServlet.doGet(ListServlet.java:25)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause

java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'UserAlias'.  Cause: java.lang.ClassNotFoundException: Cannot find class: UserAlias
org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:113)
org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:88)
org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:311)
org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:103)
org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:88)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:49)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:35)
com.imooc.db.DBAccess.getSqlSession(DBAccess.java:15)
com.imooc.daoImpl.MessageDaoImpl.show(MessageDaoImpl.java:27)
com.imooc.serviceImpl.MessageServiceImpl.show(MessageServiceImpl.java:15)
com.imooc.servlet.ListServlet.doGet(ListServlet.java:25)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause

org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'UserAlias'.  Cause: java.lang.ClassNotFoundException: Cannot find class: UserAlias
org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:94)
org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:79)
org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:128)
org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:121)
org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:111)
org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:88)
org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:311)
org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:103)
org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:88)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:49)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:35)
com.imooc.db.DBAccess.getSqlSession(DBAccess.java:15)
com.imooc.daoImpl.MessageDaoImpl.show(MessageDaoImpl.java:27)
com.imooc.serviceImpl.MessageServiceImpl.show(MessageServiceImpl.java:15)
com.imooc.servlet.ListServlet.doGet(ListServlet.java:25)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause

org.apache.ibatis.type.TypeException: Could not resolve type alias 'UserAlias'.  Cause: java.lang.ClassNotFoundException: Cannot find class: UserAlias
org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:109)
org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:115)
org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:92)
org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:79)
org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:128)
org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:121)
org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:111)
org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:88)
org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:311)
org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:103)
org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:88)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:49)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:35)
com.imooc.db.DBAccess.getSqlSession(DBAccess.java:15)
com.imooc.daoImpl.MessageDaoImpl.show(MessageDaoImpl.java:27)
com.imooc.serviceImpl.MessageServiceImpl.show(MessageServiceImpl.java:15)
com.imooc.servlet.ListServlet.doGet(ListServlet.java:25)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause

java.lang.ClassNotFoundException: Cannot find class: UserAlias
org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:188)
org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:87)
org.apache.ibatis.io.Resources.classForName(Resources.java:250)
org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:105)
org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:115)
org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:92)
org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:79)
org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:128)
org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:121)
org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:111)
org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:88)
org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:311)
org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:103)
org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:88)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:49)
org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:35)
com.imooc.db.DBAccess.getSqlSession(DBAccess.java:15)
com.imooc.daoImpl.MessageDaoImpl.show(MessageDaoImpl.java:27)
com.imooc.serviceImpl.MessageServiceImpl.show(MessageServiceImpl.java:15)
com.imooc.servlet.ListServlet.doGet(ListServlet.java:25)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.27 logs.

Apache Tomcat/7.0.27


正在回答

1 回答

public class MessageDaoImpl implements MessageDao {


@Override

public List<Message> show() {

List<Message> l=new ArrayList<Message>();

DBAccess dbAccess=new DBAccess();

SqlSession sqlSession=null;

try {

sqlSession=dbAccess.getSqlSession();

//通过sqlSession执行SQL语句

l = sqlSession.selectList("Message.show");

} catch (IOException e) {

e.printStackTrace();

}finally{

if(sqlSession!=null){

sqlSession.close();

}

}

return l;


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

请问这个什么问题

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信