mybatis configuration 一些标签配置问题

The content of element type "configuration" must match "(properties>settings>typeAliases>typeHandlers>objectFactory>objectWrapperFactory>plugins>environments>mappers?)".

(properties>settings>typeAliases>typeHandlers>objectFactory>objectWrapperFactory>plugins>environments>mappers

表示在configuration.xml中标签的顺序必须要按顺序写下来,按照上边的顺序依次向后排列书写。

 

其中对<typeAliases>标签的配置容易出现下列错误:

 

org.apache.ibatis.exceptions.PersistenceException:

### Error building SqlSession.

### The error may exist in SQL MapperConfiguration

### Cause:org.apache.ibatis.builder.BuilderException: Error parsing SQL MapperConfiguration. Cause: java.lang.NullPointerException

        org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)

    org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:54)

    org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:38)

        com.imooc.db.DBAccess.getSqlSession(DBAccess.java:21)

        com.imooc.dao.CommandDAO.queryCommandListByPage(CommandDAO.java:69)

        com.imooc.service.QueryService.queryCommandListByPage(QueryService.java:58)

        com.imooc.servlet.ListServlet.doGet(ListServlet.java:42)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:624)

        javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

 

configuration.xml中:


    UserAlias" type="com.imooc.entity.Page"/>
 




 
 
 

 



 
   
     
       
     

     
       
       
       
       
     

   

 

  
 
   
   
   
 



command.xml中:resultType="UserAlias"与configuration.xml中alias别名相对应

你可能感兴趣的:(Java,问题)