1 Reply Latest reply: Jan 15, 2011 3:19 AM by Olalekan Ogunleye RSS

Caused by javax.el.MethodNotFoundException with message: "Method not found: Proxy to jboss.j2ee:ear=: Although Method is Present

Olalekan Ogunleye Newbie
Hi All,

Please help me and tell me what I am doing wrong

I have this class with the method deleteSubscriber()


import java.io.Serializable;
import java.util.List;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.End;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Transactional;
import org.jboss.seam.annotations.datamodel.DataModel;
import org.jboss.seam.annotations.datamodel.DataModelSelection;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.jsf.ListDataModel;


import entity.Subscriber;


@Stateful
@Scope(ScopeType.SESSION)
@Name("subscriberManager")
public class SubscriberManagerBean implements SubscriberManager, Serializable
{
     private static final long serialVersionUID = 585890184804254523L;

     @DataModel(scope=ScopeType.PAGE)
    //private List<Subscriber> subscriberList; //This variable is part of an effort to get a subscriber removed
     
     @In
     @PersistenceContext(type=PersistenceContextType.EXTENDED)
    private EntityManager entityManager;
     
     @DataModelSelection
     @In(create=true)
    @Out(required=false)
    private Subscriber subscriber;
     
    @Begin(join=true)
    public String createSubscriber(){
         subscriber = new Subscriber();
         return "success";
    }
   
     @Transactional
    public void deleteSubscriber(Integer id){
          subscriber = new Subscriber();
          System.out.println("I got here FIRST");
          subscriber=entityManager.find(Subscriber.class, id);
                  System.out.println("I got here");
         entityManager.remove(subscriber);
         //subscriber = null;
    }
   
    @Destroy
    @Remove
    public void destroy() {}
   
    @End
    public String saveSubscriber() {
         entityManager.persist(subscriber);
         @SuppressWarnings("unchecked")
          List<Subscriber> subscribers = entityManager.createQuery("Select s from Subscriber s").getResultList();
         Contexts.getSessionContext().set("subscribers", new ListDataModel(subscribers));
         return "success";
    }
   
   

}


I have this interface

import javax.ejb.Local;

@Local
public interface SubscriberManager {
     
     public String createSubscriber();     
     public String saveSubscriber();
     public void deleteSubscriber(Integer id);
    public void destroy();


}


But I still get this error even though the method is present. Someone please help me
  • 1. Re: Caused by javax.el.MethodNotFoundException with message: "Method not found: Proxy to jboss.j2ee:ear=: Although Method is Present
    Olalekan Ogunleye Newbie
    This is my error log


    Exception during request processing:
    Caused by javax.el.MethodNotFoundException with message: "Method not found: Proxy to jboss.j2ee:ear=web-admin-ear.ear,jar=web-admin-ejb.jar,name=SubscriberManagerBean,service=EJB3 implementing [interface admin.session.SubscriberManager].deleteSubscriber()"
    org.jboss.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:258)
    org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:347)
    org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
    org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
    org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
    org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
    org.jboss.seam.navigation.Pages.callAction(Pages.java:703)
    org.jboss.seam.navigation.Pages.preRender(Pages.java:331)
    org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
    org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
    org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
    org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
    com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
    org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
    org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
    org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
    org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
    org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
    org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
    org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
    org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
    org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    java.lang.Thread.run(Thread.java:619)