<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Unable to call SFSB from jsf.. javax.naming.NameNotFoundException
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/pcoll">Phanor Coll</a> in <i>EJB3 Development</i> - <a href="https://community.jboss.org/message/723542#723542">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>I get javax.naming.NameNotFoundException when trying to call a SFSB..here is my code:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>Interface</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@Remote</p><p>public interface UsuarioCrearCuenta {</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; void agregarInfoCuentaUsuario(InfoCuentaUsuario infocuentaUsuario);</p><p>&#160;&#160;&#160; void agregarInfoGeneralUsuario(InfoGeneralUsuario infogeneralUsuario);</p><p>&#160;&#160;&#160; void agregarPlanUsuario(InfoPlanUsuario infoplanUsuario);</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; @Remove</p><p>&#160;&#160;&#160; void crearCuenta();</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; @Remove</p><p>&#160;&#160;&#160; void cancelar();</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>BEAN</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@Stateful(name="UsuarioCrearCuenta")</p><p>@Remote(UsuarioCrearCuenta.class)</p><p>public class UsuarioCrearCuentaBean implements UsuarioCrearCuenta {</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; private InfoCuentaUsuario infocuentausuario;</p><p>&#160;&#160;&#160; private InfoGeneralUsuario infogeneralusuario;</p><p>&#160;&#160;&#160; private InfoPlanUsuario infoplanusuario;</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; public UsuarioCrearCuentaBean(){}</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; @PostConstruct</p><p>&#160;&#160;&#160; @PostActivate</p><p>&#160;&#160;&#160; public void openConnection() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println("se cargo UsuarioCrearCuenta - Iniciado proceso de creacion de cuenta");</p><p>&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; @Override</p><p>&#160;&#160;&#160; public void agregarInfoCuentaUsuario(InfoCuentaUsuario infocuentaUsuario) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.infocuentausuario=infocuentaUsuario;</p><p>&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; @Override</p><p>&#160;&#160;&#160; public void agregarInfoGeneralUsuario(InfoGeneralUsuario infogeneralUsuario) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.infogeneralusuario=infogeneralUsuario;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; @Override</p><p>&#160;&#160;&#160; public void agregarPlanUsuario(InfoPlanUsuario infoplanUsuario) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.infoplanusuario=infoplanUsuario;</p><p>&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; @Remove</p><p>&#160;&#160;&#160; public void cancelar() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; infogeneralusuario = null;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; infocuentausuario = null;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; infoplanusuario = null;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println("se cancelo la creacion de la cuenta");</p><p>&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; @Remove</p><p>&#160;&#160;&#160; public void crearCuenta() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println("se creo la cuenta");</p><p>&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; @PrePassivate</p><p>&#160;&#160;&#160; @PreDestroy</p><p>&#160;&#160;&#160; public void cleanup() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println("se elimino el session beean UsuarioCrearCuenta");</p><p>&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>CLIENTE</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@ManagedBean(name="creadorCuentaUsuario")</p><p>public class CrearCuenta {</p><p>&#160;&#160; </p><p>&#160;&#160;&#160; private static UsuarioCrearCuenta crearcuentausuario;</p><p>&#160;&#160;&#160; public String crear(){</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InitialContext context=new InitialContext();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; crearcuentausuario=(UsuarioCrearCuenta) context.lookup("<strong>gowiico/buslogic/UsuarioCrearCuentaBean/remote</strong>");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println("loading UsuarioCrearCuenta Bean");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return "steps";</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (NamingException e) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // TODO Auto-generated catch block</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.printStackTrace();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; return "steps";</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160; }</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>when I execute the method crear() from a JSF, I get this error:</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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</p><p>10:29:39,111 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)</p><p>10:29:39,111 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:177)</p><p>10:29:39,112 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113)</p><p>10:29:39,112 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:213)</p><p>10:29:39,112 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at javax.naming.InitialContext.lookup(InitialContext.java:392)</p><p>10:29:39,113 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at gowiico.buslogic.CrearCuenta.crear(CrearCuenta.java:60)</p><p>10:29:39,113 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p>10:29:39,114 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p>10:29:39,114 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p>10:29:39,115 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at java.lang.reflect.Method.invoke(Method.java:597)</p><p>10:29:39,115 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.el.parser.AstValue.invoke(AstValue.java:262)</p><p>10:29:39,115 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)</p><p>10:29:39,116 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)</p><p>10:29:39,116 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)</p><p>10:29:39,117 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)</p><p>10:29:39,117 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at javax.faces.component.UICommand.broadcast(UICommand.java:315)</p><p>10:29:39,118 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)</p><p>10:29:39,118 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)</p><p>10:29:39,119 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)</p><p>10:29:39,119 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)</p><p>10:29:39,120 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)</p><p>10:29:39,121 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)</p><p>10:29:39,121 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)</p><p>10:29:39,122 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)</p><p>10:29:39,123 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)</p><p>10:29:39,124 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)</p><p>10:29:39,124 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154)</p><p>10:29:39,125 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)</p><p>10:29:39,126 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)</p><p>10:29:39,127 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)</p><p>10:29:39,127 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)</p><p>10:29:39,128 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)</p><p>10:29:39,129 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)</p><p>10:29:39,129 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)</p><p>10:29:39,130 ERROR [stderr] (http--127.0.0.1-8080-3)&#160;&#160;&#160; at java.lang.Thread.run(Thread.java:662)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>How can I fix this, what Im I doing wrong?? I'm using JbossAS7.1 and Jboss Developer Studio.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/723542#723542">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in EJB3 Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2030">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>