北部越南旅游点滴
25 Apr 2012 Leave a Comment
in Life
3月中,北部越南6日游,随团。淡季,但赶上天比较阴,时有点毛毛雨,但好在没有大雨。
关于签证VISA办理,有三种选择:去越南大使馆申请、通过旅行社代为去越南大使馆申请、自己上网申请VISA-On-Landing。前两种,可以直接申请到贴在护照上的VISA,但大使馆的手续费比较贵,而旅行社还要多收代办费。新加坡这里通过旅行社代办,收费一般一个人S$95。所以推荐上网申请。
网上申请分为两部分,申请和准备资料部分:
* 申请网站有很多,都不是官方的,而是外包的!不过基本可信,有的网站还有打折优惠等活动。我选的网站是“http://www.visa-vietnam.org/”,没有打折。
* 申请那种1个月单次入境签证就足够了,费用根据一次申请的人数而有变化。一个人申请时是US$20,2-3个人一起申请时是每个人US$18,4-5个人一起申请时是每个人US$16,等等,参见“http://www.visa-vietnam.org/vietnam-visa-online.html”。
* 付款方式各网站有所不同,一般可用信用卡和Paypal。
* 2个工作日后可收到email,附有越南移民局发出的VISA pre-approved letter。这是VISA预批准信,还不是VISA本身。打印出来。
* 然后下载并打印“Application Form for enter and exit Vietnam”,参见“http://www.visa-vietnam.org/download-form/101-entry-a-exit-form.html”。预先填好,参见如何填写“http://www.visaforvietnam.org/Vietnam-visa-news-detail.aspx?News=9”。成人一人填一份,14岁以下儿童不用单独填,而是填在所属的成人的表里。
* 准备2张越南尺寸的护照照片,4×6厘米。用工具自己制作一下去打印就可以了。
* 一张照片贴在“Application Form for enter and exit Vietnam”表上,一张附在表上。14岁以下儿童也要两张照片,附在所属成人的表上。
* 每个人(成人和儿童都要)准备现金US$25的stamped fee,就是所谓签证盖章费。
落地签证部分:
* 到越南机场后,找”LANDING VISA”字样的柜台。
* 在一侧窗口,递交自己的护照、“VISA pre-approved letter”、“Application Form for enter and exit Vietnam”和护照照片。
* 在另一侧窗口,等候并支付US$25的stamped fee。
* 取回贴了真正VISA的护照。
(注:如果持有亚细安国家护照,免签证1个月。)
河内的街巷,不看文字,简直和南京象极了!其中那些法式建筑的街巷,和南京民国建筑的街巷也很象。郊区的建筑样式,看看南京麒麟门那边就有概念了。
沙坝那边雾好大,盘山路上能见度只有2-3米!
3月,北越山区温度15-20度,穿的要里三层外三层。下龙湾,气温稍高一点,不过海上风大。幸好多带了春秋的衣物,穿的旅游鞋。
当地饮用水是硬水,本地人喝惯了没事。但我们喝软水的,不能直接喝,烧开了也尽量别喝。所以要喝瓶装水、矿泉水。但好在价格不贵,即使是旅游区也比新加坡超市里卖的便宜!旅馆不提供饮用的热水,但有的旅馆房间里有电热水壶。可以自己烧瓶装水喝。
电源插座嘛,就是国内使用的两项圆头插座,电压220V。
喝了两种啤酒,Beer Hanoi和Bear Saigon 333。 河内的价格要贵一点。
集市上、街边摊的小吃还是不错的,不过有些不太卫生。河内的情况还可以,但到了北部山区,那些摊点买的美味的肉类小吃,可尽量别吃。
俺比较喜欢鸡鸭四件,觉得河内小巷里到处有买的那种配薄荷叶吃的鸭头、鸭脚很有味道…
爱用咖啡粉冲泡的,别忘了买个滴漏咖啡滤器回去,简单实用,路边店就有卖。在机场不贵,US$2.5。
特色旅游商品有很多,比如磨漆画、黑木筷子、菠萝蜜干、松鼠咖啡等。象菠萝蜜干、G7速溶咖啡、炸腰果、绿豆糕等在小店里买就可以,便宜很多。
美元和越南盾(dong)通用。美元一般在购物时,都按时价取整使用,比如1:20000,1:21000等,把零头去了。所以美元最受欢迎,但如果能直接用越南盾则更合算。
从新加坡去的人,建议在新加坡多换点越南盾,按目前新元汇率,很合算。
物价的确是便宜,就算在旅游区也不很贵。最后离开时,在机场里,剩下不到5角新元的越南盾竟然还买了两盒绿豆糕!
Uncle和Aunty
23 Mar 2012 Leave a Comment
in Life
Uncle和Aunty的称呼在新加坡,有些时候类似与中国的“师傅”。比如在非正式场合,如马路上、食阁、商场、集市等地方,见到不认识的比自己年纪大的人,就称呼“昂可”(Uncle)和“昂梯”(Aunty),发音为本地非标准英语发音。
有趣的是,碰到50-60岁的老人,不论小孩、还是青年,竟然一起都叫他/她“昂可”/“昂梯”。而小孩叫青年也是“昂可”/“昂梯”的。
BlackBerry development tips
13 Feb 2012 1 Comment
in IT
That’s for SDK 6.0, may be still useful.
* How to add proxy for internet support for simulator?
Goto “C:\Program Files\Eclipse_BB\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.30\components\MDS\config”,
open “rimpublic.property”,
under section “[HTTP HANDLER]“, add
application.handler.http.proxyEnabled = true
application.handler.http.proxyHost =
application.handler.http.proxyPort =
optional:
application.handler.http.proxyUser =
application.handler.http.proxyPass =
Then in “Run Configurations” or “Debug Configurations”, under “BlackBerry Simulator”, create/select one configuration.
In rigth panel, “Simulator” tab, “Network” sub-tab, set “IP Address:” as your PC’s IP.
* Where to register “Code Signing Keys”?
http://us.blackberry.com/developers/javaappdev/codekeys.jsp
* What is PIN for “Code Signing Keys”?
When register “Code Signing Keys”, it must provide a PIN.
* What are local key store and private key password?
When received “Code Signing Keys” from RIM, developer should use “Signature Tools” to install key files.
Key files include 3 “.csi” files, for RBB/RCR/RRT. The key files will be installed into a local key store.
When first time install such key, a new local key store will be created, and it will ask for a “private key password”.
So later, when developer needs to sign app with keys, “Signature Tools” will prompt to enter that “private key password”.
* Where is local key store?
Under “C:\Program Files\Eclipse_BB\plugins\net.rim.ejde\vmTools”, files:
sigtool.csk, sigtool.db, sigtool.set
Inside “sigtool.csk”, property “PrivateKey” is the encrypted “private key password”.
PrivateKey=xxxx
* Backup installed keys
Make a copy of “sigtool.csk”, “sigtool.db” and “sigtool.set” under “C:\Program Files\Eclipse_BB\plugins\net.rim.ejde\vmTools”.
* Remove existing keys
If using Eclipse to do so, it just renames those “sigtool.csk”, “sigtool.db” and “sigtool.set” files, not really deletes them.
So, to recover, just rename them back.
* File access and “net.rim.device.api.system.ControlledAccessException”
When using simulator, if the app needs to access files, after reloading a new compiled copy, user must set it to allow accessing every times.
From simulator, go to “Setup/Option” or “Option”, then “Device/Application Management”, select the app.
Click “Edit Permissions”, change “Connections” (must), “Interactions” and “User Data” to “Allow” status, if necessary.
* How to create a unique long key?
In BlackBerry “Integrated Development Environment” or “Java Plug-in”, anywhere in an open text file, type a string value. For
exmaple “this is the seed” (not include quotation marks).
Then select the string (not include quotation marks), right-click on the selected string. From context menu, there is an item “Convert String to Long”, click it.
Also add a comment in the codes to indicate the string that you used to generate the unique long key.
* How to add and include lib project dependency?
Suppose in same workspace, there are one Lib and one App.
Lib is created by BlackBerry application project of the Library type.
App is created by BlackBerry application project of the Application type.
According to “BlackBerry Java Plug-in for Eclipse Version: 1.3 Development Guide”, Section “Add a project dependency”,
1. In the Package Explorer view, right-click the project that you want to add a dependency to.
2. Click “Build Path” > “Configure Build Path…”.
3. Click the “Projects” tab.
4. Click “Add”.
5. Select the project that you want this project to depend on.
(You must select either a Java application project or a BlackBerry application project of the Library type!!!!!)
6. Click “OK”.
In this case, while doing “BlackBerry package project” for App, it will also copy the distributed files from Lib folder into App folder.
The Lib’s “.alx” is combined into App’s “.alx” too, and they can be deployed together.
Pls note the difference from “jar lib dependency”, esp. that “!!!!!” line.
* How to add a jar lib dependency?
Get the .jar file.
Preverify the .jar file using preverify tool (C:\Program Files\Eclipse_BB\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.30\components\bin):
preverify -classpath {jde.home}\lib\net_rim_api.jar {output.file} -d {output.dir}
Above command will produce preverified .jar in “{output.dir}\output\” folder.
According to “BlackBerry Java Plug-in for Eclipse Version: 1.3 Development Guide”, Section “Add a .jar file dependency”,
1. In the Package Explorer view, right-click the project that you want to add a dependency to.
2. Click Build Path > Configure Build Path .
3. Click the Libraries tab.
4. Complete one of the following tasks:
a. Click Add JARS if the .jar file is in the current workspace.
b. Click Add External JARS if the .jar file is not in the current workspace.
5. Select the .jar file that you want this project to depend on.
(The .jar file must be generated by a Java application project. You cannot add a BlackBerry application project of the Library type in this manner!!!!!)
6. Click OK.
There is one more step:
5a. Goto “Order and Export” tab and check the newly added .jar file.
Pls note the difference from “lib project dependency”, esp. that “!!!!!” line.
* Add JDK/bin to PATH
It is suggested to add JDK bin to PATH environment. Such as:
PATH=C:\Program Files\Java\jdk1.6.0_23\bin;……
For some projects, if not adding so, while packaging, it will occur error:
Error: Cannot run program “javac”: CreateProcess error=2, The system cannnot find the file specified
BlackBerry usage tips
13 Feb 2012 Leave a Comment
in IT
* How to install software from Memory/Media Card?
1. Copy “*.cod” and “*.jad” files to a folder of Memory/Media Card. Suppose “/Media/apps”.
2. From phone’s main screen manu, open “Media” app.
3. From menu key button, select “Explore” item.
4. Locate to “/Media/apps”, click a “*.jad” file of a lib/app.
5. Phone will prompt to “Download”. Click it, phone will actually install the lib/app.
6. If an app includes dependent libs, you should install the libs first!
Otherwise, phone will not show “Download” word while open “*.jad” of an app.
* How to handle “907 invalid cod file not found” while installing software from Memory/Media Card?
1. While installing an app “*.jad” from Memory/Media Card, you may get “907 invalid cod file not found” error.
2. On PC, edit that “*.jad” file, remove all lines about those “<AppName>-<Number>.debug” files. Such as:
RIM-COD-URL-14: MyApp-14.cod
RIM-COD-SHA1-4: 6e c4 54 e5 ad 2d af 60 cf f6 d1 99 83 d6 94 40 55 32 aa 9e
RIM-COD-Size-14: 49976
3. Save and try installation again.
Install MingGW and GNUstep for C/C++/Obj-C for Windows
13 Feb 2012 Leave a Comment
in IT
Update an old post.
* mingw-get-inst (MingGW / MSYS)
1. Goto “http://sourceforge.net/projects/mingw/files/“.
2. Download “mingw-get-inst-20111118.exe”, which is a web downloader.
3. Run it to further download MinGW (including “C Compiler”, “C++ Compiler” and “ObjC Compiler”) and “MSYS Basic System”.
4. Install to default “C:\MinGW”.
5. Copy “C:\MinGW\bin\mingw32-make.exe” to “C:\MinGW\bin\make.exe”.
* mingw-get
1. Manually install MingGW / MSYS.
2. Goto “http://sourceforge.net/projects/mingw/files/Installer/mingw-get/“.
3. Download “mingw-get” installer.
4. Extract the files to “C:\MinGW”.
5. Use the mingw-get command to install MinGW as explained in “readme.txt”.
6. Later, use “mingw-get update” to update components.
* GNUstep
1. Goto “http://www.gnustep.org/resources/sources.html“.
2. Dowloand “GNUstep MSYS System” and “GNUstep Core”.
3. Install “GNUstep MSYS System” to default “C:\GNUstep”.
4. Install “GNUstep Core” to default “C:\GNUstep”.
5. It will add path “C:\GNUstep\bin;C:\GNUstep\GNUstep\System\Tools”.
* Eclipse
1. Install Eclipse and CDT plugin from “http://www.eclipse.org/“.
a) install “Eclipse IDE for Java EE Developers”, and then install CDT plugin.
b) or install “Eclipse IDE for C/C++ Developers”.
2. if Eclipse is opening while installing “GNUstep” and/or “MinGW”, it must be shutdown and restarted.
(full restart with shutdown, “File/Restart” is not sufficient.)
* Set path for Eclipse
For MinGW, set path “C:\MinGW\bin”. Then Eclipse can find “gcc” and “make”.
If Eclipse is open before path set, it must be closed and restart.
* For C/C++ development with Eclipse CDT
1. Install:
mingw-get-inst (MingGW / MSYS)
Eclipse
2. Set path: “C:\MinGW\bin”
* For Objective-C development
1. Install:
mingw-get-inst (MingGW / MSYS)
GNUstep
2. Set path: “C:\MinGW\bin;C:\GNUstep\bin;C:\GNUstep\GNUstep\System\Tools”
* For both C/C++ development with Eclipse CDT and Objective-C development
1. Install:
mingw-get-inst (MingGW / MSYS)
GNUstep
Eclipse
2. Set path: “C:\MinGW\bin;C:\GNUstep\bin;C:\GNUstep\GNUstep\System\Tools”
Integrate Oracle SQL develper with SQL Plus from XE
13 Feb 2012 Leave a Comment
in IT
If you want to run SQL*Plus command line from toolbar of Oracle SQL develper:
* Install Oracle XE and Oracle SQL develper.
* Suppose you want to use SQL*Plus from XE to connect other DB;
other DB connection string is “192.168.0.1:1521:mytest”;
you want connection id as “testdb”.
* Edit “tnsnames.ora” in “<OracleXE_folder>\app\oracle\product\10.2.0\server\NETWORK\ADMIN\”.
Add section:
testdb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mytest)
)
)
* Run SQL*Plus from command line:
> sqlplus “your_username/your_password@testdb“
It should work.
* Open Oracle SQL develper, from “Tools / External Tools”, add new entry, and fill at least following properties:
Program Executable: cmd
Arguments: /c start sqlplus.exe “your_username/your_password@testdb“
(Notes: you can specify “your_username@testdb“, then need to enter password; or “/@testdb“, then need to enter both user name and password.)
Run Directory: <OracleXE_folder>\app\oracle\product\10.2.0\server\BIN
Log Output to Messages Log: uncheck box
* In Oracle SQL develper, run SQL*Plus from tool menu or toolbar.
Install Apache HTTP server, Tomcat, PHP, MySQL on Windows (Esp. Windows 7)
13 Feb 2012 Leave a Comment
in IT
Last year, setup for fun…
I don’t want to show you each details with pictures, you can find them by Google. I just want to point out some you-may-miss steps, especially the integration parts.
* Installation on Windows 7
Due to UAC, the quick, simple and very important “First step” (before installing anything) is:
1. Your user account should be in administrators group;
2. Change “Owner” of “C:\Program Files\”, “C:\Program Files (x86)\”, “C:\ProgramData\” and “C:\User\<Your account>” to your account;
3. Give full permissions to your account for above folders too.
Please Google to find out “how to”.
If you have installed following software before “First step”, you have to uninstall them, delete anything relative in above folders and maybe in Registry. And then “First step”. After “First step”, following next steps.
* Installation packages
Try to download installation files with “*.msi” or “*.exe” formats, not “*.zip” or “*.gz” ones. Because installation copies can do some configurations and integration automatically. Download them from “www.apache.org“, “www.php.net” and “www.mysql.com“.
The installation files I am using:
httpd-2.2.21-win32-x86-openssl-0.9.8r.msi
apache-tomcat-6.0.33.exe
php-5.2.17-Win32-VC6-x86.msi
(php-5.3.8-Win32-VC9-x86.msi)
mysql-5.5.17-winx64.msi
(Why PHP 5.2? From “http://windows.php.net/download/“: If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP. In order to use 5.3, you need to isntall VC9 compiled httpd from “http://www.apachelounge.com/download/“. Actually, if not load ZendDebugger/Xdebug dll, Apache 2.2 can use PHP 5.3.)
The useful tools for MySQL:
mysql-workbench-gpl-5.2.35-win32.msi
The files for integration:
tomcat-connectors-1.2.32-windows-i386-httpd-2.2.x.zip (Download from Apache Tomcat)
mysql-connector-java-5.1.18.zip (Download from MySQL Connect/J)
Note that Tomcat requires JRE 5 or 6, while MySQL Workbench requires .NET Framework 4 runtimes.
* Installation orders
Install them in following order:
Apache HTTP server (Default: “C:\Program Files (x86)\Apache Software Foundation\Apache2.2″)
Apache Tomcat (Default: “C:\Program Files (x86)\Apache Software Foundation\Tomcat 6.0″)
PHP (Default: “C:\Program Files (x86)\PHP”)
MySQL (Default: “C:\Program Files\MySQL\MySQL Server 5.5″)
MySQL Workbench
Because Tomcat installation will update “<Apache2.2>\conf\httpd.conf”; and PHP installation will update “<Apache2.2>\conf\httpd.conf” and “<Apache2.2>\conf\mime.types” files of HTTP server.
After installation, do not run them. If any one has been started automatically, stop it first.
* Tips for setting up Apache HTTP server
Modify following lines in “<Apache2.2>\conf\httpd.conf”, change to your website location:
DocumentRoot “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”
<Directory “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”>
Unzip “mod_jk.so” from “tomcat-connectors-1.2.32-windows-i386-httpd-2.2.x.zip”; copy it into “<Apache2.2>\modules”.
* Tips for setting up Apache Tomcat
Modify following lines in “<Tomcat 6.0>\conf\server.xml”, change to your web services location:
<Host name=”localhost” appBase=”webapps”
If changed to different location, please copy at least those subfolders “host-manager”, “manager” and “ROOT” inside “<Tomcat 6.0>\webapps” to the new location. And this location can be same or different from the HTTP website location.
To integrate with Apache HTTP server, generate “<Tomcat 6.0>\conf\workers.properties” file. You can find sample from Tomcat website. The worker’s name should be “ajp13″, because Tomcat has inserted relative settings into “<Apache2.2>\conf\httpd.conf”.
If “<WebServices>” location is the same as “<Website>” location, check “<Apache2.2>\conf\httpd.conf”, and add or modify following lines:
# Tomcat connector.
LoadModule jk_module modules/mod_jk.so
JkWorkersFile “<Tomcat 6.0>\conf\workers.properties”
JkLogFile “<Apache2.2>\logs\mod_jk.log”
# All requests go to ajp13 by default.
JkMount /* ajp13
# Serve html, jpg and gif using httpd.
JkUnMount /*.html ajp13
JkUnMount /*.htm ajp13
JkUnMount /*.php ajp13
JkUnMount /*.jpg ajp13
JkUnMount /*.gif ajp13
If “<WebServices>” location is different from “<Website>” location, check “<Apache2.2>\conf\httpd.conf”, and add or modify following lines:
# Tomcat connector.
LoadModule jk_module modules/mod_jk.so
JkWorkersFile “<Tomcat 6.0>\conf\workers.properties”
JkLogFile “<Apache2.2>\logs\mod_jk.log”
# JkAutoAlias when WebServices location is different from Website location.
JkAutoAlias “<WebServices>”
# All requests go to ajp13 by default.
JkMount /* ajp13
# Serve html, jpg and gif using httpd.
JkUnMount /*.html ajp13
JkUnMount /*.htm ajp13
JkUnMount /*.php ajp13
JkUnMount /*.jpg ajp13
JkUnMount /*.gif ajp13
Copy global and common jar libs into “<Tomcat 6.0>\lib”. Such as:
commons-logging-1.1.1.jar (for logging)
jstl.jar (for JSTL)
log4j-1.2.16.jar (for logging)
log4j.properties (self-defined for logging system info)
mysql-connector-java-5.1.18-bin.jar (for MySQL)
standard.jar (for JSTL)
* Tips for setting up MySQL
If “<MySQL Server 5.5>\bin” is set in environment path, no matter by installation or by you, rename “<MySQL Server 5.5>\bin\libmySQL.dll” to such as “libmySQL_backup.dll”. Because it may interfere in other applications, such as PHP, which use their own MySQL dll.
Note that for PHP 5.2.17 and PHP 5.3.x, it does not contain “libmySQL.dll” in “.\bin\” any more.
* Tips for setting up PHP
For PHP 5.2.x,
check “<Apache2.2>\conf\httpd.conf”, change added lines from:
PHPIniDir “”
LoadModule php5_module “php5apache2_2.dll”
to real installation path, such as:
PHPIniDir “C:\Program Files (x86)\PHP\”
LoadModule php5_module “C:\Program Files (x86)\PHP\php5apache2_2.dll”
check “<PHP>\php.ini”, add following lines:
extension_dir=”C:\Program Files (x86)\PHP\ext”
For PHP 5.3.x, no need to do these steps. Because it has been configurated correctly.
* Running
Now, you can run them.
If Apache HTTP server or Apache Tomcat server cannot start, most probably that is due to another running process using the same listening port (default 80 for HTTP server, 8080 for Tomcat). Use tools (suc has TCPView from “www.sysinternals.com“) to find it out.
* Tips for running Apache Tomcat on Windows 7
From start menu, find “Monitor Tomcat” shortcut, open “Properties”:
Under “Shortcut” tab, the “Start in” path may differ from “Target” path. If so, change “Start in” path as “Target” path. Otherwise, cannot run application.
Under “Compatibility” tab, check “Run as an administrator”. Otherwise, cannot start/stop Tomcat service from application.
* Tips for running PHP on Windows 7
For Windows 7 in certain case, you may use a single word of “php” as any of its subfolder name, such as “<Website>\php\test.php”, for Website location containing PHP files, and PHP may not interpret “test.php”, and then IE will open it as a downloaded file! If so, try to use words like “<Website>\php_sample\test.php”, “<Website>\php_example\test.php”, etc. instead.
* Tips for running MySQL on Windows 7
Try to install up-to-date release of MySQL v5.5.x, some older versions cannot install the service instance correctly on Windows 7.
Setup PHP, Xdebug and Eclipse PDT on Windows 7 x64
13 Feb 2012 Leave a Comment
in IT
Last year, set up for fun…
* Installation packages
Download packages from “www.php.net“, “www.xdebug.org” and “www.eclipse.org“:
php-5.2.17-Win32-VC6-x86.msi (Thread-Safe version)
php_xdebug-2.1.2-5.2-vc6.dll (Thread-Safe version)
eclipse-jee-helios-SR1-win32.zip
(Why PHP 5.2? From “http://windows.php.net/download/“: If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP. In order to use 5.3, you need to isntall VC9 compiled httpd from “http://www.apachelounge.com/download/“. So, also download VC6 version of Xdebug.)
(If you prefer Non-Thread-Safe version, download copies with “nts” in file name).
* Tips for setting up PHP
After intalling PHP, and make sure it is running ok before installing Xdebug.
Open Command Prompt, and go to “<PHP>\”, run
>php -m
There is “[Zend Modules]” with no item now.
* Tips for setting up Xdebug
Copy “php_xdebug-2.1.1-5.2-vc6.dll” to “<PHP>\ext”.
Check “<PHP>\php.ini”, add following lines:
[Xdebug]
zend_extension_ts=”C:\Program Files (x86)\PHP\ext\php_xdebug-2.1.2-5.2-vc6.dll”
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
Open Command Prompt, and go to “<PHP>\”, run
>php -m
There is
[PHP]
…
Xdebug
…
[Zend Modules]
Xdebug
* Tips for setting up Eclipse
You can download the package of “Eclipse for PHP Developers”, but I installed the package of “Eclipse IDE for Java EE Developers”, then installed PDT plugin from “Install New Software…” from “http://download.eclipse.org/releases/helios/“.
Then refer to document “http://www.eclipse.org/pdt/articles/debugger/os-php-eclipse-pdt-debug-pdf.pdf” for how to setup PHP and debuggers.
* Tip for running Eclipse PHP debug
If the Eclipse project is a subfolder of WebSite, when first time running, open toolbar “Run/Debug Configurations…/PHP Web Page”, uncheck “URL/Auto Generate”, and manually input full relative path.
For example, the project path is “<WebSite>/Web_Test/PhpSample1″, the page file is “test.php”.
If check the “URL/Auto Generate”, the generated path is “http://localhost” + “/PhpSample1/test.php”. So, uncheck option, and manually change “/PhpSample1/test.php” to “/Web_Test/PhpSample1/test.php”.
WebLogic 10, JAXB 2.1, CXF and Spring WS
13 Feb 2012 Leave a Comment
in IT
If you are searching these key words, here may be the solution:
* About Web Service client codes.
* JAXB 2
Since JDK 6, JAXB RI is included in JDK. Following list which JDK includes which JAXB.
JDK6 first release – u3: JAXB RI 2.0.3
JDK6 u4 : JAXB RI 2.1.3
JDK6 u14 : JAXB RI 2.1.10
JDK7 first release : JAXB RI 2.2.4-1
* WebLogic 10.x
It uses JDK6u5, so it only support JAXB 2.1.
* CXF
CXF 2.2.9 uses JAXB 2.1 API and impl (2.1.13).
CXF 2.3.x and 2.4.x use JAXB 2.2 API and impl (2.2.4-1).
* WebLogic 10.x and CXF
CXF on WebLogic 10.x will meet “This class does not support SAAJ 1.1″ issue.
To solve, refer to this topic: “JAX-WS, CXF and SAAJ on Oracle Weblogic 10.3″ (“http://blog.xebia.com/2009/07/14/jax-ws-cxf-and-saaj-on-oracle-weblogic-103/“).
* Spring Web Service
Spring Web Service 2.0.x uses JAXB generated codes.
* Upgrade JAXB 2.2
Suppose we use JDK 6u4, and want to upgrade to JAXB 2.2.
Refer to this topic: “7.1.2. Using JAXB 2.1/2.2 with JavaSE 6″ (“http://jaxb.java.net/guide/Migrating_JAXB_2_0_applications_to_JavaSE_6.html“).
* JAXB and “required” attibute of “XmlElementRef”
If you have codes generated by JAXB 2.2, it may contain “@XmlElementRef(required)”.
But JAXB 2.1 compiler and runtimes doesn’t support “required” attribute.
“http://jaxb.java.net/nonav/2.1/docs/api/javax/xml/bind/annotation/XmlElementRef.html“,
“http://jaxb.java.net/nonav/2.2/docs/api/javax/xml/bind/annotation/XmlElementRef.html“.
* JAXB and xjc task
JAXB uses “com.sun.tools.xjc.XJCTask” inside “jaxb-xjc-2.x.jar” to generate codes.
If “<schema>” includes only XSD files, both xjc 2.1 and 2.2 work fine. If “<schema>” includes WSDL files and “-wsdl” option is added, xjc 2.2 works fine, but xjc 2.1 doesn’t.
* JAXB xjc 2.1 and WSDL file
JAXB xjc 2.1 (up to 2.1.13) doesn’t support WSDL file well, it has following issues:
1. Ignore the <globalBindings> part in xjb file. So it cannot repalce XMLGregorianCalendar with Calendar.
2. Ignore the <schemaBindings>/<nameXmlTransform> part in xjb file. So it cannot repalce class names.
3. Does not add “@XmlRootElement” for some types.
* CXF 2.2.9, JAXB xjc 2.1 and WSDL file
To my surprise, although CXF 2.2.9 uses JAXB xjc 2.1.13, it solves the issues mentioned in “JAXB xjc 2.1 and WSDL file”!
* WebLogic, JAXB 2.1 and Spring WS
We have following constraints:
1. WebLogic uses JDK 6u5.
2. We don’t want to upgrade JDK runtimes to JAXB 2.2.
3. We use those WSDLs, which will be generated “@XmlElementRef(required)” by JAXB 2.2.
4. We don’t want to solve SAAJ 1.1 issue with CXF.
So, we
1. Better use JAXB 2.1 to generate codes.
2. Not use CXF, but use Spring WS.
Conclusion:
1. Use CXF 2.2.9 (with JAXB 2.1.13) to generate client codes.
2. Use Spring WS 2.0.x to run with generated client codes based on JAXB 2.1.x runtimes.
WebLogic 10, Web Service and SOAP 1.2
13 Feb 2012 Leave a Comment
in IT
If you are searching these key words, here may be the solution:
* WebLogic 10
Suppose a WSDL uses SOAP 1.2.
If using “weblogic.wsee.tools.anttasks.WsdlcTask” to generate server codes, WsdlcTask will fail to recognize SOAP 1.2, and generate codes for SOAP 1.1. Then the client generated from the same WSDL will send SOAP 1.2 message to the server. And the server will get error:
Unsupported Content-Type: application/soap+xml; charset=”utf-8″ Supported ones are: [text/xml].
* Best solution:
Modify jws java codes generated by WsdlcTask or by developer.
Replace:
@BindingType(“http://schemas.xmlsoap.org/wsdl/soap/http“)
with:
@BindingType(“http://www.w3.org/2003/05/soap/bindings/HTTP/“)
or
@BindingType(“http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/“)
* Alternative solution:
Modify WSDL/XSD file.
Replace:
<wsoap12:binding style=”document” transport=”http://schemas.xmlsoap.org/soap/http”/>
with:
<wsoap12:binding style=”document” transport=”http://www.w3.org/2003/05/soap/bindings/HTTP/”/>
or
<wsoap12:binding style=”document” transport=”"http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/“>