错误总结
加油吧 - -为了未来 !
1.SpringBoot项目整合jasypt使用java -jar命令无法启动问题
报错信息:
APPLICATION FAILED TO START
Description:
Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
**问题描述: 说实话这个问题困扰了我很久,我还一直以为是使用了jasypt的原因,因为IDEA上完美运行,打成jar包就运行不了,启动banner都不一样啊,我居然没看出来,嗨~,我还以为当真无法找到数据库的配置文件,一直以为是jasypt的原因,今晚偶然发现,打包的classes里面居然没有配置文件,瞬间 - - 笑哭 **
解决方法:pom在build里面添加以下配置
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
2.后台给前端的超长Long类型出现精度丢失问题
解决方法
- 将Long换成String
- 使用fastjson提供的注解@JsonSerialize(using = ToStringSerializer.class)
3.使用EasyExcel本地导出正确,服务端导出乱码
乱码情况如下:

服务器日志捕获的异常信息:
com.alibaba.excel.exception.ExcelGenerateException: Can not close IO.
原因是未关闭流ByteArrayOutputStream。
本文汇总了SpringBoot项目在整合jasypt、处理后台给前端超长Long类型精度丢失及使用EasyExcel服务端导出时遇到的问题。针对这些问题,作者提供了详细的错误描述和解决方法,包括检查jar包配置、转换数据类型以及确保流的正确关闭。
1354

被折叠的 条评论
为什么被折叠?



