报错为:
org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in com.oracle.mapper.OrdertableMapper.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io
.IOException: Could not find resource com.oracle.mapper.OrdertableMapper.xml
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
### Error building SqlSession.
### The error may exist in com.oracle.mapper.OrdertableMapper.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io
.IOException: Could not find resource com.oracle.mapper.OrdertableMapper.xml
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
原因是在mybatis-config.xml中的mappers中
<mappers>
<mapper resource="com.oracle.mapper.OrdertableMapper.xml"/>
</mappers>
<mappers>
<mapper resource="com.oracle.mapper.OrdertableMapper.xml"/>
</mappers>
正确的是:
<mappers>
<mapper resource=" com/oracle/mapper/OrdertableMapper.xml"/>
</mappers>
<mapper resource=" com/oracle/mapper/OrdertableMapper.xml"/>
</mappers>
别把路径搞错了