问题记录与解决
新建maven项目右侧缺少maven窗口
解决方法
顶级包下pom.xml 右键add as a maven project
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-netflix-ribbon?
解决方法
顶级包下pom.xml 右键add as a maven project
yml 中文件@包裹的字符无法识别 如@artified@
解决方法
在项目发布路径 执行命令mvn spring-boot:run
git 提交443错误 LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
解决方法
git目录下执行 git config --global http.sslBackend “openssl”
idea 明明存在的类却报红
解决方法
清理idea文件索引和本地缓存
文件=>清理缓存
maven打包出错
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project allbs-test: There are test failures.
Please refer to D:\AllbsWorkspace\allbs-utils-all\allbs-utils-all\allbs-test\target\surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
解决方法
关闭单元测试 或者mvn clean -DskipTests
Error attempting to get column ‘operate_user_name’ from result set. Cause: java.sql.SQLDataException: Cannot determine value type from string
产生原因:实体类lombok的@Builder注解导致mybatis映射失败
解决方法
去除@Builder
maven package 或者 deploy 控制台乱码
解决方法
添加-Dfile.encoding=GBK
java.lang.NoSuchFieldError:Companion
解决方法
okio包冲突,版本不和minio版本的okhttp中的okio版本对应
idea无法识别java文件,同时右侧maven工具栏中无法正常显示dependencys
解决方法
file->Project Structure->Modules->Add->Import Modules
后台管理系统后台菜单关联采用group_contact导致部分菜单勾选失效
解决方法
#查询最大值
SHOW VARIABLES LIKE “group_concat_max_len”;
group_concat长度限制默认是1024导致的
SET GLOBAL group_concat_max_len=10240000;
SET SESSION group_concat_max_len=10240000;
idea无法识别yml文件,无法变为叶子形状的图标
解决方法
如下添加
maven打包占位符问题,打包后无法读取logback-spring.xml中的${}
解决方法
移除
以下面这种方式控制
java8时间格式转换问题
Could not write JSON: Java 8 date/time type java.time.LocalDateTime
not supported by default
解决方法
首先需要在pom中添加jackson-datatype-jsr310依赖
如果需要在redis直接储存含有LocalDateTime的实体类,可以将redis的序列化反序列化如下配置,将自动转换为指定的时间格式
@Configuration
@AllArgsConstructor
@AutoConfigureBefore(RedisAutoConfiguration.class)
public class RedisConfig {
@Bean
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>();
Jackson2JsonRedisSerializer<Object> serializer = new Jackson2JsonRedisSerializer<>(Object.class);
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JavaTimeParser());
serializer.setObjectMapper(mapper);
redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
redisTemplate.setValueSerializer(serializer);
redisTemplate.setHashValueSerializer(serializer);
redisTemplate.setConnectionFactory(redisConnectionFactory);
return redisTemplate;
}
}
public class JavaTimeParser extends SimpleModule {
public JavaTimeParser() {
super(PackageVersion.VERSION);
this.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
this.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
this.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern("HH:mm:ss")));
this.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
this.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
this.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern("HH:mm:ss")));
}
}
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 ALLBS!
评论