原创 ClassPathResource的坑, class path resource [xxxx] cannot be resolved to absolute file path because it

我在讀取springboot下templates目錄下excel模板的時候,本地測試使用ClassPathResource都可以正常讀取,但打包成jar包傳到服務器上就無法獲取了. 報錯信息是:class path resource [x

原创 SpringBoot + Dubbo + Excel生成並下載問題彙總:

SpringBoot + Dubbo + Excel生成並下載問題彙總: 1. ClassPathResource 讀不到src/main/resources下的 templates/excel下的excel模板文件。(excel是我在t

原创 Java8中lambda表達式無法拋出受檢異常的問題

//編譯通過 Stream.of("a", "b", "c").forEach(str -> {     throw new RuntimeException(new IOException()); }); 轉換成RuntimeExcep

原创 org.apache.commons.beanutils.PropertyUtils 根據屬性名獲取對象屬性value

private static Object getAttribute(Object obj, String member) throws IllegalAccessException, InvocationTargetException,

原创 Windows 下生成Git SSH key 並配置到Git

Windows 下生成Git SSH key 並配置到Git link: [https://blog.csdn.net/cffishappy/article/details/89371583]

原创 單機Selenium grid環境搭建

1. 下載Selenium grid的jar包 http://selenium-release.storage.googleapis.com/index.html 或者使用Maven下載, 我下載的是selenium-server-sta

原创 @Async註解

https://blog.csdn.net/zzzgd_666/article/details/82658832  @EnableAsync @Configuration class TaskPoolConfig{

原创 FreeMarker 替換內容並以String返回替換後頁面內容

@Autowired private FreemarkerConfigurer configurer; public String markerResult(){ Map<String, Object> map = new

原创 Java 獲取主機名host name

import java.net.InetAddress; import java.net.UnknownHostException; private String getHostName() {         String hostna

原创 java 計算天月季度年的起始結束時間戳(直接運行即可)

import org.frame.util.DateTools; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.

原创 windows搭建 zookeeper + dubbo + dubbo web admin

一.結構圖 二.啓動順序 1.啓動zookeeper     配置:\zookeeper\conf\zoo.cfg     執行 : zookeeper\bin\zkServer.cmd  2.啓動服務提供者(dubbo服務包含在內)

原创 簡單安全高效的Java計數器

本文利用AtomicLong實現了一個安全高效的計數器,利用線程池技術,測試結果符合預期,避免了線程併發操作變量問題,避免使用同步鎖提高了效率。 package com.springapp.mvc; import java.util.c

原创 JFreeChart生成混合圖(柱狀圖折線圖)並插入excel中

效果如下 java code package com.springapp.mvc; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XS