原创 Java垃圾收集器算法
**引用計數算法**:在對象中添加一個引用計數器,每當有一個地方引用他時,計數器值就加一,當引用失效是=時,計數器值就減一,爲零時的對象就是不可能再被使用。優點:雖然佔用了一些額外的內存空間用來計數,但是原理簡單,判定效率也很高
原创 excl表格導出
ServiceImpl包中代碼 @Override public void reportGoodsOrder(GoodsOrderVo goodsOrderVo, OutputStream fos) { List<GoodsOr
原创 spring cloud配置多數據源
配置多個DataSourceConfig與MybatisBossConfig相對應DataSourceConfig:MybatisBossConfig:如果有兩個數據庫,配置兩個即可,同時在application數據庫中配置數據庫連接配置
原创 Template might not exist or might not be accessible by any of the config錯誤
解決方案:1.檢查訪問的地址是否正確; 2.檢查訪問的html模板文件是否存在或者文件名是否正確; 3.檢查html模板文件的位置是否在template文件夾內錯誤問題:缺少HTML模板文件
原创 Tomcat端口被佔用
1.WINDOWS+R進入CMD界面2.在CMD中輸入netstat -ano | findstr 8080查詢佔用端口的進程8080是被佔用的端口,如果佔用的端口爲8100即改爲81003.taskkill -pid 進程pid -f
原创 @QueryParam @RequestBody @PathVariable的區別
handler method 參數綁定常用的註解,我們根據他們處理的Request的不同內容部分分爲四類:(主要講解常用類型)A、處理requet uri 部分(這裏指uri template中variable,不含queryString
原创 Missing URI template variable 'employeeNumber' for method parameter of type String
使用SpringMVC參數註解@PathVariable時出錯提示:Missing URI template variable 'employeeNumber' for method parameter of type String@Re
原创 日常項目錯誤
1.http415錯誤 媒體類型不匹配 @RequestMapping(value = "/delete",method = RequestMethod.DELETE,produces = "application/json",consu
原创 Consider defining a bean of type com.hd.cloud.dao.biz.ShopFansDao in your config
實際上是因爲Mapper沒有被掃到,所以增加dao和config的掃描。也可能是接口寫錯,比如實現層繼承錯誤 改成@SpringBootApplication(scanBasePackages = {"service","dao","co