Thursday, December 30, 2010

java.lang.RuntimeException: cannot find FacesContext

Had been googeling for this for quite a long time and the answer was always about wrong url-patterns or incorrect servlet-mapping in web.xml etc

However, the problem is not with the URL pattern. Make sure that the jspx contains the following pattern.

<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=windows-1252"/>
<f:view>
<af:document id="d1">
<af:messages id="m1"/>
</af:document>
</f:view>


Tip:- When you're using Applcore components in your UI, preferably use Fusion schema with fusion/fusion in jdev database connection. Also, never change any passwords either in the properties file or in the console. Let the defaults be.

4 comments:

sai_explorer said...

Thanks for the information , it helped me :-)

Kavita said...

I'm glad :)

electronic signatures said...

Thank you for sharing the code. I just followed it and got the solution of my problem. You saved my time. Buckets of thanks to you!

Anonymous said...

Great one !! Helped me