Index and length must refer to a location within the string是什么错?

这个是我在使用,string.substring时出现的,这个错误有两个方面,一个是index越限,另一个是length越限。比如:strComm.substring(strComm.length-2,strComm.length);这里面就是length越界了,这个是因为我对sunstring不熟悉,他的第二个参数,表示的是你要的自串的长度。 

String length must be a multiple of four

10-29

保存和查询数据的时候都会报这么个错误。。。。这是什么问题?rn数据库编码是UTF-8mb4rnrnCaused by: java.lang.IllegalArgumentException: Failed to decrypt.rn at com.alibaba.druid.filter.config.ConfigFilter.decrypt(ConfigFilter.java:212)rn at com.alibaba.druid.filter.config.ConfigFilter.init(ConfigFilter.java:124)rn at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:345)rn at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:622)rn at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:618)rn at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:79)rn at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)rn at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)rn at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:81)rn at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67)rn at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:279)rn at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:72)rn at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:47)rn at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:105)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:152)rn ... 40 morernCaused by: java.lang.IllegalArgumentException: String length must be a multiple of four.rn at com.alibaba.druid.util.Base64.base64ToByteArray(Base64.java:128)rn at com.alibaba.druid.util.Base64.base64ToByteArray(Base64.java:110)rn at com.alibaba.druid.filter.config.ConfigTools.decrypt(ConfigTools.java:126)rn at com.alibaba.druid.filter.config.ConfigFilter.decrypt(ConfigFilter.java:204)

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试

关闭