就恢復了
2010年4月14日 星期三
Maven in eclipse - M2eclipse
某天某專案下的Maven dependencies不見了,在該專案下的.classpath補上
classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"
就恢復了
就恢復了
2010年4月11日 星期日
TransactionException in Hibernate and MySQL
在過一段時間後會出現如上錯誤訊息,這是因為MySQL已經切斷閒置的連線,所以可以利用connection pool的配置來處理這個問題。Mysql服務器預設的「wait_timeout」是8小時(待查證),所以mysql配置中my.ini 的wait_timeout值一定要大於等於connection pool的idle_timeout 值,否則mysql會在wait_timeout的時間後關閉連接,然而連接池還認為該連接可用,這樣就會產生以上圖內的錯誤。
MySQL :
interactive_timeout=XX
The number of seconds the server waits for activity on an interactive connection before closing it.
wait_timeout=XX
The number of seconds the server waits for activity on a noninteractive connection before closing it.
DBCP
timeBetweenEvictionRunsMillis 每毫秒檢查一次連接池中閒置的連接(spec :The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run.)預設是-1
minEvictableIdleTimeMillis 連接池中連接可閒置的時間(spec:The minimum amount of time an object may sit idle in the pool before it is eligable for eviction by the idle object evictor (if any). )
上面兩個設定要一起使用,意思是說每timeBetweenEvictionRunsMillis毫秒檢查一次連接池中空閒的連接,把空閒時間超過 minEvictableIdleTimeMillis毫秒的連接斷開,直到連接池中的連接數到minIdle為止
2010年3月27日 星期六
m2eclipse , put your jar to the repository

add myself jar to repository by using m2eclipse(a maven plugin for Eclipse)
Result :
Installing d:\Joseph.jar to C:\Users\Joseph\.m2\repository\org\joseph\joseph_test\1.1\joseph_test-1.1.jar
be careful : packaging=jar , it is very important ! otherwise , you will fail on it
or in command mode :
D:\>mvn install:install-file -Dfile=D:\PassiveDataAgent.jar -DgroupId=com.mycompany.taipei -DartifactId=PassiveDA -Dversion=1.0 -Dpackaging=jar
Then , you can get this jar in your project
in POM :
...
<dependency >
<groupId>com.mycompany.taipei </groupId>
<artifactId>PassiveDA </artifactId>
<version>1.0 </version>
</dependency>
...
2010年1月1日 星期五
CSS Note
CSS selector :
[tag selector]
ex: p {color:#0000ff;}
[class selector]
ex: .myclass{color:#0000ff;}
[ID selector]
ex: #myclass{color:#0000ff;}
[descendant selector]
ex: .myclass p{color:#0000ff;}
[child selector]
ex: .myclass>p{color:#0000ff;}
difference between descendant and child
後代是指該層所衍生下來的所有都要符合,子代只要該層的下一層符合就可以了
combine usage
ex: #myclass .myclass{color:#0000ff;}
a.myclass{color:#0000ff;}
註解1
....
*/
[tag selector]
ex: p {color:#0000ff;}
[class selector]
ex: .myclass{color:#0000ff;}
[ID selector]
ex: #myclass{color:#0000ff;}
[descendant selector]
ex: .myclass p{color:#0000ff;}
[child selector]
ex: .myclass>p{color:#0000ff;}
difference between descendant and child
後代是指該層所衍生下來的所有都要符合,子代只要該層的下一層符合就可以了
combine usage
ex: #myclass .myclass{color:#0000ff;}
a.myclass{color:#0000ff;}
- 用p元素的color屬性來取待font標籤
- 用font-size:12px;來改變字體大小
- 字體大小的測量單位:pt、pc(等於12pt)用於列印樣式時,網站勿用。px(pixels)對印刷毫無用處。em如果在browser設定偏好會有效果,比如設font-size:1em;看到的結果會是設定的Medium的大小,如果設1.1em會比設定的還大10%,反之0.9em會小10%。
- 可用絕對關鍵字來指定字體大小(xx-small、x-small、small、medium、large、x-large、xx-large)
- 相對關鍵字(larger、smaller),會以母元素的大小為基準。
- 特定字型顯示 font-family:Verdana , Geneva , Arial ,sans-serif;
- 把Link的底線移除 a:link,a:visited{ text-decoration:none;}
- 強調文字中的文字,在p元素中放入span標籤並為其加入類.highlight{background-color:#FFFFCC;}
- 增加文字行距p{line-height:2.0;}
- 文字左右分散 text-align : justify ,其它值right,left,center
- 水平分割線 hr {background-color: #ADD8E6;}
- 文字全改大小寫.transform{text-transform:uppercase;}其它值lowercase、none、capitalize(第一個字母改大寫)
- 移除項目前的符號 ul { list-style-type : none;}換成圖片ul{list-style-image:url(aaa.gif);}、移除縮排左邊界ul{list-style-type:none;padding-left:0;margin-left:0;}
- 把項目成水平排列ul.horiz li{display:inline;}
- CSS註解/*我是註解*/ 或
註解1
....
*/
- margin 屬性有四種組合值:
* 一個值 such as 10px , 去指定每個margin都是10
* 兩個值, such as 10px 5px, 去指定上/下 (first value) 和右/左(second value)
* 三個值, such as 10px 5px 2px, 去指定上(first value), 右/左 (second value) 和下 (third value)
* 四個值, such as 10px 5px 2px 1px ,去指定 上, 右, 下 ,左
2009年11月4日 星期三
Web Service
Client是用Axis2去實作,Server是XXX.asmx看起來應該是用.net派的
所以遇到以下錯誤:
伺服器無法辨認 HTTP 標頭 SOAPAction 的值: urn:anonOutInOp
我的解決方式:
....
Options options = new Options();
options.setTo("yourTargetEPR");
options.setAction("AbcWebService/QueryAbcMyAccount");
//這個action的內容我是用SoapUI去判斷出來的
ServiceClient sender = new ServiceClient();
sender.setOptions(options);
.....
所以遇到以下錯誤:
伺服器無法辨認 HTTP 標頭 SOAPAction 的值: urn:anonOutInOp
我的解決方式:
....
Options options = new Options();
options.setTo("yourTargetEPR");
options.setAction("AbcWebService/QueryAbcMyAccount");
//這個action的內容我是用SoapUI去判斷出來的
ServiceClient sender = new ServiceClient();
sender.setOptions(options);
.....
2009年9月17日 星期四
工作記事(二)
2009.09.17 早上4:45 get up ,天居然還沒亮ㄟ, 直接開車到內湖(客戶Kb..),五點半左右到達,實行頭端的unbound mechanism設定,約七點全部完成。又回家載小可上班後就回家補休到12點半,下午也就順便請個假,當作下午在家工作摟^^
2009年8月31日 星期一
Eclipse 把Java Project 改成Dynamic Web Project
訂閱:
文章 (Atom)
COVID-19 確診經歷紀實
原本以為真的是天選之人,就算先前家裡兩個小孩都確診都逃過了(可能有中獎但無症狀吧),不過就在2023年六月18日破解自認為天選之人的"心態",為什麼可以確認就是這天中獎的呢?因為在前都是居家上班,到人多的室內場所都會戴口罩,就剛好這天傍晚原本只想說要去附近的國...
-
因為使用alpine的base image,要讓OS的時區改成自己設定就需要額外安裝tzdata套件,再加上公司環境根本不能連外進行安裝,所以想在docker file設定 ENV TZ=“Asia/Taipei” 或mount volumn使用host的時區 /etc/tim...
-
案例: 收到的request資料中一個JSON格式的資料要保存,但為何不存JSON的字串就好?因為這個資料會不斷變動的,所以收到變動只要取出這個已將JSON轉成list的添加或刪除東西就好,不用再將JSON轉成list再轉回JSON存到DB去。 在Hibernate中是設定該欄...
-
在過一段時間後會出現如上錯誤訊息,這是因為MySQL已經切斷閒置的連線,所以可以利用connection pool的配置來處理這個問題。 Mysql服務器預設的「wait_timeout」是8小時(待查證), 所以mysql配置中my.ini 的wait_timeout值一定要大...
