1 Reply Latest reply on Dec 27, 2008 6:28 PM by William Woodman

    seam 2.1.1 GA canty find my @destroy method

    William Woodman Master

      seam 2.1.1gs seems to keep complaining that it cant find my @Destroy method on my action class


      I cant see whats wrong with the component class defn - can anyone shed some light on whats going on here.


      my comonent code looks like this. 


      package org.domain.will.session;
      
      import javax.persistence.EntityManager;
      
      import org.domain.will.entity.member.Member;
      import org.domain.will.session.security.PasswordManager;
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.Begin;
      import org.jboss.seam.annotations.Destroy;
      import org.jboss.seam.annotations.End;
      import org.jboss.seam.annotations.Factory;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Role;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.annotations.web.RequestParameter;
      import org.jboss.seam.faces.FacesMessages;
      import org.jboss.seam.framework.EntityHome;
      import org.jboss.seam.log.Log;
      
      @Name("memberHome")
      @Scope (ScopeType.CONVERSATION)
      public class MemberHome extends EntityHome<Member>
      {
           static final long serialVersionUID = 1;
      
          @RequestParameter 
          String memberId;
      
          @Logger
           private Log log;
           
          @In FacesMessages facesMessages;
          @In (create=true) PasswordManager passwordManager;
          
          private boolean changed;
          
      
      
          @Factory("newMember")
          public Member initNode() 
          {
               facesMessages.add ("new member created by factory");
               log.info("newMember factory create initiated");
               return getInstance();
          }
          
      
          
          @Override
          public Object getId() 
          { 
              if (memberId==null)
              {
                  return super.getId();
              }
              else
              {
                  return memberId;
              }
          }
          
          @Override 
          public void create() 
          {
              super.create();
               facesMessages.add ("new member created, conversation started");
          }
      
          @End 
          public String clear() 
          {
               clearInstance();
               facesMessages.add("end member management, cease conversation");
               return "completed";
         }
      
          /*
           * end current conversation 
           */
          @End 
          public String cancel() 
          { 
               facesMessages.add("cancel member management, cancel conversation");
               return "cancel";
          }
      
          public void changePassword()
          {
              if (passwordManager.verify()) 
              {
                  this.persist();
                 facesMessages.add("Password updated");
                 changed = true;
              }
              else 
              {
                facesMessages.addToControl("verify", "Re-enter new password");
                revertUser();
              }
          }
          
          public boolean isChanged()
          {
             return changed;
          }
          
          private void revertUser()
          {
             //user = this.find();
          }
          
          @Destroy
          void onDestroy ()
          {
               log.info("destroy called for memberHome");
          }
            
      }
      



      and the error trace says


      7:11:28,660 INFO  [MemberHome] newMember factory create initiated
      17:11:28,832 WARN  [Component] Exception calling component @Destroy method: memberHome
      java.lang.IllegalArgumentException: method not found: onDestroy for component: memberHome
           at org.jboss.seam.Component.callComponentMethod(Component.java:2229)
           at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
           at org.jboss.seam.Component.destroy(Component.java:1436)
           at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
           at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:363)
           at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:129)
           at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:515)
           at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:247)
           at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:194)
           at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NoSuchMethodException: org.domain.will.session.MemberHome_$$_javassist_1.onDestroy()
           at java.lang.Class.getMethod(Unknown Source)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2208)
           ... 55 more