Tuesday, February 20, 2007

jsf newbie problem

javax.servlet.jsp.JspException: Cannot find FacesContext is often the error you got when you run a jsf enabled page for the first time. For example if you invoke a page using http://localhost:8080/yourJSFpage.jsp


Actually you should use http://localhost:8080/faces/yourJSFpage.jsp when calling the page.This is required because FacesContext is initialized when the JSF servlet controller is invoked. Or you can do http://localhost:8080/yourJSFpage.faces .

Websphere server v6 + Websphere MQ v6 setup

I spent 3 whole working days trying to setup Websphere MQ (v6) and Websphere Server (v6). Finally got the sender (session bean) and the receiver (MDB) working.
Here are the things I learned.
1. MQ needs upgrade to v6.0.2 to be connectable from WAS. (must do for donwload trial version)
2. Need to specify the MQ_ROOT_DIR in WAS to synchronize the client jars.
3. Some previous failure deployment file can be stuck in the "profiles/default" temp and wstemp directories. Need to remove them to have a clean startup on WAS.
4. If you want to use websphere default JMS queue (not MQ) , a bus need to be setup.
See
http://www-128.ibm.com/developerworks/websphere/library/techarticles/0504_barcia/0504_barcia.html5. 5. If you want to use websphere MQ on the same server as WAS, a good tutorial (but for MQ 5.3) is
http://www-128.ibm.com/developerworks/websphere/techjournal/0505_woolf/0505_woolf.html
The code might need change though in the finally block of sender. (Don't close a resource if it is null, thus avoid noise exceptions)