3 Replies Latest reply on Jun 28, 2006 11:52 AM by Gavin King

    Migration to seam 1.0.1GA: [org.jboss.seam.contexts.Contexts

    Gerd Michalke Newbie

      Hi !

      I have a program which used to work with seam rc.

      @Stateful
      @Name("accesendroitsbean")
      @Scope(ScopeType.EVENT)
      public class AccesEndroitsBean implements AccesEndroitsLocal, Serializable {
      
       List<Endroit> endroits;
       Map<String,Endroit> endroitsMap;
      
       @PersistenceContext
       EntityManager em;
      
       @Create
       public void loadData() {
      
       System.out.println("=====loaddata d'accesendroitbean");
       endroits = em.createQuery("from Endroit c")
       .setHint("org.hibernate.cacheable", true)
       .getResultList();
      
       Map<String,Endroit> results = new TreeMap<String,Endroit>();
      
       for (Endroit tf: endroits) {
       results.put(tf.getDescription(),tf);
       }
       endroitsMap = results;
       }
      
       public Converter getConverter() {
       return new EndroitConverter(endroits);
       }
      
       public Map<String, Endroit> getEndroits() {
       return endroitsMap;
       }
      
       public Endroit getNullEndroit() {
       return new Endroit();
       }
      
       static public class EndroitConverter
       implements Converter,
       Serializable
       {
       List<Endroit> tfs;
      
       public EndroitConverter(List<Endroit> tf) {
       this.tfs = tf;
       }
      
       public String getAsString(FacesContext facesContext,
       UIComponent component,
       Object obj)
       {
       if (obj == null) return null;
      
       String val = String.valueOf(((Endroit)obj).getId());
       return val;
       }
      
       public Object getAsObject(FacesContext facesContext,
       UIComponent component,
       String str)
       throws ConverterException
       {
       if (str == null || str.length()==0) {
       return null;
       }
      
       //String id = str;
       for (Endroit tfe : tfs) {
       String id = String.valueOf(tfe.getId());
       if (id.equals(str)) {
       return tfe;
       }
       }
      
       return null;
       }
       }
      
       @Remove @Destroy
       public void destroy() { }
      
      }
      


      Now, when calling this bean, I get this message although a @Destroy annotated method exists
      [org.jboss.seam.contexts.Contexts] could not find destroy method

      Could someone possibly help me ?

      Kind regards,
      Gerd