2012年12月15日 星期六

Java Developer Most Useful Books

Source : http://www.intermediatejava.com/2011/06/the-books-most-useful-for-a-java-developer/

  • Joshua Bloch, Effective Java (2nd Edition).
    經典中的經典,此書很推薦初學者看
  • Christian Bauer and Gavin King, Java Persistence with Hibernate.
  • Brian Goetz with Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, and Doug Lea, Java Concurrency in Practice
  • Erich Gamma, Richard Helm, Ralph Johnson, and John M. Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software
  • Steve McConnell, Code Complete: A Practical Handbook of Software Construction
  • Martin Fowler with Kent Beck, John Brant, William Opdyke, and Don Roberts, Refactoring: Improving the Design of Existing Code
  • Maurice Naftalin and Philip Wadler, Java Generics and Collections
  • David Geary and Cay S. Horstmann, Core JavaServer Faces (3rd Edition)
  • Eben Hewitt, Java SOA Cookbook
  • Chet Haase and Romain Guy, Filthy Rich Clients: Developing Animated and Graphical Effects for Desktop Java Applications
  • Debu Panda, Reza Rahman, and Derek Lane, EJB 3 in Action
  • Ira R. Forman and Nate Forman, Java Reflection in Action
  • John Zukowski, The Definitive Guide to Java Swing (3rd Edition)
  • Scott Oaks and Henry Wong, Java Threads (3rd Edition)
  • Robert Sedgewick and Kevin Wayne, Algorithms (4th Edition)
  • Christopher Steel, Ramesh Nagappan, and Ray Lai, Core Security Patterns: Best Practices and Strategies for J2EE™, Web Services, and Identity Management
  • Steven Haines, Pro Java EE 5 Performance Management and Optimization
  • Cay S. Horstmann and Gary Cornell, Core Java, Volume 1– Fundamentals (8th Edition)
  • Cay S. Horstmann and Gary Cornell, Core Java, Volume 2– Advanced Features (8th Edition)
  • James Gosling, Bill Joy, Guy Steele, and Gilad Bracha, The Java Language Specification
  • 2012年2月26日 星期日

    install mysql 5.5 on mac (dmg)

    1. download dmg file

    http://dev.mysql.com/downloads/mysql/
    direct download link from website

    2. install file

    .pkg -- two files
    .prefPane -- one file (for system preferences..)

    3. start mysql




    4. change password

    open terminal
    > cd /usr/local/mysql/bin
    > ./mysqladmin -h localhost -u root password [your password]

    5. login
    > ./mysql -u root -p

    6. start mysql in command line

    > cd /usr/local/mysql/support-files
    > sudo ./mysql.server start

    2012年1月30日 星期一

    mac maven tools.jar dependency

      <profiles>
    <profile>
    <id>windows</id>
    <activation>
    <os>
    <family>Windows</family>
    </os>
    </activation>
    <properties>
    <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
    </properties>
    </profile>
    <profile>
    <id>osx</id>
    <activation>
    <os>
    <family>mac</family>
    </os>
    </activation>
    <properties>
    <toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
    </properties>
    </profile>
    </profiles>

    2011年12月11日 星期日

    Unable to set the activation state to true for the application .....weblogic.common.ResourceException: is already bound

    weblogic 在 bound DataSource 時,一直出錯。

    檢查了設定檔、Connection 都很正常。

    經過 google 後才發現,原來是 weblogic 設定檔的問題。

    從 domains\xxx\config\jdbc\xxxxxx-jdbc.xml
    在 除了設定好的部份,還有空白值??

    把空白多出來的 tag 刪除就正常了。

    2011年11月30日 星期三

    org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken

    在 weblogic 上使用 hibernate 時,幾乎都會發生此錯誤。
    原因為 hibernate 在 parse Name Query 會出問題。
    目前已知是 antlr 的問題,hibernate 需要 antlr.jar(2.7.6 or 2.7.7) 但是會跟 weblogic.jar 衝突。而通常 classpath 會先 load 到 weblogic server 內的 jar files. 所以hibernate 會認錯 class file。




    方法一
    修改 domain 下的 startWeblogic.bin (startWeblogic.sh) , 讓 weblogic 優先載入 antlr 。
    由於此修改是針對所有的 container , 所以需要評估可能的影響。

    在 ${SAVE_CLASSPATH} 修正載入順序。



    方法二
    修改 WEB-INF/weblogic.xml加入

    <weblogic-web-app>
    ....
    <container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    ....
    </weblogic-web-app>

    讓 web project 內的 jar 優先使用。



    方法三

    在 Hibernate 相關檔案加入以下設定

    <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

    此方法我還沒試成功過...

    2011年11月21日 星期一

    [2011 HK] Day3

    Day3

    飯店晨泳 --> 飯店自助餐 --> 龍城 , k11 --> 機場 check in --> 昂坪纜車 --> 東薈城(citygate outlet)--> 溫暖的家。



    今天早上天氣變好了,還出了太陽。當然還是要好好利用飯店設施,於是又跑去泡了一下。
    今日的早餐為飯店 buffet , 在地下一樓,港畔餐廳(Harbourside),臨星光大道旁。吃的內容很豐富,有中式、日式、西式...
    看著麗星郵輪緩緩駛進維港,配上和煦的陽光、豐富的早餐... 果然很享受。(此餐兩人要 HK 650 左右,還好飯店招待...)

    中午過後先到機場 early check in , 早報到的好處就是可以選機位,而且可以預掛行李。

    接著搭乘 S1 bus 到昂坪, 到的時候沒太多人,可能已經是下午了吧?? 大部分車廂都只做 2 ~ 4 人。
    由於是晚上八點的飛機,所以也沒逛太久,就下山了。


    在 outlet 找不到想買的東西中,結束香港行...

    2011年11月20日 星期日

    [2011 HK] Day2

    Day2
    飯店晨泳 --> 添好運 --> 女人街 --> 車厘哥夫 --> 海港城




    一大早起床,今日預定行程為添好運早餐。其他就是逛街、Shopping 行程。
    難得一大早是無雨的天氣,趁這個機會,到飯店三樓游個泳,泡一下熱池看海景。視野真的很不錯,天氣也是涼涼的,很適合泡熱水。







    接著坐地鐵來到油麻地,走到添好運的時候已經是 10 點左右了。想當然,就等下一輪吧。嗯,拿到 16 號的牌子,老闆說約半小時。最後實際我們等了一個多鐘頭,也還 OK . 從早餐變中餐的結果就是... 叫多一點來犒賞自己(兩個人點七道會太多嗎?)。因為位置不多,且好像是現做的,所以用餐的速度不快,也因此大排長龍了。粥還不錯,粉腸好吃。

    今日其中一個重點就是伴手禮了,車厘哥夫(在太子站),於是沿著女人街,波鞋街... 一路走過去買(難怪每天都腳酸)。


    最後是海港城 Shopping ,買了 royce chocolate , 自從在日本吃到後就念念不忘。
    一出海港城,又是下雨天...