Showing posts with label WebSphere. Show all posts
Showing posts with label WebSphere. Show all posts

Saturday, February 16, 2013

setAsText: Cannot find FacesContext warning / error

I was recently converting a project from Faces (JSF) to NonFaces using JSTL, JSP, AJAX and jQuery.

I was making changes to a JSP page.  All of a sudden, the page which was working before stopped working.  The console logged the warning:setAsText: Cannot find FacesContext
Also, the error " com.ibm.ws.jsp.JspCoreException: com.ibm.ws.jsp.JspCoreException: javax.faces.Face
sException: Cannot find FacesContext."

I started to panic - do I still need the JSF config?

The cause of the issue happens to be
< jsp:setProperty name="tsdec" property="entryDate" value="${pped1}"  / >

Whenever JSTL needs to convert "string" value to a complex data type for example java.util.Date and it does not find a custom tag for its conversion,  it applies setAsText() method.  If it does not find the JSF implementation files, it throws the above error.   I find it odd that this method is bundled into JSF implementation.

In the above case, I added the fmt tag to parse the date:

< fmt:parseDate var="pped1" value="${s_pped}" type="date" pattern="MM/dd/yyyy" scope="request"  / >


That resolved the issue.

Thursday, October 25, 2012

WAS 7.0 app will not start inside RAD 7.5

PROBLEM:

The following error message appears when a J2EE app is attempted for deployment-
A composition unit with name  already exists. Select a different application name.

RESOLUTION:

Delete the /blas and /cus directories for the bad application from the configuration.
The resources will be located in the config directory of the profile.:

/config/cells/qcell/blas
/config/cells/qcell/cus 

See the following URL for more details:

Once the above directories are deleted, add projects to WAS Server inside RAD and then publish the application.