Can't call properties of SFSB in EL
oberiko.oberiko.gmail.com May 5, 2009 7:20 PMHello.
I can't call a property of my SFSB on my XHTML page, right now it gives me the error "Property 'outId' not found on type org.javassist.tmp.java.lang.Object_$$_javassist_1".
**** XHTML ****
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:a="http://richfaces.org/a4j"
template="layout/template.xhtml">
<ui:define name="body">
<h:form id="searchOutageForm">
<rich:simpleTogglePanel switchType="client" label="Search criteria" opened="true">
<s:decorate template="layout/edit.xhtml">
<ui:define name="label">ID</ui:define>
<h:inputText value="#{searchOutage.outId}" />
</s:decorate>
<br style="clear:both;"/>
<h:commandButton value="Search" action="#{searchOutage.searchOutage()}"/>
</rich:simpleTogglePanel>
<h:outputText value="No outage exists" rendered="#{empty outageSearchResults}"/>
<h:dataTable id="outageResults" value="#{outageSearchResults}" var="outage"
rendered="#{not empty outageSearchResults}">
<h:column>
<f:facet name="header">Id</f:facet>
#{outage.id}
</h:column>
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
**** SFSB ****
@Stateful
@Name("searchOutage")
public class SearchOutageBean implements SearchOutage
{
@Logger private Log log;
@In StatusMessages statusMessages;
@PersistenceContext
protected EntityManager em;
@Out(required=false)
List<Outage> outageSearchResults;
@Begin(join=true)
public void searchOutage()
{
log.info("searchOutage.searchOutage() action called: "+outId);
outageSearchResults = searchQuery().getResultList();
log.info("Found #0 outages", outageSearchResults.size());
}
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
private Query<EntityManager, Outage> searchQuery(){
EntityQuery<Outage> q = new EntityQuery<Outage>();
q.setEntityManager(em);
q.setEjbql("select outage from Outage outage");
return q;
}
@Destroy @Remove
public void destroy() {
log.info("Destroying the SearchOutageBean SFSB");
}
@End
public void end() {
log.info("Ending the SearchOutageBean conversation");
}
private String outId;
public String getOutId() {
return outId;
}
public void setOutId(String outId) {
this.outId = outId;
}
}
**** The error on loading the page ****
ERROR [viewhandler] Error Rendering View[/searchOutage.xhtml]
javax.faces.FacesException: javax.el.PropertyNotFoundException: /searchOutage.xhtml @17,50 value="#{searchOutage.outId}": Property 'outId' not found on type org.javassist.tmp.java.lang.Object_$$_javassist_1
***************************************************************************
Any have any idea what am I doing incorrectly?
I can't call a property of my SFSB on my XHTML page, right now it gives me the error "Property 'outId' not found on type org.javassist.tmp.java.lang.Object_$$_javassist_1".
**** XHTML ****
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:a="http://richfaces.org/a4j"
template="layout/template.xhtml">
<ui:define name="body">
<h:form id="searchOutageForm">
<rich:simpleTogglePanel switchType="client" label="Search criteria" opened="true">
<s:decorate template="layout/edit.xhtml">
<ui:define name="label">ID</ui:define>
<h:inputText value="#{searchOutage.outId}" />
</s:decorate>
<br style="clear:both;"/>
<h:commandButton value="Search" action="#{searchOutage.searchOutage()}"/>
</rich:simpleTogglePanel>
<h:outputText value="No outage exists" rendered="#{empty outageSearchResults}"/>
<h:dataTable id="outageResults" value="#{outageSearchResults}" var="outage"
rendered="#{not empty outageSearchResults}">
<h:column>
<f:facet name="header">Id</f:facet>
#{outage.id}
</h:column>
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
**** SFSB ****
@Stateful
@Name("searchOutage")
public class SearchOutageBean implements SearchOutage
{
@Logger private Log log;
@In StatusMessages statusMessages;
@PersistenceContext
protected EntityManager em;
@Out(required=false)
List<Outage> outageSearchResults;
@Begin(join=true)
public void searchOutage()
{
log.info("searchOutage.searchOutage() action called: "+outId);
outageSearchResults = searchQuery().getResultList();
log.info("Found #0 outages", outageSearchResults.size());
}
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
private Query<EntityManager, Outage> searchQuery(){
EntityQuery<Outage> q = new EntityQuery<Outage>();
q.setEntityManager(em);
q.setEjbql("select outage from Outage outage");
return q;
}
@Destroy @Remove
public void destroy() {
log.info("Destroying the SearchOutageBean SFSB");
}
@End
public void end() {
log.info("Ending the SearchOutageBean conversation");
}
private String outId;
public String getOutId() {
return outId;
}
public void setOutId(String outId) {
this.outId = outId;
}
}
**** The error on loading the page ****
ERROR [viewhandler] Error Rendering View[/searchOutage.xhtml]
javax.faces.FacesException: javax.el.PropertyNotFoundException: /searchOutage.xhtml @17,50 value="#{searchOutage.outId}": Property 'outId' not found on type org.javassist.tmp.java.lang.Object_$$_javassist_1
***************************************************************************
Any have any idea what am I doing incorrectly?