【转】spring boot maven plugin 引发的idea中文控制台中文乱码惨案 2021年9月14日 | Leave a comment https://blog.csdn.net/weixin_34194702/article/de… Read More
spring boot Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.core.ConnectionCallback 2021年9月14日 | Leave a comment 问题: . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.5.2) 2021-09-14 11:19:24.759 INFO 5740 --- [ main] App : Starting App using Java 11.0.9 on ts-tangfh with PID 5740 (C:\hello\target\classes started by tangfh in C:\hello) 2021-09-14 11:19:24.762 INFO 5740 --- [ main] App : No active profile set, falling back to default profiles: default 2021-09-14 11:19:24.854 WARN 5740 --- [ main] ionWarningsApplicationContextInitializer : ** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package. 2021-09-14 11:19:25.832 WARN 5740 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:C:\Users\tangfh\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.5.2\spring-boot-autoconfigure-2.5.2.jar!/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration.class]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration due to org.springframework.jdbc.core.ConnectionCallback not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake) 2021-09-14 11:19:25.839 INFO 5740 --- [ main] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2021-09-14 11:19:25.856 ERROR 5740 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:C:\Users\tangfh\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.5.2\spring-boot-autoconfigure-2.5.2.jar!/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration.class]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration due to org.springframework.jdbc.core.ConnectionCallback not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake) at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:452) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:315) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:276) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:296) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.2.jar:2.5.2] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.2.jar:2.5.2] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.2.jar:2.5.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.2.jar:2.5.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.2.jar:2.5.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.2.jar:2.5.2] at App.main(App.java:11) ~[classes/:na] Caused by: java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration due to org.springframework.jdbc.core.ConnectionCallback not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake) at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:54) ~[spring-boot-autoconfigure-2.5.2.jar:2.5.2] at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:88) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:71) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isConditionMatch(ClassPathScanningCandidateComponentProvider.java:513) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isCandidateComponent(ClassPathScanningCandidateComponentProvider.java:496) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:430) ~[spring-context-5.3.8.jar:5.3.8] ... 20 common frames omitted Caused by: java.lang.NoClassDefFoundError: org.springframework.jdbc.core.ConnectionCallback at org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseCondition.getMatchOutcome(DataSourceAutoConfiguration.java:139) ~[spring-boot-autoconfigure-2.5.2.jar:2.5.2] at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-2.5.2.jar:2.5.2] ... 26 common frames omitted Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.core.ConnectionCallback at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:766) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1083) ~[na:na] ... 28 common frames omitted Process finished with exit code 1 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.5.2) 2021-09-14 11:19:24.759 INFO 5740 --- [ main] App : Starting App using Java 11.0.9 on ts-tangfh with PID 5740 (C:\hello\target\classes started by tangfh in C:\hello)2021-09-14 11:19:24.762 INFO 5740 --- [ main] App : No active profile set, falling back to default profiles: default2021-09-14 11:19:24.854 WARN 5740 --- [ main] ionWarningsApplicationContextInitializer : ** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package. 2021-09-14 11:19:25.832 WARN 5740 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:C:\Users\tangfh\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.5.2\spring-boot-autoconfigure-2.5.2.jar!/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration.class]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration due to org.springframework.jdbc.core.ConnectionCallback not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)2021-09-14 11:19:25.839 INFO 5740 --- [ main] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2021-09-14 11:19:25.856 ERROR 5740 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:C:\Users\tangfh\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.5.2\spring-boot-autoconfigure-2.5.2.jar!/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration.class]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration due to org.springframework.jdbc.core.ConnectionCallback not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake) at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:452) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:315) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:276) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:296) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.2.jar:2.5.2] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.2.jar:2.5.2] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.2.jar:2.5.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.2.jar:2.5.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.2.jar:2.5.2] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.2.jar:2.5.2] at App.main(App.java:11) ~[classes/:na]Caused by: java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration due to org.springframework.jdbc.core.ConnectionCallback not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake) at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:54) ~[spring-boot-autoconfigure-2.5.2.jar:2.5.2] at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:88) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:71) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isConditionMatch(ClassPathScanningCandidateComponentProvider.java:513) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isCandidateComponent(ClassPathScanningCandidateComponentProvider.java:496) ~[spring-context-5.3.8.jar:5.3.8] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:430) ~[spring-context-5.3.8.jar:5.3.8] ... 20 common frames omittedCaused by: java.lang.NoClassDefFoundError: org.springframework.jdbc.core.ConnectionCallback at org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseCondition.getMatchOutcome(DataSourceAutoConfiguration.java:139) ~[spring-boot-autoconfigure-2.5.2.jar:2.5.2] at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-2.5.2.jar:2.5.2] ... 26 common frames omittedCaused by: java.lang.ClassNotFoundException: org.springframework.jdbc.core.ConnectionCallback at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:766) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1083) ~[na:na] ... 28 common frames omitted Process finished with exit code 1 &nbs… Read More
microsoft devops server markdown 中插入目录 2021年9月14日 | Leave a comment 解决: [[_TOC_]] 1 [[_TOC_]] … Read More
windows 开发电脑采用 docker 发布到 linux docker 服务器的脚本 2021年9月8日 | Leave a comment 问题: 解决: 本地windows 电脑执行 deploy.bat 把 jar 上传到服务器去… Read More
[未解决] java11 连接 sqlserver 2014 报错 The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12] 2021年9月7日 | Leave a comment 问题: windows 10 上正常的 java 程序,部署到 centos 后报错 [crayon-6638… Read More
spring mvc 导出 excel 2021年8月31日 | Leave a comment 问题: 解决: package com.telsafe.crccdemo.rest; import org.apache.poi.ss.usermodel.CellType; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.view.document.AbstractXlsView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @Controller @RequestMapping("export") public class ExportController { final UserService userService; public ExportController(final UserService userService) { this.userService = userService; } @PostMapping("users") ModelAndView users(@RequestParam(value = "path", required = false) String path) { final var list = .../// new ArrayList<UserVo> return new ModelAndView(new UserXlsView(), Map.of("list", list)); } static class UserXlsView extends AbstractXlsView { @Override protected void buildExcelDocument(final Map<String, Object> map, final org.apache.poi.ss.usermodel.Workbook workbook, final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse) throws Exception { Objects.requireNonNull(workbook); var sheet = workbook.createSheet(); final List<UserVo> users = (List<UserVo>) map.get("list"); for (int i = 0; i < users.size(); ++i) { final var user = users.get(i); final var row = sheet.createRow(i); var indexCell = row.createCell(0, CellType.NUMERIC); indexCell.setCellValue(user.getIndex()); row.createCell(1, CellType.STRING).setCellValue(user.getName()); row.createCell(2, CellType.STRING).setCellValue(user.getCompanyName()); row.createCell(3, CellType.STRING).setCellValue(user.getDepartmentName()); row.createCell(4, CellType.STRING).setCellValue(user.getPositionName()); } } } } 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 package com.telsafe.crccdemo.rest; import org.apache.poi.ss.usermodel.CellType;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.PostMapping;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestParam;import org.springframework.web.servlet.ModelAndView;import org.springframework.web.servlet.view.document.AbstractXlsView; import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import java.util.List;import java.util.Map;import java.util.Objects;import java.util.stream.Collectors; @Controller@RequestMapping("export")public class ExportController { final UserService userService; public ExportController(final UserService userService) { this.userService = userService; } @PostMapping("users") ModelAndView users(@RequestParam(value = "path", required = false) String path) { final var list = .../// new ArrayList<UserVo> return new ModelAndView(new UserXlsView(), Map.of("list", list)); } static class UserXlsView extends AbstractXlsView { @Override protected void buildExcelDocument(final Map<String, Object> map, final org.apache.poi.ss.usermodel.Workbook workbook, final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse) throws Exception { Objects.requireNonNull(workbook); var sheet = workbook.createSheet(); final List<UserVo> users = (List<UserVo>) map.get("list"); for (int i = 0; i < users.size(); ++i) { final var user = users.get(i); final var row = sheet.createRow(i); var indexCell = row.createCell(0, CellType.NUMERIC); indexCell.setCellValue(user.getIndex()); row.createCell(1, CellType.STRING).setCellValue(user.getName()); row.createCell(2, CellType.STRING).setCellValue(user.getCompanyName()); row.createCell(3, CellType.STRING).setCellValue(user.getDepartmentName()); row.createCell(4, CellType.STRING).setCellValue(user.getPositionName()); } } }} … Read More
Spring Boot OpenID Connect 备忘 2021年8月25日 | Leave a comment 问题: SpringBoot 2.5.x 如何集成 OpenID Connect 登录 解决: … Read More