9 Replies Latest reply: Apr 12, 2012 3:45 AM by Viggo Navarsete RSS

Unable to call SFSB from jsf.. javax.naming.NameNotFoundException

Phanor Coll Newbie

I get javax.naming.NameNotFoundException when trying to call a SFSB..here is my code:

 

 

Interface

 

@Remote

public interface UsuarioCrearCuenta {

   

    void agregarInfoCuentaUsuario(InfoCuentaUsuario infocuentaUsuario);

    void agregarInfoGeneralUsuario(InfoGeneralUsuario infogeneralUsuario);

    void agregarPlanUsuario(InfoPlanUsuario infoplanUsuario);

   

    @Remove

    void crearCuenta();

   

    @Remove

    void cancelar();

}

 

 

BEAN

 

@Stateful(name="UsuarioCrearCuenta")

@Remote(UsuarioCrearCuenta.class)

public class UsuarioCrearCuentaBean implements UsuarioCrearCuenta {

   

    private InfoCuentaUsuario infocuentausuario;

    private InfoGeneralUsuario infogeneralusuario;

    private InfoPlanUsuario infoplanusuario;

   

    public UsuarioCrearCuentaBean(){}

   

    @PostConstruct

    @PostActivate

    public void openConnection() {

        System.out.println("se cargo UsuarioCrearCuenta - Iniciado proceso de creacion de cuenta");

    }

   

   

    @Override

    public void agregarInfoCuentaUsuario(InfoCuentaUsuario infocuentaUsuario) {

        this.infocuentausuario=infocuentaUsuario;

    }

 

    @Override

    public void agregarInfoGeneralUsuario(InfoGeneralUsuario infogeneralUsuario) {

        this.infogeneralusuario=infogeneralUsuario;

 

    }

 

    @Override

    public void agregarPlanUsuario(InfoPlanUsuario infoplanUsuario) {

        this.infoplanusuario=infoplanUsuario;

    }

   

    @Remove

    public void cancelar() {

        infogeneralusuario = null;

        infocuentausuario = null;

        infoplanusuario = null;

        System.out.println("se cancelo la creacion de la cuenta");

    }

   

    @Remove

    public void crearCuenta() {

        System.out.println("se creo la cuenta");

    }

   

    @PrePassivate

    @PreDestroy

    public void cleanup() {

        System.out.println("se elimino el session beean UsuarioCrearCuenta");

    }

 

}

 

CLIENTE

 

@ManagedBean(name="creadorCuentaUsuario")

public class CrearCuenta {

  

    private static UsuarioCrearCuenta crearcuentausuario;

    public String crear(){

 

        try {

            InitialContext context=new InitialContext();

            crearcuentausuario=(UsuarioCrearCuenta) context.lookup("gowiico/buslogic/UsuarioCrearCuentaBean/remote");

             System.out.println("loading UsuarioCrearCuenta Bean");

             return "steps";

        } catch (NamingException e) {

            // TODO Auto-generated catch block

            e.printStackTrace();

        }

        return "steps";

       

    }

}

 

when I execute the method crear() from a JSF, I get this error:

 

10:29:39,110 ERROR [stderr] (http--127.0.0.1-8080-3) javax.naming.NameNotFoundException: gowiico/buslogic/UsuarioCrearCuentaBean/remote -- service jboss.naming.context.java.gowiico.buslogic.UsuarioCrearCuentaBean.remote

10:29:39,111 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

10:29:39,111 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:177)

10:29:39,112 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113)

10:29:39,112 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:213)

10:29:39,112 ERROR [stderr] (http--127.0.0.1-8080-3)    at javax.naming.InitialContext.lookup(InitialContext.java:392)

10:29:39,113 ERROR [stderr] (http--127.0.0.1-8080-3)    at gowiico.buslogic.CrearCuenta.crear(CrearCuenta.java:60)

10:29:39,113 ERROR [stderr] (http--127.0.0.1-8080-3)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

10:29:39,114 ERROR [stderr] (http--127.0.0.1-8080-3)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

10:29:39,114 ERROR [stderr] (http--127.0.0.1-8080-3)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

10:29:39,115 ERROR [stderr] (http--127.0.0.1-8080-3)    at java.lang.reflect.Method.invoke(Method.java:597)

10:29:39,115 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.el.parser.AstValue.invoke(AstValue.java:262)

10:29:39,115 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)

10:29:39,116 ERROR [stderr] (http--127.0.0.1-8080-3)    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)

10:29:39,116 ERROR [stderr] (http--127.0.0.1-8080-3)    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

10:29:39,117 ERROR [stderr] (http--127.0.0.1-8080-3)    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

10:29:39,117 ERROR [stderr] (http--127.0.0.1-8080-3)    at javax.faces.component.UICommand.broadcast(UICommand.java:315)

10:29:39,118 ERROR [stderr] (http--127.0.0.1-8080-3)    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)

10:29:39,118 ERROR [stderr] (http--127.0.0.1-8080-3)    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)

10:29:39,119 ERROR [stderr] (http--127.0.0.1-8080-3)    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)

10:29:39,119 ERROR [stderr] (http--127.0.0.1-8080-3)    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

10:29:39,120 ERROR [stderr] (http--127.0.0.1-8080-3)    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

10:29:39,121 ERROR [stderr] (http--127.0.0.1-8080-3)    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

10:29:39,121 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

10:29:39,122 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

10:29:39,123 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

10:29:39,124 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

10:29:39,124 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154)

10:29:39,125 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

10:29:39,126 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

10:29:39,127 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

10:29:39,127 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

10:29:39,128 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

10:29:39,129 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)

10:29:39,129 ERROR [stderr] (http--127.0.0.1-8080-3)    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)

10:29:39,130 ERROR [stderr] (http--127.0.0.1-8080-3)    at java.lang.Thread.run(Thread.java:662)

 

 

 

How can I fix this, what Im I doing wrong?? I'm using JbossAS7.1 and Jboss Developer Studio.