AddMessage(FacesContext) Error

Hi All,
I am facing a problem with addMessage of javax.faces.context.FacesContext
Steps
1. Two components, component A and component B (both of them are required) are on the page with a command button (OK).
2. If i click on OK without entering any data in the two components, it shows me the required error message. This works fine.
3. I have a message call on OK on click, which finally shows an error saying "Message is not getting cleared on second attempt."
<af:commandButton text="OK"
binding="#{backingBeanScope.TestPage.cb1}"
id="cb1"
actionListener="#{backingBeanScope.TestPage.btnOkOnClick}"/>
public void btnOkOnClick(ActionEvent actionEvent) {
UIMessage key = Message.MSG_NOT_CLEARING;
String msg =
JSFUtils.getStringFromBundle(key.getResourceBundle(), key.getCode());
showMessage(null, FacesMessage.SEVERITY_ERROR, msg);
private static void showMessage(String clientId,
FacesMessage.Severity severity,
String messageDesc) {
FacesContext facesContext = FacesContext.getCurrentInstance();
// detail message only shown
facesContext.addMessage(clientId,
new FacesMessage(severity, null, messageDesc));
4.*Issue* comes when I clear the two required fields A and B and now click on OK, now the above error "Message is not getting cleared on second attempt." as well as the
required error message both come on the page.
Other relevant code:
//Message
This is the class where i create message constants
package com.ofss.fc.ui.view.testPage;
public class Message {
public static final String MSG_BUNDLE_LOC =
"com.ofss.fc.ui.view.testPag.Message";
*<p>Error Code: FC_MSG1</p>
*<p>Description :Message is not getting cleared on second attempt.</p>
public static final UIMessage MSG_NOT_CLEARING =
new UIMessage(MSG_BUNDLE_LOC, "FC_MSG1");
This is the resource bundle file from where the actual message is present.
//Message.properties
FC_MSG1=Message is not getting cleared on second attempt.
This is files has the resource bundle message and message error code.
package com.ofss.fc.ui.view.testPage;
public final class UIMessage {
     * Resource Bundle name
     private String resourceBundle;
     * Message code
     private String code;
     public UIMessage(String resourceBundle, String code) {
          this.resourceBundle = resourceBundle;
          this.code = code;
     public String getResourceBundle() {
          return resourceBundle;
     public String getCode() {
          return code;
public void btnOkOnClick(ActionEvent actionEvent) {
UIMessage key = Message.MSG_NOT_CLEARING;
String msg =
JSFUtils.getStringFromBundle(key.getResourceBundle(), key.getCode());
showMessage(null, FacesMessage.SEVERITY_ERROR, msg);
private static void showMessage(String clientId,
FacesMessage.Severity severity,
String messageDesc) {
FacesContext facesContext = FacesContext.getCurrentInstance();
// detail message only shown
facesContext.addMessage(clientId,
new FacesMessage(severity, null, messageDesc));
}

Thanks for the reply.
Actually, if we had to incorporate the change as suggested by you then we had a lot of re-work. So, I used your approach in the command button instead of the input text.
*" document.getElementById('d1::msgDlg::cancel').onclick = function () "*
This executes when the Ok button in the javax.faces.context.FacesContext message popup is clicked.
<af:commandButton text="OK"
binding="#{backingBeanScope.TestPage.cb1}"
id="cb1"
actionListener="#{backingBeanScope.TestPage.btnOkOnClick}"
clientComponent="true" partialSubmit="true">
<af:clientListener method="onLoad"
type="click"/>
</af:commandButton>
<af:resource type="javascript">
function clearMessagesForComponent(evt) {
AdfPage.PAGE.clearAllMessages();
evt.cancel();
function onLoad(evt) {
document.getElementById('d1::msgDlg::cancel').onclick = function () {
clearMessagesForComponent(evt);
return false;
</af:resource>

Similar Messages

  • Get NoClassDefFoundError: javax/faces/context/FacesContext Error at Runtime

    I'm in 11g, PS1. I have an application and I have a SelectOneChoice component that invokes a managed bean (i.e. #{queryHandler.availableFilterChoice}). It then calls my constructor public QueueHandler and within that constructor i have the following line of code:
    Application application = FacesContext.getCurrentInstance().getApplication();
    This line of code builds and compiles, but at runtime I get the following error NoClassDefFoundError: javax/faces/context/FacesContext and the application stops and fails and nothing is rendered. I have the following libraries in my project:
    JSP Runtime
    JSF 1.2
    JSTL 1.2
    ADF Page Flow Runtime
    ADF Controller Runtime
    ADF Controller Schema
    ADF Faces Runtime 11
    ADF Common Runtime
    ADF Web Runtime
    MDS Runtime
    MDS Runtime Dependencies
    Common Beanutils 1.6
    Common Logging 1.0.4
    Common Collections 3.1
    ADF DVT Faces Runtime
    ADF DVT Faces Databinding Runtime
    EJB 3.0
    JPS Designtime
    TopLink
    Oracle XML Parser V2
    Java EE 1.5 API
    Oracle JEWT
    Trinidad Runtime 11
    JSTL 1.2 Tags
    Resource Bundle Support
    Resource Bundle Variable Resolver
    Weblogic 10.3 Remote-Client
    Oracle JDBC

    I'm sorry, but I guess I don't understand what you're saying. But I'm not using the line of code below anywhere so I cannot remove it. I did try to use to use that line of code then I used the import org.apache.myfaces.trinidad.util.Service; and when I use those lines of code, I get the same exact Error.
    ExtendedRenderKitService erks = Service.getRenderKitService(FacesContext.getCurrentInstance(), ExtendedRenderKitService.class);

  • FacesContext error

    When I run my application I get this error :
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Cannot find FacesContext
    What is wrong?
    thank for assistance .

    This happens when you try to access a JSP that uses JavaServer Faces directly without going through the FacesServlet, which sets up the FacesContext. You need to configure either extension or prefix mapping in your web.xml and access JSPs using .../faces/mypage.jsp or .../mypage.faces style URLs instead of addressing the page directly.
    -- Keith

  • ADF Security: javax.servlet.jsp.JspException: Cannot find FacesContext

    Hi,
    In my ADF Application, new users are to be allowed to Register by clicking a button in login page. The Application is based on ADF Security Wizard and I have created default pages for Login and Error, so the application's login page is login.html.
    Now when I’m trying to navigate to 'NewUserRegistrationPage.jspx' Im getting javax.servlet.jsp.JspException: Cannot find FacesContext error.
    I thought the issue might be from calling a .jspx from .html so I created a 'NewLogin.jspx' Page with below code and specified this page in ADF Security Wizard for Login Page.
    Please advice me some way of calling the 'newRegistrationpage.jspx' from my login page.
    Im using JDeveloper 10.1.3.4.
    Page Code:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces"
    xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <html>
    <head>
    <title>Login</title>
    </head>
    <body><form method="POST" action="j_security_check">
    <font face="Verdana" color="Navy">
    <table cellspacing="2" cellpadding="3" border="0" align="center">
    <tr>
    <th>Username:</th>
    <td>
    <input type="text" name="j_username"/>
    </td>
    </tr>
    <tr>
    <th>Password:</th>
    <td>
    <input type="password" name="j_password"/>
    </td>
    </tr>
    </table>
    </font>
    <p align="center">
    <input type="submit" name="submit" value="Submit"/>
    <input type="button" name="" value="Request Password"/>
    <input type="button" name="" value="New User Registration"/>
    </p>
    </form></body>
    </html>
    </f:view>
    </jsp:root>
    Error::
    javax.servlet.jsp.JspException: Cannot find FacesContext     at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:427)     at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:125)     at webpages.REACHLoginPage_jspx._jspService(_REACHLoginPage_jspx.java:47)     [WebPages/REACHLoginPage.jspx]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.4.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:259)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:51)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)     at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:284)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.FormHttpAuthenticator.reject(FormHttpAuthenticator.java:83)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpApplication.checkAuthenticationAndAuthorize(HttpApplication.java:6435)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:3030)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:738)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.4.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)
    Edited by: Manasa Tadi on Jul 1, 2009 11:52 PM

    Hi Branislav,
    Thanks a lot for your suggestion through which now Im able to navigate to NewRegistration page from login.html.
    In my application login.html is under public_html folder where as the NewRegistration page in public_html/WebPages.
    Code I used:
    New User Registration
    But the issue now is, the NewUserRegistrationPage was also under the ADFSecurity, so inorder to navigate to it again the user had to provide authentication. So, I have removed this particular page from Security and it has started to work.
    But the issue now I face is something else. In the NewUserRegistrationPage I have a selection to be made by user about the type of user he is and based on the selection he would be navigated to next page, This next page has a VO on it as a 'create form', through which he can directly fill the form and submit his details to database table.
    But as I have removed these pages from ADF Security and authentication, the form fields/attributes in the VO are not getting binded, Im getting this Exception:
    500 Internal Server Error
    javax.faces.el.PropertyNotFoundException: Error testing property 'inputValue' in bean of type null
    For testing purpose when I have provided link from application page to NewRegistrationPage the flow is working properly, able to navigate to second page and submit the filled form to database, I think this is working because we have entered the application after providing the login credentials.'
    Help in this greatly needed.
    Thanks,
    Manasa.

  • Error with JSF

    Hi,
    I am trying to deploy a jsf example app (download jsf-test in jboss site) in JBoss Portal server 2.0, when I try to invoke a jsf page, I got the error as below:
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Cannot find FacesContext
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.login_jsp._jspService(login_jsp.java:91)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
    root cause
    javax.servlet.jsp.JspException: Cannot find FacesContext
         javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:409)
         com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
         org.apache.jsp.login_jsp._jspx_meth_f_view_0(login_jsp.java:106)
         org.apache.jsp.login_jsp._jspService(login_jsp.java:82)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
    Any idea regarding this? Any help would be appreciated.
    Raymond

    "Cannot find FacesContext" error typically occurs when you don't call FacesServlet.
    Check your web.xml.
    If you specify as <url-pattern>/faces/*</url-pattern>
    you should browse "http://localhost:8080/xxxx/faces/page.jsp",
    not "http://localhost:8080/xxxx/page.jsp".

  • Validate Multiple Inputtext and launch validation from backing bean

    Hi to all
    How can i validate multiple inputtext in a form?
    And how can i launch a validation from backin bean?
    Thanks

    Thank you very much, that is what i was looking for.
    I have one more problem:
    if i make this, it's showing me an error, i can't do it
    FacesContext context= FacesContext.getCurrentInstance();
    FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "Value entered is invalid");
    msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "component level message - Value entered is invalid");
    context.addMessage(FacesContext.getCurrentInstance().getViewRoot().findComponent("<id_of_the_inputtext_component"), msg);
    context.addMessage takes only two strings as arguments
    Edited by: 838674 on 23-mar-2011 4.56

  • Idle socket causing delayed data transfer

    I have a telnet type client written that has a thread to continually read data from the socket with the server. The problem is, that when the connection is idle for a significant amount of time (no data transfered), the connection enters "delay state" (that's what I'll call it). In this state, if data were to begin transferring again, nothing is read from the InputStream until a while later (minutes).
    From my observations, I believe the delay time reduces if more data is queued up.
    Here is my thread code:
              public void run() {     
                   inputField.requestFocusInWindow();
                   if(!init()) return;
                   byte[] buff=new byte[buf_size];
                   int nch;
                   thread:while(this==Thread.currentThread()) {
                        try {
                             if ((nch = in.read(buff, 0, buff.length)) == -1) {
                                  addMessage("Natural disconnection from host.");
                                  disconnect();
                                  break thread;
                             outputArea.append(buff,nch);
                        } catch(Exception e) {
                             if(e instanceof IOException)
                                  addMessage("Forcibly disconnected from host.");
                             else if(e instanceof DataFormatException)
                                  addMessage("Fatal error - data corrupted. Disconnecting.");
                             else  //else I don't know what happened, so print the raw data
                                  addMessage(e.toString());
                             disconnect();
                             break thread;
              }You'll notice a lot of references to my own methods. I think their naming is fairly self explanatory, but if you need clarification, feel free to ask.
    Message was edited by:
    natmaster

    With ejp's pedigree on this forum, i think he understands threads!
    <p>I think you've misinterpreted that tutorial. In the tutorial i found this code:
    <p>
    public void run() {<br>
    ��Thread myThread = Thread.currentThread();<br>
    ��while (clockThread == myThread) {<br>
    ����repaint();<br>
    ����try {<br>
    ������Thread.sleep(1000);<br>
    ����} catch (InterruptedException e) {<br>
    ������//The VM doesn't want us to sleep anymore,<br>
    ������//so get back to work.<br>
    ����}<br>
    ��}<br>
    <p>which i presume you're referring to, but that only works because the code is run from an applet with a stop method that sets clockThread to null. It's nothing to do with fairness of executing threads.
    <p>Think about which thread is executing the statement "this == Thread.currentThread". Unless you're calling this run method from yet another unspecified thread, it's going to be "this", and if "this" is having a chance to execute any statements at all, then it's also going to be the current thread, so that statement will always be true.
    <p>If you want to be sure to be nice to other threads, you could call Thread.yield(). I never had much joy with using this method though, and the current JVMs seem to be pretty good at being fair to all threads even if none of them sleep or yield at all
    <p>
    [Sorry about formatting, damned forum seems to be shagged to tried to do it manually with html tags]

  • Websphere 6: JNDI problem with Sping - urgent.

    Hi,
    I have my cJSC project working fine with JNDI on my local sun app server. However when deploying to websphere I am getting problems.
    Obviously websphere is different setup and I have had to add the following to the web.xml to get a datasource
    <resource-ref>
         <description>VMS Datasource</description>
         <res-ref-name>jdbc/VMSDS</res-ref-name>
         <res-type>javax.sql.DataSource</res-type>
         <res-auth>Container</res-auth>
    </resource-ref>
    However, the app is still bombing out with following..
    Error page exception
    The server cannot use the error page specified for your application to handle the Original Exception printed below. Please see the Error Page Exception below for a description of the problem with the specified error page.
    Original Exception:
    Error Message: SRVE0207E: Uncaught initialization exception thrown by servlet
    Error Code: 500
    Target Servlet: Faces Servlet
    Error Stack:
    java.lang.NullPointerException
    at javax.faces.webapp.FacesServlet.init(FacesServlet.java:144)
    at com.ibm.ws.cache.servlet.ServletWrapper.init(ServletWrapper.java:231)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:274)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:480)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2954)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:221)
    at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:210)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1912)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:288)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:207)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:109)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
    Error Page Exception:
    Error Message: Cannot find FacesContext
    Error Code: 0
    Target Servlet: null
    Error Stack:
    javax.servlet.jsp.JspException: Cannot find FacesContext
    at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:405)
    at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
    at com.ibm._jsp._ErrorPage._jspx_meth_f_view_0(_ErrorPage.java:330)
    at com.ibm._jsp._ErrorPage._jspService(_ErrorPage.java:63)
    at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.ibm.ws.cache.servlet.ServletWrapper.serviceProxied(ServletWrapper.java:264)
    at com.ibm.ws.cache.servlet.CacheHook.handleFragment(CacheHook.java:344)
    at com.ibm.ws.cache.servlet.CacheHook.handleServlet(CacheHook.java:216)
    at com.ibm.ws.cache.servlet.ServletWrapper.service(ServletWrapper.java:246)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1239)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:113)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:670)
    at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:117)
    at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:178)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:294)
    at com.ibm.ws.webcontainer.webapp.WebApp.sendError(WebApp.java:2593)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2983)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:221)
    at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:210)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1912)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:288)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:207)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:109)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
    Anybody used JSC and Websphere with JNDI? I go live next week and don't want to have to configure a context file each time for production.
    Regards,
    LOTI

    Is the resource ref the same as you configured for the bundled
    Sun App server ?
    We do have a sample JNDI application and tip if they help:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/code/sampleapps/2/JaasAuthentication.zip
    (see the README file in the zip file)
    http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/2/jaas_authentication.html
    John

  • Weblogic and ADF: Deployed application fails

    Hello!
    1. I am using JDeveloper 11.1.1.3.0 and standalone WebLogic Server. ADF application is successfully deployed but fails with java.lang.RuntimeException: Cannot find FacesContext error
    2. All prerequisites are completed: ADF runtime libraries are correctly installed and application domain has been extended with these new libraries
    3. Searched forums and Metalink but did not see similar issue
    More detailed error:
    <Sep 1, 2010 4:38:47 PM CDT> <Error> <HTTP> <BEA-101020> <[ServletContext@326294728[app:AccessSystem11g_application1 module:AccessSystemTesla path:/AccessSystemTesla spec-version:2.5]] Servlet failed with Exception
    java.lang.RuntimeException: Cannot find FacesContext
    at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1855)
    at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1672)
    at jsp_servlet.__driverlicense_jspx._jspx___tag0(__driverlicense_jspx.java:90)
    at jsp_servlet.__driverlicense_jspx._jspService(__driverlicense_jspx.java:65)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:35)
    Truncated. see log file for complete stacktrace
    >
    <Sep 1, 2010 4:38:47 PM CDT> <Notice> <Diagnostics> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'AdminServer' has triggered at Sep 1, 2010 4:38:47 PM CDT. Notification details:
    WatchRuleType: Log
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
    WatchData: DATE = Sep 1, 2010 4:38:47 PM CDT SERVER = AdminServer MESSAGE = [ServletContext@326294728[app:AccessSystem11g_application1 module:AccessSystemTesla path:/AccessSystemTesla spec-version:2.5]] Servlet failed with Exception
    java.lang.RuntimeException: Cannot find FacesContext
    at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1855)
    at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1672)
    at jsp_servlet.__driverlicense_jspx._jspx___tag0(__driverlicense_jspx.java:90)
    at jsp_servlet.__driverlicense_jspx._jspService(__driverlicense_jspx.java:65)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:35)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:417)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:326)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101020 MACHINE = tesla.marc.wucon.wustl.edu TXID = CONTEXTID = 11d1def534ea1be0:15b5c38c:12acf3c2760:-8000-0000000000000009 TIMESTAMP = 1283377127177
    WatchAlarmType: AutomaticReset
    WatchAlarmResetPeriod: 30000
    >
    <Sep 1, 2010 4:38:47 PM CDT> <Alert> <Diagnostics> <BEA-320016> <Creating diagnostic image in /u01/Oracle/Middleware/user_projects/domains/mfr/servers/AdminServer/adr/diag/ofm/mfr/AdminServer/incident/incdir_4 with a lockout minute period of 1.>

    John, I owe you a beer...at least! Somehow I thought that since I changed default default context root, no need for the /faces.
    However, I am now getting other error but will create another thread if I do not see the answer somewhere else...

  • JSF- How TO...?

    Hi all,
    I have created a JSF sample application using netbeans4.1 and sun java application server 7. and working fine..
    Then i tried the same code using JBuilder X and the same server. it giving "Cannot found facesContext" Error. Y?
    Can anybody help me?
    How to create a JSF application using JBuilderX (Not JBuilder2005) and SJAS 7.
    Thanks in advance.
    Ganesh

    it is a problem of configuration (check web.xml) and mainly, the mapping url

  • FacesContext can't display error msg !

    Hi guys,
    I got this problem. For this function:
         public User saveUser(User user) throws DBException {
              try {
                   User newUser = this.userDao.saveUser(user);
                   return newUser;
              } catch (DataIntegrityViolationException di) {
                   String msg = "duplicate user id";
                   this.logger.error(msg, de);
                   throw new DuplicateUserIdException(msg);
    =======================================
    then the below function is to execute when user click the submit button
    public String submitAction() {.....
    catch (DuplicateUserIdException de) {
    String msg = "Username already exists";
    this.logger.info(msg);
    FacesContext.getCurrentInstance().addMessage(null, new FacesMessage( FacesMessage.SEVERITY_INFO, msg, msg));
    return QueryResults.RETRY;
    ========================================
    public class DuplicateUserIdException extends DBException {
         private String username;
         public DuplicateUserIdException(String newUsername) {     
              super("Username " + newUsername + " already exist");
              this.username = newUsername;
         public String getUsername() {
              return this.username;
    ====================================
    So when I click on the submit button after entering a duplicate username, it will just go back to the same page and no error message display. Username is a primary key and email address is set to UNIQUE in MySQL DB. I read the log file and indeed all the error messages can be catched. The registration.jsp page is like:
    <h:inputText value="#{userBean.username}" id="username" required="true">
    <f:validateLength maximum="20" minimum="5"/>
    </h:inputText>
    <h:message for="username"/>
    but I got my login page also the same h:inputText as above.
    I am using JSF + Spring + Hibernate.
    I hv tried to fix it a few time but failed !
    Appreciate any help here.

    K> then the below function is to execute when user click
    K> the submit button
    K>
    K> public String submitAction() {.....
    K>
    K> catch (DuplicateUserIdException de) {
    K> String msg = "Username already exists";
    K> this.logger.info(msg);
    K> FacesContext.getCurrentInstance().addMessage(null,
    K> l, new FacesMessage( FacesMessage.SEVERITY_INFO,
    K> msg, msg));
    K> return QueryResults.RETRY;
    K>           }
    K> }
    K> So when I click on the submit button after entering a
    K> duplicate username, it will just go back to the same
    K> page and no error message display. Username is a
    K> primary key and email address is set to UNIQUE in
    K> MySQL DB. I read the log file and indeed all the
    K> error messages can be catched. The registration.jsp
    K> page is like:
    K>
    K> <h:inputText value="#{userBean.username}"
    K> id="username" required="true">
    K> <f:validateLength maximum="20" minimum="5"/>
    K> </h:inputText>
    K> <h:message for="username"/>
    K>
    K> but I got my login page also the same h:inputText as
    K> above.
    K>
    K> I am using JSF + Spring + Hibernate.
    K>
    K> I hv tried to fix it a few time but failed !
    K> Appreciate any help here.
    Ok, we have to keep in mind the request processing lifecycle here. Your
    submitAction() method is called after conversion and validation have
    already occurred. Therefore, you can never queue an error from an
    action handler. Here's why.
    When your submitAction() is called, you queue a message into the faces
    context. Whatever you return from submitAction(), it's ultimately going
    to cause a requestDispatcher.forward() or
    httpServletRespones.sendRedirect(). Both of these cause a new
    FacesContext instance to be created, obliterating your carefully queued
    message.
    The best practice I've seen used is to handle the validation as close to
    the component in which the validation error occured as possible. I
    recommend creating a custom validator method binding, that does the
    trick. This is really easy to do. Just add a method to your bean:
    public void validate(FacesContext context,
    UIComponent component,
    Object value) throws ValidatorException {
    // queue the message here, make sure to call component.setValid(false)
    Then, in your inputText, you say:
    <h:inputText value="#{userBean.username}" validator="#{userBean.validate}
    id="username" required="true">
    <f:validateLength maximum="20" minimum="5"/>
    </h:inputText>
    And you're done.
    Ed (JSR-252 Spec co-lead)

  • FacesContext not initialized in certain error conditions?

    I ran into an interesting problem today (I am using RI 1.1.01).
    I have a servlet which acts as a global exception handler. All exceptions which are caught by the container are forwarded to this servlet (as configured in web.xml using error-page). This exception servlet does some processing and then forwards the request again to a JSF view.
    If the exception happens inside a getter/setter or inside an action listener, everything works fine. However, if the exception is thrown from the constructor of a managed bean, I get this weird exception (here I also include the JSF log right before the exception):
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.LifecycleImpl, execute(com.sun.faces.context.FacesContextImpl@69cdb12)
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.LifecycleImpl, phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@69cdb12)
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.RestoreViewPhase, Entering RestoreViewPhase
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, set character encoding on request to ISO-8859-1
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, URL pattern of the FacesServlet executing the current request .faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, viewId after appending the context suffix /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.StateManagerImpl, Begin restoring view in session for viewId /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.StateManagerImpl, Restoring view from session for viewId /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.StateManagerImpl, End restoring view in session for viewId /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.RestoreViewPhase, New request: creating a view for /ibx/web/globalErrorPage.faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, Created new view for /ibx/web/globalErrorPage.faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, Locale for this view as determined by calculateLocale en
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, RenderKitId for this view as determined by calculateRenderKitId HTML_BASIC
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.RestoreViewPhase, Exiting RestoreViewPhase
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.LifecycleImpl, Skipping rest of execute() because of a reload
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.LifecycleImpl, render(com.sun.faces.context.FacesContextImpl@69cdb12)
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.LifecycleImpl, phase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@69cdb12)
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.RenderResponsePhase, Entering RenderResponsePhase
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.lifecycle.RenderResponsePhase, About to render view /ibx/web/globalErrorPage.faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, About to render view /ibx/web/globalErrorPage.faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, URL pattern of the FacesServlet executing the current request .faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, Found URL pattern mapping to FacesServlet .faces
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, viewId after appending the context suffix /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,822], DEBUG, com.sun.faces.application.ViewHandlerImpl, Before dispacthMessage to newViewId /ibx/web/globalErrorPage.jsp
    [10/19/05 15:27:46:822 CEST] 24d01b05 WebGroup I SRVE0180I: [XA-IBX-PF] [] [Servlet.LOG]: /ibx/web/globalErrorPage.jsp: init
    [10/19/05 15:27:46:832 CEST] 24d01b05 SystemOut O [2005-10-19 15:27:46,832], DEBUG, com.sun.faces.taglib.jsf_core.ViewTag, Can't leverage base class
    javax.faces.FacesException: Assertion Failed
         at com.sun.faces.util.Util.doAssert(Util.java(Compiled Code))
         at com.sun.faces.taglib.jsf_core.ViewTag.getComponentType(ViewTag.java:241)
         at javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1013)
         at javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1036)
         at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:749)
         at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:429)
         at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
         at org.apache.jsp._globalErrorPage._jspService(_globalErrorPage.java:
    Strange huh? Looking at the source code, it seems like getComponent() isn't ever supposed to be called. Is the FacesContext somehow not getting initialized? Any thoughts? Help!

    Thanks for your suggestion.
    I'm not sure what, from my problem description, motivated you to think that faces-config might be the problem because the rest of my JSF application works just fine. The problem is limited to exceptions which are thrown at certain points in managed beans (like the constructor) or in custom components/renderers, when the default error-page is forwarded to, it seems that the JSF framework is in a state of error and thus the error page itself throws an exception. A copy of this exception in included in the original post.
    At any rate, everything looks to be just fine with my faces-config. It validates just fine and the other parts of my application work.
    Thanks for trying though!

  • Why Does FacesContext.addMessage Accept a String?

    Hello,
    For the life of me I can't figure this one out; please let me know if my thinking is incorrect here.
    FacesContext.addMessage accepts two arguments, a String and a FacesMessage instance. The FacesMessage instance makes sense; it encapsulates all information regarding a message to the user. Why it doesn't support I18N under the covers, I don't know. This is, however, very easy to fix.
    What I don't understand is the String instance argument. What is it used for? Sure, if I happen to bind a UIComponent, which also happens to have an h:message attached to it, to a managed bean I can programmatically add messages to the UIComponent. So, why is there no UIComponent.addMessage? Why the call to UIComponent.getClientId?
    Furthermore, from a dumb API user (that's me) perspective, FacesContext.addMessage( String, FacesMessage) together with <h:messages id='...'/> seems to imply that FacesContext.addMessage( "selectiveMessage", ...) will only display that message for <h:messages id='selectiveMessage'/>, and no other h:messages tags. Unfortunately, even using globalOnly there is no way to have two mutually exclusive sets of messages that are not attached to a UIComponent.
    This would not even be an issue except for the rendering order of JSP interfering with the allegedly stateful nature of the JSF components. For example, I have a set of status messages to the user, displayed above a dataTable. If the dataTable is empty, I want to display a nice "Listing is empty" status message to user instead of an empty table. However, since the messages are on top of the dataTable in the JSP page, the message does not show up until after refresh. The quick solution was to put another set of messages specifically for the empty table message under the table where everybody (all the components at least) already knows the state of dataTable. Unfortunately, can't have two mutually exclusive sets of messages.
    So, we now have a very complex solution of custom behavior hard-wired into an h:messages subclass to solve a very simple problem of not displaying an empty table.
    The good news is, aside from a few very annoying but certainly not show-stopping issues like this JSF is proving to be as good as its hype.
    Thanks, JSF team!
    Tim

    Actually, this is incorrect. You must have a direct reference to the component instance to access the clientId. Filling in a String value that matches the for="..." attribute in h:message does not work. Furthermore, since UIComponent.getClientId requires a FacesContext instance argument, you end up with something like this:
    FacesContext.getCurrentInstance().addMessage(
     this.getComponent().getClientId(
      FacesContext.getCurrentInstance()
     new FacesMessage( "This is not I18N!")
    V/s this:
    this.getComponent().addMessage( "i18nKey");
    I do agree that JSF needs some input to get better. Hence this post.
    Tim

  • Error loading JSF page popup window - Cannot find FacesContext

    Hello,
    I am trying to load a popup window from my Visual Web JSF page. The popup window itself will be a Visual Web JSF page also.
    As an example, i have 2 buttons on my original page with jsp tags as follows::
    <webuijsf:button binding="#{Page1.button1}" id="button1" onClick="window.showModelessDialog('./PopupPage.jsp'); return false;"
    style="left: 19px; top: 16px; position: absolute" text="Button"/>
    <webuijsf:button actionExpression="#{Page1.button2_action}" binding="#{Page1.button2}" id="button2"
    onClick="window.showModelessDialog('./PopupPage.jsp');" style="position: absolute; left: 20px; top: 44px" text="Button"/>
    When i click Button1, the popup window appears but will not load the page within the window. I get the following report in the server log:
    StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
    java.lang.RuntimeException: Cannot find FacesContext
    at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
    at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
    at org.apache.jsp.PopupPage_jsp._jspx_meth_f_view_0(PopupPage_jsp.java from :102)
    at org.apache.jsp.PopupPage_jsp._jspService(PopupPage_jsp.java from :77)
    ETC ETC
    If i click Button2 (which does NOT return false in the onclick Script and thus submits the first page) the first attempt fails with the same error, but if i try a second time the popup window displays and loads the page correctly.
    Any solutions would be greatly appreciated as this is driving me crazy :-s
    Edited by: coxy69 on Jan 9, 2008 10:29 PM

    Cannot find FacesContextThis generally indicates that you invoked a request which points to a JSP page which contains JSF tags, but that the request itself isn't passed through the FacesServlet. Make sure that the request URL is covered by the url-pattern setting of the FacesServlet in the web.xml.

  • FacesContext.addMessage on a  af:popup window

    Hi, How can we show a user friendly message on a af:popup window?
    Specifically what should be the id value first argument to the method -> facesContext.addMessage(mybutton.getClientId(context), message);
    If I give af:popup id value it is not displaying the message. If I give dialog id value (d1) it is displaying message in the background. I want the message to be in the foreground.
    Below is the partial code from JSF:
    <af:popup id="uploadAFile" autoCancel="disabled">
    <af:dialog id="d1" contentWidth="320" contentHeight="150"
    type="okCancel"
    title="Upload Document" styleClass="AFStretchWidth"
    dialogListener="#{backingBeanScope.DlgLsner.onDialogAction}"
    clientComponent="true">
    <p>
    <af:inputFile label="Upload File" id="if1"
    value="#{backingBeanScope.FileUpload.uploadedFile}"/>
    <af:commandButton text="Upload" id="uploadButton"
    action="#{backingBeanScope.FileUpload.doUpLoad}"
    />
    </p>
    </af:dialog>
    </af:popup>
    Thank you,
    VJ
    JDeveloper 11.1.1.4

    VJ wrote:
    Hi, How can we show a user friendly message on a af:popup window?
    Specifically what should be the id value first argument to the method -> facesContext.addMessage(mybutton.getClientId(context), message);
    If I give af:popup id value it is not displaying the message. If I give dialog id value (d1) it is displaying message in the background. I want the message to be in the foreground.
    Below is the partial code from JSF:
    <af:popup id="uploadAFile" autoCancel="disabled">
    <af:dialog id="d1" contentWidth="320" contentHeight="150"
    type="okCancel"
    title="Upload Document" styleClass="AFStretchWidth"
    dialogListener="#{backingBeanScope.DlgLsner.onDialogAction}"
    clientComponent="true">
    <p>
    <af:inputFile label="Upload File" id="if1"
    value="#{backingBeanScope.FileUpload.uploadedFile}"/>
    <af:commandButton text="Upload" id="uploadButton"
    action="#{backingBeanScope.FileUpload.doUpLoad}"
    />
    </p>
    </af:dialog>
    </af:popup>
    Thank you,
    VJ
    JDeveloper 11.1.1.4I think you just want to display message for this use this command
    FacesContext fctx = FacesContext.getCurrentInstance();
                FacesMessage message = new FacesMessage("Hello World");
                fctx.addMessage(null, message);if you want to display popups then follow the link http://baigsorcl.blogspot.com/2010/03/creating-and-displaying-popups-in-adf.html

Maybe you are looking for

  • How to Restrict Single Delivery Date for PO with Multiple Line Items

    Dear Experts, How to Restrict Single Delivery Date for PO with Multiple Line Items. System needs to through Error Message if User Inputs Different Delivery Dates for PO with Multiple Line Items in ME21N Tcode. Can we achive this by Some Enhancement i

  • Some recently purchased songs will not transfer over to my new ipod nano. Why is this happeneing?

    I just got an Ipod Nano 7th generation. Most of the songs that I had in my library will sync over with some exceptions. I just purchased two songs for my old Ipod touch and when I try to sync my new Ipod with my old library, those songs aren't even r

  • Flex swf in a spry tabbed panel

    I have a spry tabbed panel in one of the panels I am attempting to load an swf that I created using Flex builder. The swf runs fine when run standalone but from within the spry tab although it does load and run correctly I get a nasty error message i

  • Cisco outdoor AP 1300 - OSPF multicast traffic

    Hi everybody, I have a basic question but i really do not know the answer. So, I want to know if i can talk OSPF through a wireless connection formed by 2 cisco aironet 1300? I mean i am not sure if the access point is going to pass the OSPF's multic

  • Does changing the RSS excerpt length of blog entries really work?

    Hello, Due to various problems[1] with the RSS feed contents that iWeb produces for blog entries I would like to limit each excerpt in the RSS feed to a small portion of the blog entry to encourage readers to visit the full post on my website. The iW