4 Replies Latest reply on Apr 20, 2007 3:08 PM by Qing Zheng

    Help: get exception when using EL to reference a EJB member

    Qing Zheng Newbie

      Hi,

      I am new to Seam. I am playing with the hotel example. I modified main.xhtml to use my own search bean.

       ....
       <h:form id="searchCriteria">
       <fieldset>
       <h:inputText id="searchString"
       value="#{edaSearch.searchString}"
       style="width: 165px;">
       <a:support event="onkeyup" actionListener="#{edaSearch.find}" reRender="searchResults" />
       </h:inputText>
       </fieldset>
       .....
      

      I got the follwoing exception:
      /main.xhtml @23,92 value="#{edaSearch.searchString}": Exception getting value of property searchString of base of type : org.javassist.tmp.java.lang.Object_$$_javassist_117
      


      The follwoings are the my classes. They are very similar to HotelSearching.java and HotelSearchingAction.java

      Searching.java
      package com.ericsson.ems;
      
      import javax.ejb.Local;
      
      @Local
      public interface Searching {
       public int getPageSize();
       public void setPageSize(int pageSize);
      
       public String getSearchString();
       public void setSearchString(String searchString);
      
       public String getSearchPattern();
      
       public void find();
       public void nextPage();
       public boolean isNextPageAvailable();
      
       public void destroy();
      }
      

      EdaSearchingAction.java
      @Stateful
      @Name("edaSearch")
      @Scope(ScopeType.SESSION)
      @Restrict("#{identity.loggedIn}")
      public class EdaSearchingAction implements Searching {
      
       @PersistenceContext
       private EntityManager em;
      
       private String searchString;
       private int pageSize = 10;
       private int page;
      
       @In
       Eda eda;
      
       @DataModel("searchList")
       private List<Eda> list;
       @DataModelSelection
       private Eda selObj;
      
       @Logger
       private Log log;
      
       public void find() {
       page = 0;
       queryEdas();
       }
      
       public void nextPage() {
       page++;
       queryEdas();
       }
      
       private void queryEdas() {
       list = em.createQuery("select e from Eda e where lower(e.name) like #{pattern} or lower(e.ipAddr) like #{pattern}")
       .setMaxResults(pageSize)
       .setFirstResult( page * pageSize )
       .getResultList();
       }
      
       public boolean isNextPageAvailable() {
       return list!=null && list.size() == pageSize;
       }
      
       public int getPageSize() {
       return pageSize;
       }
      
       public void setPageSize(int pageSize) {
       this.pageSize = pageSize;
       }
      
       @Factory(value="pattern", scope=ScopeType.EVENT)
       public String getSearchPattern() {
       return searchString==null ?
       "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%';
       }
      
       public String getSearchString() {
       return this.searchString;
       }
      
       public void setSearchString(String searchString) {
       this.searchString = searchString;
       }
      
       @Destroy @Remove
       public void destroy() {}
      }
      

      Am I missing something?

      Thanks in advance for your help.

      Qing

        • 1. Re: Help: get exception when using EL to reference a EJB mem
          Pete Muir Master

          You need to post the whole stack trace

          • 2. Re: Help: get exception when using EL to reference a EJB mem
            Qing Zheng Newbie

            Here is the stack trace.

            Thanks.

            javax.faces.el.EvaluationException: /main.xhtml @23,92 value="#{edaSearch.searchString}": Exception getting value of property searchString of base of type : org.javassist.tmp.java.lang.Object_$$_javassist_117
             at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
             at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
             at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:217)
             at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderInput(HtmlTextRendererBase.java:135)
             at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:53)
             at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
             at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:252)
             at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
             at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
             at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
             at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
             at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
             at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
             at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
             at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
             at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
             at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
             at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
             at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
             at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
             at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
             at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
             at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
             at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
             at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
             at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
             at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
             at java.lang.Thread.run(Thread.java:595)
            Caused by: javax.faces.el.EvaluationException: Bean: org.javassist.tmp.java.lang.Object_$$_javassist_117, property: searchString
             at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:442)
             at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:82)
             at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
             at com.sun.el.parser.AstValue.getValue(AstValue.java:125)
             at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:195)
             at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
             at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
             ... 48 more
            Caused by: java.lang.reflect.InvocationTargetException
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:438)
             ... 54 more
            Caused by: javax.ejb.EJBException: org.jboss.seam.RequiredException: In attribute requires non-null value: edaSearch.eda
             at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
             at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
             at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
             at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:203)
             at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
             at $Proxy120.getSearchString(Unknown Source)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
             at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
             at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:72)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
             at org.jboss.seam.interceptors.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:37)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
             at org.jboss.seam.interceptors.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:40)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
             at org.jboss.seam.interceptors.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:31)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
             at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
             at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
             at org.javassist.tmp.java.lang.Object_$$_javassist_117.getSearchString(Object_$$_javassist_117.java)
             ... 59 more
            Caused by: org.jboss.seam.RequiredException: In attribute requires non-null value: edaSearch.eda
             at org.jboss.seam.Component.getValueToInject(Component.java:1919)
             at org.jboss.seam.Component.injectAttributes(Component.java:1368)
             at org.jboss.seam.Component.inject(Component.java:1195)
             at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
             at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
             at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
             at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
             at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
             at sun.reflect.GeneratedMethodAccessor258.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
             at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:46)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
             ... 92 more
            +- Component Tree
            <AjaxViewRoot id="_viewRoot" immediate="false" locale="en" renderKitId="HTML_BASIC" renderRegionOnly="false" rendered="true" selfRendered="false" submitted="false" transient="false" viewId="/main.xhtml">
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
            <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Ericsson Management System</title> <link href="css/screen.css" rel="stylesheet" type="text/css"/> <link href="css/date.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="document"> <div id="header"> <div id="title"><img src="img/ericsson_logo.gif" alt="Ericsson Management System"/></div> <div id="status"> Welcome #{user.name} |
            <HtmlLink disabled="false" id="search" immediate="false" propagation="none" rendered="true" transient="false" value="Search" view="/main.xhtml"/>
            |
            <HtmlLink disabled="false" id="settings" immediate="false" propagation="none" rendered="true" transient="false" value="Settings" view="/password.xhtml"/>
            |
            <HtmlLink action="#{identity.logout}" disabled="false" id="logout" immediate="false" propagation="default" rendered="true" transient="false" value="Logout"/>
            </div> </div> <div id="container"> <div id="sidebar">
            </div> <div id="content">
            <div class="section"> <span class="errors">
            <HtmlMessages globalOnly="true" id="_id7" layout="list" rendered="true" showDetail="false" showSummary="true" tooltip="false" transient="false"/>
            </span> <h1>Seach EDA1500</h1>
            <HtmlForm enctype="application/x-www-form-urlencoded" id="searchCriteria" rendered="true" submitted="false" transient="false">
            <fieldset>
            <HtmlInputText disabled="false" id="searchString" immediate="false" localValueSet="false" maxlength="-2147483648" onkeyup="A4J.AJAX.Submit('_viewRoot','searchCriteria',event,{'parameters':{'searchCriteria:_id10':'searchCriteria:_id10'},'actionUrl':'/ems/main.seam'})" readonly="false" rendered="true" required="false" size="-2147483648" style="width: 165px;" transient="false" valid="true">
            org.ajax4jsf.ajax.SUPPORTonkeyup
            <HtmlAjaxSupport actionListener="#{edaSearch.find}" ajaxSingle="false" bypassUpdates="false" disableDefault="false" event="onkeyup" id="_id10" ignoreDupResponses="false" immediate="false" limitToList="false" rendered="true" requestDelay="-2147483648" timeout="-2147483648" transient="false"/>
            </HtmlInputText>
            
            <HtmlAjaxCommandButton action="#{edaSearch.find}" ajaxSingle="false" bypassUpdates="false" disabled="false" id="findEdas" ignoreDupResponses="false" immediate="false" limitToList="false" rendered="true" requestDelay="-2147483648" size="-2147483648" timeout="-2147483648" transient="false" value="Find EDA1500s"/>
            
            <HtmlAjaxStatus forceId="false" id="_id13" rendered="true" transient="false">
            start
            <HtmlGraphicImage id="_id14" ismap="false" rendered="true" transient="false" url="/img/spinner.gif" value="/img/spinner.gif"/>
            </HtmlAjaxStatus>
            <br/>
            <HtmlOutputLabel for="pageSize" id="_id16" rendered="true" transient="false">
            Maximum results:
            </HtmlOutputLabel>
            
            <HtmlSelectOneMenu disabled="false" id="pageSize" immediate="false" localValueSet="false" readonly="false" rendered="true" required="false" transient="false" valid="true">
            <UISelectItem id="_id19" itemDisabled="false" itemLabel="5" itemValue="5" rendered="true" transient="false"/>
            <UISelectItem id="_id20" itemDisabled="false" itemLabel="10" itemValue="10" rendered="true" transient="false"/>
            <UISelectItem id="_id21" itemDisabled="false" itemLabel="20" itemValue="20" rendered="true" transient="false"/>
            </HtmlSelectOneMenu>
            </fieldset>
            </HtmlForm>
            </div>
            <HtmlAjaxOutputPanel ajaxRendered="false" id="searchResults" keepTransient="true" layout="inline" rendered="true" transient="false">
            <div class="section">
            <HtmlOutputText escape="true" id="_id25" rendered="false" transient="false" value="No EDA1500 Found"/>
            <HtmlDataTable border="-2147483648" first="0" id="searchList" rendered="false" rowIndex="-1" rows="0" transient="false" var="eda">
            <UIColumn header="Name" id="_id26" rendered="true" transient="false">
            header
            Name
            #{eda.name}
            </UIColumn>
            <UIColumn header="IP Address" id="_id29" rendered="true" transient="false">
            header
            IP Address
            #{eda.ipAddr}
            </UIColumn>
            <UIColumn header="Action" id="_id32" rendered="true" transient="false">
            header
            Action
            <HtmlLink action="#{edaSearch.delete}" disabled="false" id="deleteEda1500" immediate="false" propagation="default" rendered="true" transient="false" value="Delete"/>
            </UIColumn>
            </HtmlDataTable>
            <div class="buttonBox">
            <HtmlCommandButton action="addEda1500.xhtml" disabled="false" id="create" immediate="false" readonly="false" rendered="true" transient="false" type="submit" value="Create"/>
            
            <HtmlButton action="#{edaSearch.nextPage}" disabled="false" id="more" immediate="false" propagation="default" readonly="false" transient="false" type="button" value="More Results"/>
            </div> </div>
            </HtmlAjaxOutputPanel>
            <!DOCTYPE div PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
            <div xmlns="http://www.w3.org/1999/xhtml"> <div class="section"> <h1>
            <HtmlOutputText escape="true" id="_id39" rendered="false" transient="false" value="Workspaces"/>
            </h1> </div> <div class="section">
            <HtmlForm enctype="application/x-www-form-urlencoded" id="_id41" rendered="true" submitted="false" transient="false">
            <HtmlDataTable border="-2147483648" first="0" id="_id42" rendered="true" rowIndex="-1" rows="0" transient="false" var="entry">
            <UIColumn id="_id43" rendered="true" transient="false">
            <HtmlCommandLink action="#{entry.select}" id="_id44" immediate="false" rendered="true" transient="false"/>
            
            <HtmlOutputText escape="true" id="_id46" rendered="false" transient="false" value="[current]"/>
            </UIColumn>
            <UIColumn id="_id47" rendered="true" transient="false">
            <HtmlOutputText converter="org.jboss.seam.ui.ConvertDateTime@959a7a" escape="true" id="_id48" rendered="true" transient="false"/>
            -
            <HtmlOutputText converter="org.jboss.seam.ui.ConvertDateTime@1d0f32d" escape="true" id="_id50" rendered="true" transient="false"/>
            </UIColumn>
            </HtmlDataTable>
            </HtmlForm>
            </div> </div>
            </div> </div> <div id="footer">Entrisphere an Ericsson Company</div> </div> </body> </html>
            </AjaxViewRoot>
            +- Scoped Variables
            Request Parameters Name Value
            cid 18
            Request Attributes Name Value
            ajaxContext org.ajax4jsf.framework.ajax.AjaxContext@10d1c98
            Session Attributes Name Value
            user User(qzheng)
            Application Attributes Name Value
            __oscache_admin com.opensymphony.oscache.web.ServletCacheAdministrator@d65428
            __oscache_cache com.opensymphony.oscache.web.ServletCache@12f1ce2
            
            


            • 3. Re: Help: get exception when using EL to reference a EJB mem
              Pete Muir Master

              Here's your problem

              Caused by: org.jboss.seam.RequiredException: In attribute requires non-null value: edaSearch.eda


              Either make sure the eda component is available or use required=false

              • 4. Re: Help: get exception when using EL to reference a EJB mem
                Qing Zheng Newbie

                Thank you very much for your help. The eda component not available is indeed the root cause of the problem.

                Qing