1 Reply Latest reply on May 30, 2008 10:27 PM by Matt Davis

    Conversational bean not found on any scope

    Vinicius Carvalho Newbie

      Hello there I'm creating a search component using my own extended datamodel.
      But after clicking on search button, I get an exception:




      /search.xhtml @27,55 binding="#{searchBean.dataTable}": Target Unreachable, identifier 'searchBean' resolved to null"




      The debug pages shows my component searchBean on the conversational scope, why is this happening?


      Regards


      @Name("searchBean")
      @Scope(ScopeType.CONVERSATION)
      public class SearchResultsBean {
              
              @Logger
              private Log log;
              
              @In(required=false)
              private String queryString;
              
              @In(required=false)
              private Boolean isExactPhrase = false;
              
              private Query query;
              
          @In(required = false)
          @Out(required = false)
              private UIData dataTable;
              
              private SearchHitDataModel dataModel;
              
              private DocumentSearchStrategy searchStrategy = new DocumentSearchStrategy();
              
      
      
              
      
              @Create
              public void init(){
                      log.info("Iniciando objeto de busca");
                      this.dataTable = new UIData();
              }
              
              @Begin(join=true)
              public void search(){
                      try {
                              query = QueryBuilder.buildQuery(queryString, isExactPhrase);
                              dataModel = new SearchHitDataModel(query);
                              dataTable.setFirst(0);
                      } catch (ParseException e) {
                              e.printStackTrace();
                      }
              }


      .


      <ui:define name="body">
        <h:messages globalOnly="true" styleClass="message"/>
       <h:form id="searchForm" styleClass="edit">
               <h:inputText value="#{searchBean.queryString}"></h:inputText>
               <h:commandButton id="searchBtn" 
                                value="Search..." 
                               action="#{searchBean.search}"/> 
       </h:form>
       
         <rich:panel>
              <f:facet name="header">Resultados</f:facet>
                <div class="results">
                <a4j:form>
                <h:dataTable id="resultsTable" var="hit"
                            rows="10" binding="#{searchBean.dataTable}"
                            valeu="#{searchBean.dataModel}">
      
                              <rich:column>
                                      <h:outputText value="#{hit.title}"/><br/>
                                      <h:outputText value="#{hit.contents}"/>
                              </rich:column>
                </h:dataTable>
                <rich:datascroller for="resultsTable" align="left"/>
                        </a4j:form>     
                </div>
          </rich:panel>   
         
      </ui:define>
      
      </ui:composition>


        • 1. Re: Conversational bean not found on any scope
          Matt Davis Newbie

          This error most commonly occurs when you're using a bean that is in a package hierarchy with no seam.properties file at the base.


          That file is a marker for seam to let it know that there are entities in the packages and it should scan them.


          That said, I've struggled with this error even when I have the seam.properties file. One time it was a problem with my deployment... it wasn't putting the class files in the ejb jar for some reason.


          I'd suggest checking your actual deployed code to ensure that you have the .class file for your entity bean in the correct package, and that there is a seam.properties file at the base.