Springboot+Mybatis:启动报错 String index out of range: -37
springBoot+Druid+Mybatis :启动错误描述
Error parsing SQL Mapper Configuration. Cause: java.lang.StringIndexOutOfBoundsException: String index out of range: -37
1.UnsatisfiedDependencyException
可能原因之一,这个项目目录有中文:
1.项目目录有文件夹是中文
2.项目所属的层级内外层级有中文
解决简易:将整个项目复制到纯英文目录下,且保证项目内所有文件都是纯英文名称。IDEA重新导入打开
原来我的项目内部全部文件都是纯英文的,但是启动还是错,我查看了项目所在的Windows系统文件位置:G:\谷歌下载\JSP源码\xxxx;发现他的外层是中文目录,于是截切项目到F:\WEBProject\Demohander\xxxx;在IDEA中删除之前的项目,打开新目录下的这个项目,再次启动就没问题了。
整合Durid时也出现了问题:
<!--德鲁伊数据库连接池-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.6</version>
</dependency>
Spring Boot 报错org.springframework.jdbc.datasource.embedded.EmbeddedData
解决方式:
- 添加:@EnableAutoConfiguration(exclude = {DruidDataSourceAutoConfigure.class})
- 添加依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
Springboot+Mybatis:启动报错 String index out of range: -37的更多相关文章
- springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde
springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde 创建 ...
- springboot测试启动报错java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
springboot测试启动报错: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you ne ...
- Springboot 之 启动报错-Cannot determine embedded database driver class for database type NONE
Springboot 之 启动报错-数据库 springboot项目在启动时,报如下错误: Error starting ApplicationContext. To display the auto ...
- Spring Boot 启动报错 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37
使用命令 java -jar springBoot.jar 启动项目,结果报错如下: Exception at java.lang.String.substring(String.java:) at ...
- 【spring boot】mybatis启动报错:Consider defining a bean of type 'com.newhope.interview.dao.UserMapper' in your configuration. 【Mapper类不能被找到】@Mapper 和@MapperScan注解的区别
启动报错: 2018-05-16 17:22:58.161 ERROR 4080 --- Disconnected from the target VM, address: '127.0.0.1:50 ...
- mybatis启动报错Mapped Statements collection already contains value for com.autoyol.mapper.trans.TransDispatchingMapper解决
1.检查sqlsession配置,在applicationContext文件中.检查mybatis配置文件. 2.检查TransDispatchingMapper.java 是接口类,无注解. 3.T ...
- Spring boot&Mybatis 启动报错 Failed to auto-configure a DataSource
*************************** APPLICATION FAILED TO START *************************** Description: Fai ...
- Springboot项目启动报错,提示Cannot determine embedded database driver class for database type NONE
我在springboot项目里面引入了数据库的配置: <dependency> <groupId>org.mybatis.spring.boot</groupId> ...
- SpringBoot项目启动报错:java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | ...
- springboot项目启动报错
启动springboot项目报错: NoSuchMethodError: org.apache.tomcat.util.scan.StandardJarScanner.setJarScanFilter ...
随机推荐
- linux使用iptables屏蔽ip地址
一.iptables命令介绍: netfilter/iptables(简称为iptables)组成Linux平台下的包过滤防火墙,与大多数的Linux软件一样,这个包过滤防火墙是免费的,在安装系统的时 ...
- 3、StringBuffer类
StringBuffer类 java.lang.StringBuffer代表可变的字符序列,可以对字符串内容进行增删 很多方法与String相同,但StringBuffer是可变长度的 StringB ...
- Python数据科学手册-机器学习: 流形学习
PCA对非线性的数据集处理效果不太好. 另一种方法 流形学习 manifold learning 是一种无监督评估器,试图将一个低维度流形嵌入到一个高纬度 空间来描述数据集 . 类似 一张纸 (二维) ...
- 3.云原生之Docker容器三大核心概念介绍
转载自:https://www.bilibili.com/read/cv15181760/?from=readlist docker search --no-trunc=false [镜像名称] #搜 ...
- Elasticsearch集群规模和容量规划的底层逻辑
转载自: https://mp.weixin.qq.com/s?__biz=MzI2NDY1MTA3OQ==&mid=2247484628&idx=1&sn=666e416ae ...
- PPR的断管
1. 小管径PPR管的断管 2. 大管径PPR管的断管
- 原生Redis跨数据中心双向同步优化实践
一.背景 公司基于业务发展以及战略部署,需要实现在多个数据中心单元化部署,一方面可以实现多数据中心容灾,另外可以提升用户请求访问速度.需要保证多数据中心容灾或者实现用户就近访问的话,需要各个数据中心拥 ...
- 市面上erp软件那么多,为什么很多卖家选择定制erp?
为什么选择定制ERP?适合自己的才是最好的啊!就连头部ERP企业提供给用户的ERP系统,应该也没有不进行个性化定制的吧,匹配很重要!规模不同.行业不同.发展阶段不同.生产模式不同.管理理念不同,适用的 ...
- Codeforces Round #442 (Div. 2) B. Nikita and string
题意:求最长可以分a b a为三部分子串,a b a可以为空 思路在代码里 1 #include<cstdio> 2 #include<iostream> 3 #include ...
- 大数据技术之HBase原理与实战归纳分享-上
@ 目录 概述 定义 特点 数据模型 概述 逻辑结构 物理存储结构 数据模型 应用场景 基础架构 安装 前置条件 部署 启动服务 高可用 Shell操作 基础操作 命令空间 DDL DML 概述 定义 ...