[jboss-user] [JBoss Seam] - Help: get exception when using EL to reference a EJB member

qzhengyy do-not-reply at jboss.com
Thu Apr 19 13:55:50 EDT 2007


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4038983#4038983

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4038983



More information about the jboss-user mailing list