2009年3月24日星期二

Part of Sun Alumni Blogs

Glad that my blog has been added onto Sun Alumni Blogs at http://planets.sun.com/alumni/group/blogs/, thanks a lot, people in the Sun Blogs Support team!

2009年3月7日星期六

What's Statistics

Statistics is defined in the American Heritage dictionary as, “the mathematics of the collection, organization, and interpretation of numerical data, especially the analysis of population characteristics by inference from sampling.”

2009年3月6日星期五

How to deploy gwt rpc separated into Apache 2.2 and Tomcat 6.0:
I followed the GWT Tutorial and successfully ran the StockWatcher in hosted mode using Eclipse on Windows Vista 64bit, then was completed confused and lost at Using Tomcat with Apache HTTPD and a proxy, after some searching, guessing and trying, I finally got the StockWatcher server side deployed to Tomcat and the client side deployed to Apache, here are my configurations:

1. Tomcat 6.0.18 64-bit is installed at C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.18, port is 8080
2. Apache 2.2.1 win 32-bit is installed at C:\Program Files (x86)\Apache Software Foundation\Apache2.2, port is 80
3. PHP 5.2.8 win 32 is installed under Apache 2.2 at C:\Program Files (x86)\Apache Software Foundation\Apache2.2\php
4. MySQL 5.1.31 Win 32 is installed at C:\Program Files\MySQL\MySQL Server 5.1
5. mod_jk 1.2.27-httpd-2.2.10.so is installed under Apache 2.2 at C:\Program Files (x86)\Apache Software Foundation\Apache2.2\modules
6. Modified the httpd.conf of Apach 2.2.1 with the following new lines:

ProxyPass /StockWatcher/StockWatcher/ http://localhost:8080/StockWatcher/
ProxyPassReverse /StockWatcher/StockWatcher/ http://localhost:8080/StockWatcher/

7. Create web.xml under Tomcat (C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.18\webapps\StockWatcher\WEB-INF) with the following contents:


<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<servlet>
<servlet-name>StockPriceService</servlet-name>
<servlet- class="">com.google.gwt.sample.stockwatcher.server.StockPriceServiceImpl</servlet->



<servlet-mapping> </servlet-mapping>
<servlet-name>StockPriceService</servlet-name>
<url-pattern>/StockPriceService</url-pattern>
</web-app>



8. Use the following lines to create the StockPriceService in StockWatcher.java:
 ((ServiceDefTarget) stockPriceSvc).setServiceEntryPoint( GWT.getModuleBaseURL() +
"StockPriceService");
9. Put the following line in the StockWatcher.gwt.xml:

<servlet path="/StockPriceService" class="com.google.gwt.sample.stockwatcher.server.StockPriceServiceImpl"> </servlet>


10. The following changes in Apache http.conf is to integrate Apache 2.2 and Tomcat 6.0 for generaly deployment purpose:

LoadModule jk_module modules/mod_jk.so

JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /*.jsp worker1
JkMount /StockWatcher/StockPriceService worker1



C:/Program%20Files%20(x86)/Apache%20Software%20Foundation/Apache2.2/conf/workers.properties has the following lines:

worker.list= worker1
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.type=ajp13


11. The orginal source codes can be found at http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=GettingStartedTutorial

2009年3月2日星期一

Setup Netbeans 6.5, Glass Fish v3, PHP, MySQL, Apache and xdebug on Windows Vista

Just started to play with IDE on Windows Vista, spent a lot of time on the Internet Searching and finally got everything setup for Glass Fish, Ajax, PHP, MySQL, xdebug and Netbeans 6.5 on Windows Vista, here are some issues and workarounds:

1. Annoying UAC

See http://www.petri.co.il/disable_uac_in_windows_vista.htm and http://www.informationweek.com/blog/main/archives/2007/06/dont_shut_off_v.html before deciding whether you want to install applications to Program files directory without clicking and clicking all the time.

2. 64 bit vs 32-bit.
Some applications don't work with 64-bit JRE/JDK so better to install 32-bit only.

3. Run Netbeans as administrator to start Glass Fish V3, somehow I couldn't start it if I didn't run Netbeans as administrator.

4. Install php_xdebug-2.0.4-5.2.8* instead of *-5.3.0* for PHP 5.2.8, php_xdebug-2.0.4.-5.3.0*dll doesn't work with PHP 5.2.8 at all.

5. The Apache server in the XAMP package craches with PHP files so I had to install separate MySQL, PHP and Apache.

6. Pay attention to Skype who is also using port 80 if you see Apache 2.2 doesn't work on port 80.

7. To stop some services manually:
Control Panel -> Administrative Tools -> Services -> MySQL (or Apache2.2)

8. To clean registry to completely remove some programs:

run "regedit" from Start menu, goto HKEY_LOCAL_MACHINE-> SYSTEM->CurrentControlSet->Services->The Application You want to remove