原创 引入了一個類卻無法使用

現象: import org.elasticsearch.client.Client; import org.elasticsearch.client.transport.TransportClient; import org.elast

原创 windows logstash cannot find log4j2.properties file

問題:windows logstash cannot find log4j2.properties file 解決方案: 找到文件logstash-core/lib/logstash/runner.rb 將LogStash::Log

原创 Mac Intellj idea 修改jvm參數

轉自:http://www.etwiki.cn/java/modify-the-default-size-of-intellj-idea-.html 1、在Finder中找到/Applications/Intellij Idea

原创 springmvc http請求 406

原因:當control中有requestMapping與html頁面名相同,則springmvc認爲你是請求的接口,即使帶了後綴.html,springmvc仍然返回該接口該返回的數據,若該接口返回json數據,由於帶了.html後綴,s

原创 MyBatis綁定錯誤--BindingException:Invalid bound statement (not found)

問題描述: spring+註解配置mybatis,調用方法時報錯如題 原因: 調用該mybatis接口時,spring會初始化該接口,會從上向下解析裏面每個方法的的sql語句(如將foreach語句轉爲一句一句的sql),有任一sql語

原创 http請求參數編碼問題

給某api發送http請求,結果查不到數據;而api開發者自測可以查到數據。僵持不下。 經過分析發現,我的url是經過urlencode編碼的(傳出去的中文變成%E5%B2這種),而api開發者的url是明文傳輸中文。 我通過http

原创 Spring MVC:報錯No converter found for return value of type

問題描述: 請求數據返回時報錯No converter found for return value of type 原因: 不能將map轉換爲json傳輸 解決方案: 引入json相關包: <dependency> <gr

原创 Intellij IDEA中file size exceeds configured limit解決

Intellij IDEA中file size exceeds configured limit解決 把Hadoop源碼導入IDEA中後,其中有個ClientNamenodeProtocolProtos文件代碼高達82997行,IDE

原创 mybatis 註解方式批量插入

原文地址:http://blog.csdn.net/isea533/article/details/21237175 foreach一共有三種類型,分別爲List,[](array),Map三種。 foreach的第一篇用來將List和

原创 git pull提示 not-fast-forward

問題描述:git pull origin a:a時提示not-fast-forward 原因:本地分支和遠程分支沒有關聯 解決方案:關聯本地分支與遠程分支

原创 DecimalFormat 與double格式化

Demo來一發,做做記錄: [java] view plain copy //保留兩位小數   private DecimalFormat decimalFormat = new DecimalFormat("0.

原创 mybatis的xml文件中列名和mysql數據庫中的關鍵字衝突

類似與DELETE什麼的是mysql的關鍵字,在mybatis中操作時需要加上反引號-就是鍵盤Esc鍵下面的的那個 錯誤:DELETE = #{delete} 正確:`DELETE` = #{delete}

原创 @Value讀取配置文件,中文字符亂碼

如題。 解決方案: 在applicationContext.xml中加入     <context:property-placeholder ignore-resource-not-found="true" location="class

原创 Filter 配置多個URL-PATTERN

問題描述:設置了身份認證filter,想攔截多個url-pattern 方法:設置多個filter-mapping <filter>       <filter-name>authority</filter-name>       <

原创 logback: error :No RollingPolicy was set for the RollingFileAppender named

問題描述: 啓動logback時控制檯報錯:error :No RollingPolicy was set for the RollingFileAppender named XXX 問題原因: The RollingFileAppen