今天部署了一個項目,部署時遇到了幾個常見的問題:1.An existing resource has been found at location 這應該是你想部署的項目到了tomcat_home/webapp下面引發衝突而造成,仔細看哪個對話方塊中的部署路徑,你可能會發現問題,這時你要修改.mymetadata的配置資訊,把當中的context-root="/老項目名"改成context-root="/新項目名",就ok了。2.Deployment failure on
通常,command not found是系統不能找到執行命令的路徑引起的,是怎麼回事兒呢?拿命令ifconfig來說,如果沒有把:/sbin追加到環境變數,直接輸入ifconfig命令是不能執行的,輸入/sbin/ifconfig才能執行。通過whereis ifconfig可得知ifconfig所在路徑是/sbin/ifconfig,即在sbin目錄下。如果環境變數中沒有設定/sbin,則會顯示command not
/** * Implement algorithm like:f(2,3)=2+22+222;f(3,4)=3+33+333+3333...... */public class Test{ // get each one value public static int recur(int a ,int b){ if (b == 1) { return a; }else{ return a * (int)
HashSet,TreeSet,LinkedHashSet都不允許元素有重複,如果有重複,則選取一個元素放入容器。同樣,HashMap,TreeMap,LinkedHashMap也不允許key有重複,但如果key重複,應該選取這個key對應的哪個值放入容器呢?做了一下測試:public class Test { public static Map putSome(Map<String,String> map){ map.put("gender",
Executor是JDK5引入的介面,在並發包裡,提供了耦合度更低,線程組管理的多線程實現方式,其中ExecutorService介面繼承自Executor介面,分別提供了有傳回值和無傳回值的線程調用:public class Example1 { public static void main(String args[]) { // For runnable call, traditional thread implementation Thread
如果是MFC程式,CSDN裡有一段sample code:Example// This OnCtlColor handler will change the color of a static control// with the ID of IDC_MYSTATIC. The code assumes that the CMyDialog// class has an initialized and created CBrush member named m_brush.// The
多線程會帶來主要兩方面問題,一是順序性,二是可見度。順序性問題是指多個線程對資源訪問的有序性;可見度是指某線程完成對資源的修改後,其他線程是否立即可知。這周寫了個多執行緒計數器,最開始天真的認為不用加鎖,認為A線程和B線程誰先加1無所謂,不存在資源訪問順序的問題,但記憶體可見度的問題如果不採取措施就會出問題。後來想到兩個解決方案,一是synchronized, 二是Atomic。synchronized開銷大,volatile應用情境不對,推薦用開銷更小的Atomic。public class