voyent
javax.faces.el.EvaluationException: Cannot get value for expression '#{chatBean.date}'  XML
Forum Index -> General Help
Author Message
cbustamante

Joined: 13/Sep/2006 00:00:00
Messages: 12
Offline


Hi I have the following error:

Dec 15, 2006 6:58:18 PM com.icesoft.faces.webapp.parser.Parser parse
SEVERE: Failed to execute JSP lifecycle.
javax.faces.el.EvaluationException: Cannot get value for expression '#{chatBean.date}'
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:402)
at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicInputRenderer.getValue(Ljavax.faces.component.UIComponent;)Ljava.lang.Object;(Unknown Source)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.getValue(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)Ljava.lang.String;(Unknown Source)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeEnd(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(Unknown Source)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(Unknown Source)
at com.icesoft.faces.renderkit.dom_html_basic.GroupRenderer.encodeChildren(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(Unknown Source)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(Unknown Source)
at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(Unknown Source)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:480)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:361)

Anyone knows about this problem and how I can be resolve?

Thanks in advance!
[Email]
dukehoops

Joined: 07/Nov/2006 00:00:00
Messages: 106
Offline


could you please post:

-page
-backing bean code
-bean declaration in faces-config.xml?


---------------------------
-nikita

http://themusiclounge.com
cbustamante

Joined: 13/Sep/2006 00:00:00
Messages: 12
Offline


This is the jsp page:

<f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ice="http://www.icesoft.com/icefaces/component">

<html>
<head>
<title>Conttac Chat</title>
</head>
<body>
<h:form>
<h:panelGrid columns="1">
<h:panelGroup>
<h:outputText value="#{chatBean.date} - Status:" />
<h:outputText value=" " />
<h:graphicImage url="/images/#{chatBean.status}" />
</h:panelGroup>
<h:inputTextarea readonly="true" rows="10" cols="36" value="#{chatBean.history}" />
<h:panelGroup>
<h:inputTextarea rows="2" cols="30" value="#{chatBean.message}" />
<h:outputText value=" " />
<h:commandButton value="Send" action="#{chatBean.sendMessage}" />
</h:panelGroup>
<h:outputText value="#{chatBean.info}" />
</h:panelGrid>
</h:form>
</body>
</html>

</f:view>

This is the backing bean code:

package com.sabiosolutions.chat;

import java.io.*;
import java.text.*;
import java.util.*;
import ymsg.network.*;
import com.icesoft.faces.webapp.xmlhttp.*;
import com.icesoft.faces.async.render.*;

/**
* @author cbustamante.
*
* Bean backing the chat application.
* This bean uses the RenderManager to update state at a specified interval and controls chat information during the session.
* Also uses the Yahoo Protocol to make the network conecction for the chat session.
*/
public class ChatBean implements Renderable {

private YahooProtocolImpl yahooProtocolImpl = null;
private Session yahooSession = null;
private SessionListenerImpl sessionListenerImpl = null;
private YahooIdentity yahooIdentity = null;
protected YahooConference yahooConference = null;

private StringBuffer history = new StringBuffer();
private String message = "";
private String info = "";
private String status = "";

/**
* Time interval, in milliseconds, between renders.
*/
private final int renderInterval = 1000;

/**
* The state associated with the current user that can be used for
* server-initiated render calls.
*/
private PersistentFacesState state;

/**
* A named render group that can be shared by all TimeZoneBeans for
* server-initiated render calls. Setting the interval determines the
* frequency of the render call.
*/
private IntervalRenderer chat;

/**
* Default Constructor initializer.
*/
public ChatBean() {
//System.out.println("ChatBean.ChatBean");
yahooProtocolImpl = YahooProtocolImpl.getInstance();
yahooSession = yahooProtocolImpl.getYahooSession();
sessionListenerImpl = new SessionListenerImpl(this);
yahooSession.addSessionListener(sessionListenerImpl);
yahooIdentity = yahooProtocolImpl.getYahooIdentity();
try {
yahooConference = yahooSession.createConference(yahooProtocolImpl.getYahooSupport(), "root" + " is asking you support to module of " + "Invoice", yahooIdentity);
setInfo("Creating and establishing chat connection, waiting acceptance. Please don't close the chat window.");
changeStatus(4);
} catch(IOException ioException) {
ioException.printStackTrace();
setInfo("Problems such as timeouts are experienced when logging in, please close your chat window and try again.");
closeChatSession();
} catch(IllegalStateException illegalStateException) {
illegalStateException.printStackTrace();
setInfo("The user if not connected to Yahoo, please close your chat window and try again.");
closeChatSession();
} catch(IllegalIdentityException illegalIdentityException) {
illegalIdentityException.printStackTrace();
setInfo("The user does not own the supplied identity, please close your chat window and try again.");
closeChatSession();
}
state = PersistentFacesState.getInstance();
}

public String getHistory() {
return history.toString();
}

public void setHistory(String history) {
this.history.append(history).append('\n');
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

public String getInfo() {
return info;
}

public void setInfo(String info) {
this.info = info;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public String getDate() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a");
return dateFormat.format(new Date());
}

/**
* Send a message to a Yahoo user.
*/
public String sendMessage() {
//System.out.println("ChatBean.sendMessage");
try {
yahooSession.sendConferenceMessage(yahooConference, "root" + " - " + "Invoice" + ": " + message);
changeStatus(1);
} catch(IOException ioException) {
ioException.printStackTrace();
setInfo("Problems such as timeouts are experienced when sending message, please try again");
changeStatus(2);
} catch(IllegalStateException illegalStateException) {
illegalStateException.printStackTrace();
setInfo("The user appears to be not longer connected to Yahoo, please close your chat window and try again.");
closeChatSession();
}
history.append("root").append(" - ").append("Invoice").append(": ").append(message).append('\n');
message = "";
return "success";
}

/**
* Change the status icon.
*
* @param statusCode the status code of the icon to show
*/
public void changeStatus(int statusCode) {
switch(statusCode) {
case 1: //active
setStatus("connect_active.gif");
break;
case 2: //caution
setStatus("connect_caution.gif");
break;
case 3: //disconnected
setStatus("connect_disconnected.gif");
break;
case 4: //idle
setStatus("connect_idle.gif");
break;
}
}

/**
* Put the used Yahoo identity, into the identities pool again.
*/
public void returnYahooIdentity() {
//System.out.println("ChatBean.returnYahooIdentity");
yahooProtocolImpl.returnYahooIdentity(yahooIdentity);
}

/**
* Close the Yahoo session.
*/
public void closeYahooSession() {
//System.out.println("ChatBean.closeYahooSession");
yahooSession.removeSessionListener(sessionListenerImpl);
sessionListenerImpl = null;
yahooConference = null;
yahooSession = null;
yahooProtocolImpl = null;
}

/**
* Close the Yahoo chat session.
*/
public void closeChatSession() {
//System.out.println("ChatBean.closeChatSession");
changeStatus(3);
returnYahooIdentity();
closeYahooSession();
}

/**
* Used to create, setup, and start an IntervalRenderer from the passed renderManager
* This is used in conjunction with faces-config.xml to allow the same single render manager to be set in all backing beans.
*
* @param renderManager RenderManager to get the IntervalRenderer from
*/
public void setRenderManager(RenderManager renderManager) {
//System.out.println("ChatBean.setRenderManager");
chat = renderManager.getIntervalRenderer("chat");
chat.setInterval(renderInterval);
chat.add(this);
chat.requestRender();
}

/**
* Get RenderManager.
*
* @return RenderManager null
*/
public RenderManager getRenderManager() {
//System.out.println("ChatBean.getRenderManager");
return null;
}

/**
* Get the current instance of PersistentFacesState.
*
* @return PersistentFacesState state
*/
public PersistentFacesState getState() {
//System.out.println("ChatBean.getState");
return state;
}

/**
* Callback to inform us that there was an Exception while rendering.
*
* @param renderingException
*/
public void renderingException(RenderingException renderingException) {
//System.out.println("ChatBean.renderingException");
if(chat != null) {
chat.remove(this);
chat = null;
}
}

}

And this is the face_config.xml file:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

<faces-config>

<managed-bean>
<managed-bean-name>renderManager</managed-bean-name>
<managed-bean-class>com.icesoft.faces.async.render.RenderManager</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>

<managed-bean>
<managed-bean-name>chatBean</managed-bean-name>
<managed-bean-class>com.sabiosolutions.chat.ChatBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>renderManager</property-name>
<value>#{renderManager}</value>
</managed-property>
</managed-bean>

<navigation-rule>
<from-view-id>/chat/chat_chat_client.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/chat/chat_chat_client.jsp</to-view-id>
</navigation-case>
</navigation-rule>

</faces-config>
[Email]
dukehoops

Joined: 07/Nov/2006 00:00:00
Messages: 106
Offline


you're breaking Java Bean spec: each property needs:
-getter
-setter
-variable

thus, try adding:

private String date;

public setDate(String aDate)
{
//do nothing
}

---------------------------
-nikita

http://themusiclounge.com
cbustamante

Joined: 13/Sep/2006 00:00:00
Messages: 12
Offline


Hi I add the definition for date property, like you said. But I get the same error:

Dec 19, 2006 12:55:29 PM com.icesoft.faces.webapp.parser.Parser parse
SEVERE: Failed to execute JSP lifecycle.
javax.faces.el.EvaluationException: Cannot get value for expression '#{chatBean.date} - Status:'
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:402)
at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicInputRenderer.getValue(Ljavax.faces.component.UIComponent;)Ljava.lang.Object;(Unknown Source)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.getValue(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)Ljava.lang.String;(Unknown Source)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeEnd(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(Unknown Source)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(Unknown Source)
at com.icesoft.faces.renderkit.dom_html_basic.GroupRenderer.encodeChildren(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(Unknown Source)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(Unknown Source)
at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(Ljavax.faces.context.FacesContext;Ljavax.faces.component.UIComponent;)V(Unknown Source)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:480)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:361)



This is the modified backing bean code:

package com.sabiosolutions.chat;

import java.io.*;
import java.text.*;
import java.util.*;
import ymsg.network.*;
import com.icesoft.faces.webapp.xmlhttp.*;
import com.icesoft.faces.async.render.*;

/**
* @author cbustamante.
*
* Bean backing the chat application.
* This bean uses the RenderManager to update state at a specified interval and controls chat information during the session.
* Also uses the Yahoo Protocol to make the network conecction for the chat session.
*/
public class ChatBean implements Renderable {

private YahooProtocolImpl yahooProtocolImpl = null;
private Session yahooSession = null;
private SessionListenerImpl sessionListenerImpl = null;
private YahooIdentity yahooIdentity = null;
protected YahooConference yahooConference = null;

private StringBuffer history = new StringBuffer();
private String message = "";
private String info = "";
private String status = "";
private String date = "";

/**
* Time interval, in milliseconds, between renders.
*/
private final int renderInterval = 1000;

/**
* The state associated with the current user that can be used for
* server-initiated render calls.
*/
private PersistentFacesState state;

/**
* A named render group that can be shared by all TimeZoneBeans for
* server-initiated render calls. Setting the interval determines the
* frequency of the render call.
*/
private IntervalRenderer chat;

/**
* Default Constructor initializer.
*/
public ChatBean() {
//System.out.println("ChatBean.ChatBean");
yahooProtocolImpl = YahooProtocolImpl.getInstance();
yahooSession = yahooProtocolImpl.getYahooSession();
sessionListenerImpl = new SessionListenerImpl(this);
yahooSession.addSessionListener(sessionListenerImpl);
yahooIdentity = yahooProtocolImpl.getYahooIdentity();
try {
yahooConference = yahooSession.createConference(yahooProtocolImpl.getYahooSupport(), "root" + " is asking you support to module of " + "Invoice", yahooIdentity);
setInfo("Creating and establishing chat connection, waiting acceptance. Please don't close the chat window.");
changeStatus(4);
} catch(IOException ioException) {
ioException.printStackTrace();
setInfo("Problems such as timeouts are experienced when logging in, please close your chat window and try again.");
closeChatSession();
} catch(IllegalStateException illegalStateException) {
illegalStateException.printStackTrace();
setInfo("The user if not connected to Yahoo, please close your chat window and try again.");
closeChatSession();
} catch(IllegalIdentityException illegalIdentityException) {
illegalIdentityException.printStackTrace();
setInfo("The user does not own the supplied identity, please close your chat window and try again.");
closeChatSession();
}
state = PersistentFacesState.getInstance();
}

public String getHistory() {
return history.toString();
}

public void setHistory(String history) {
this.history.append(history).append('\n');
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

public String getInfo() {
return info;
}

public void setInfo(String info) {
this.info = info;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public String getDate() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a");
return dateFormat.format(new Date());
}

public void setDate(String date)
{
this.date = date;
}

/**
* Send a message to a Yahoo user.
*/
public String sendMessage() {
//System.out.println("ChatBean.sendMessage");
try {
yahooSession.sendConferenceMessage(yahooConference, "root" + " - " + "Invoice" + ": " + message);
changeStatus(1);
} catch(IOException ioException) {
ioException.printStackTrace();
setInfo("Problems such as timeouts are experienced when sending message, please try again");
changeStatus(2);
} catch(IllegalStateException illegalStateException) {
illegalStateException.printStackTrace();
setInfo("The user appears to be not longer connected to Yahoo, please close your chat window and try again.");
closeChatSession();
}
history.append("root").append(" - ").append("Invoice").append(": ").append(message).append('\n');
message = "";
return "success";
}

/**
* Change the status icon.
*
* @param statusCode the status code of the icon to show
*/
public void changeStatus(int statusCode) {
switch(statusCode) {
case 1: //active
setStatus("connect_active.gif");
break;
case 2: //caution
setStatus("connect_caution.gif");
break;
case 3: //disconnected
setStatus("connect_disconnected.gif");
break;
case 4: //idle
setStatus("connect_idle.gif");
break;
}
}

/**
* Put the used Yahoo identity, into the identities pool again.
*/
public void returnYahooIdentity() {
//System.out.println("ChatBean.returnYahooIdentity");
yahooProtocolImpl.returnYahooIdentity(yahooIdentity);
}

/**
* Close the Yahoo session.
*/
public void closeYahooSession() {
//System.out.println("ChatBean.closeYahooSession");
yahooSession.removeSessionListener(sessionListenerImpl);
sessionListenerImpl = null;
yahooConference = null;
yahooSession = null;
yahooProtocolImpl = null;
}

/**
* Close the Yahoo chat session.
*/
public void closeChatSession() {
//System.out.println("ChatBean.closeChatSession");
changeStatus(3);
returnYahooIdentity();
closeYahooSession();
}

/**
* Used to create, setup, and start an IntervalRenderer from the passed renderManager
* This is used in conjunction with faces-config.xml to allow the same single render manager to be set in all backing beans.
*
* @param renderManager RenderManager to get the IntervalRenderer from
*/
public void setRenderManager(RenderManager renderManager) {
//System.out.println("ChatBean.setRenderManager");
chat = renderManager.getIntervalRenderer("chat");
chat.setInterval(renderInterval);
chat.add(this);
chat.requestRender();
}

/**
* Get RenderManager.
*
* @return RenderManager null
*/
public RenderManager getRenderManager() {
//System.out.println("ChatBean.getRenderManager");
return null;
}

/**
* Get the current instance of PersistentFacesState.
*
* @return PersistentFacesState state
*/
public PersistentFacesState getState() {
//System.out.println("ChatBean.getState");
return state;
}

/**
* Callback to inform us that there was an Exception while rendering.
*
* @param renderingException
*/
public void renderingException(RenderingException renderingException) {
//System.out.println("ChatBean.renderingException");
if(chat != null) {
chat.remove(this);
chat = null;
}
}

}

Any other suggestion?
[Email]
cbustamante

Joined: 13/Sep/2006 00:00:00
Messages: 12
Offline


Hi, after a while I can resolve the problem. In this case the error was caused by a duplicate class, I had duplicated the chatBean.class in the web application and in my ejb's jar.
[Email]
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team