tk.mybatis 报错:tk.mybatis.mapper.MapperException: tk.mybatis.mapper.MapperException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

摘要:
-1torg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'apiLogMapper' defined in file : Invocation of init method failed; nested exception is tk.mybatis.mapper.MapperException: tk.mybatis.mapper.MapperException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:741)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
    at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:550)
    at org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh(AbstractApplicationContext.java:40002)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:41008)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)

xml配置文件如下

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xxx.web.open.mapper.ApiLogMapper">
    <insert id="logsSave"></insert>

    <select id="logsQuery" resultType="com.xxx.web.open.bean.ApiLog"></select>
    <select id="queryById" resultType="com.xxx.web.open.bean.ApiLog"></select>
</mapper>

java类文件

@Mapper
public interface ApiLogMapper extends MyBaseMapper<ApiLog> {

    Page<ApiLog> logsQuery(LogsQuery logsQuery);

    ApiLog queryById(Long id);

    void logsSave(ApiLog logs);
}

实体

import com.xxx.web.bean.PagesStatic;
import lombok.Data;

public class ApiLog{


}

出错原因:实体ApiLog没有属性

参考来源:http://xcx1024.com/ArtInfo/46996.html

免责声明:文章转载自《tk.mybatis 报错:tk.mybatis.mapper.MapperException: tk.mybatis.mapper.MapperException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇go笔记-限速器(limiter)Django根据数据库表反向生成models下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

thinkphp 验证码

在控制器中定义一个控制器,一定要开启 session class PublicAction extends Action {    public function verify()    {        session('[start]');        import('ORG.Util.Image');        Image::buildImag...

Vue简洁及基本用法

初识Vue 一.什么是Vue vue属于前端知识,在学习vue之前,需要简单了解HTML、css、JavaScript的知识。Vue是框架。 Vue是一套构建用户界面的渐进式架构。vue只关注视图层,采用自底向上增量开发的设计。 Vue是为了通过简单的API实现响应的数据绑定 和 组合的视图组件。 二.IDEA中使用Vue 打开idea,找到file...

ehcache.xml

<?xml version="1.0" encoding="UTF-8"?> <!-- CacheManager Configuration ========================== An ehcache.xml corresponds to a single CacheManager. See instructions...

asp中接收到querystring是utf8编码的处理方式

<% response.charset = "utf-8"response.write URLDecode(request.querystring("msg") +"<BR>") Function URLDecode(sConvert)     Dim aSplit     Dim sOutput     Dim I     If IsN...

前端缓存http请求

需求: 1、 重复的请求,使用缓存 2、 不重复的请求,允许发送 3、 连续两次重复的发送,两次返回的结果是一样的,且第二次不发送请求 1、搭建前端服务 vue-cli 一步到位  <template> <div class="hello"> <button v-on:click="getrs(1)">...

SpringBoot整合Mybatis-Plus报错org.apache.ibatis.binding.BindingException

SpringBoot整合Mybatis-Plus报错org.apache.ibatis.binding.BindingException Mapper接口,被Spring注入后,却无法正常的使用mapper.xml的sql;你的接口已经成功的被扫描到,但是当Spring尝试注入一个代理(MyBatista实现)的实现类后,却无法正常使用。这里的可能发生的情...