I’m implementing the Serializable on all my session classes so I could make some farm clustering with a load balancer.
I already have the clustering under control and it’s working fine. However, I’m getting an error which it seems I’m not able to solve.
Whenever I enter on the index.jsp I receive this error:
Mensaje: javax.servlet.ServletException: java.lang.Exception: javax.faces.FacesException: Problem in renderResponse: /WEB-INF/inc-content/content.jspx @5,73 <f:loadBundle basename="#{idioma.messageBundleSinProp}"> /WEB-INF/inc-content/content.jspx @5,73 basename="#{idioma.messageBundleSinProp}" setAttribute: Atributo no serializable
Tipo Error: class javax.servlet.ServletException
Excepcion: javax.servlet.ServletException: java.lang.Exception: javax.faces.FacesException: Problem in renderResponse: /WEB-INF/inc-content/content.jspx @5,73 <f:loadBundle basename="#{idioma.messageBundleSinProp}"> /WEB-INF/inc-content/content.jspx @5,73 basename="#{idioma.messageBundleSinProp}" setAttribute: Atributo no serializable
Codigo de Estado: 500
Nombre Servlet: jsp
Despite the Spanish, it basically says that the attribute isn’t serializable. It seems I’m missing something because the idioma.messageBundleSinProp is a getter, not a setter:
public String getMessageBundle()
{
if(idiomaSeleccionado!=null)
return(webUtil.getPropertiesValue(idiomaSeleccionado, "LanguageChances.properties"));
else
return(webUtil.getPropertiesValue(idiomaSeleccionadoDefecto, "LanguageChances.properties"));
}
public String getMessageBundleSinProp()
{
//String propertieSeleccionado=getMessageBundle();
return(getMessageBundle().substring(0,getMessageBundle().indexOf(".")));
}
What could be wrong?
Actually the loadBundle component was made transient from JSF 2.0.
Source Code JSF 1.2
Source Code JSF 2.0
Since you are also not using Icefaces 2.0. You cannot make use of this either.
ICEFACES JIRA
So the only way I can think of is creating your own messageBean and retriving the messages.
You can do something like this:
And use something like this on your page to retrieve the messages: