Java wildfly 8.1.0进行EJB远程调用时出错

Java wildfly 8.1.0进行EJB远程调用时出错,java,jakarta-ee,jboss,Java,Jakarta Ee,Jboss,我在8.1.0中制作了一个应用程序,它使用EJB远程会话bean,但是当我进行查找时,会出现以下错误: EJBCLIENT000025: No EJB receiver available for handling [appName:rb, moduleName:remot, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@75f1b0bc 我已经

我在8.1.0中制作了一个应用程序,它使用EJB远程会话bean,但是当我进行查找时,会出现以下错误:

EJBCLIENT000025: No EJB receiver available for handling [appName:rb, moduleName:remot, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@75f1b0bc
我已经将application.xml文件和module.xml文件配置为使用rb应用程序名和远程模块名。当我启动服务器时,它会毫无错误地启动,并部署EJB,因此我认为问题出在客户端,这是客户端的代码:

@SuppressWarnings({ "rawtypes", "unchecked" })
    private static void busquedaServidor(Server.DatosRegistro datos) throws NamingException
    {        
        final Hashtable jndiProperties = new Hashtable();
        jndiProperties.put(Context.URL_PKG_PREFIXES,"org.jboss.ejb.client.naming);
        final Context context = new InitialContext(jndiProperties);

        final String appName = "rb";

        final String moduleName = "remot";

        final String distinctName = "";

        final String beanName = Ejb.class.getSimpleName();

        final String viewClassName = EjbRemote.class.getName();

        String url = "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;
        //ejb:rb/remot//Ejb!Server.EjbRemote

        System.out.println(url);
        EjbRemote envio= (EjbRemote) context.lookup(url);
        envio.datosRegistro(datos);**
    }

可能错误出现在不同的名称中,该名称为空,谢谢您的帮助。

我在wildfly 10.1上遇到了相同的问题。 我解决了用/替换ejb:。就你而言:

 String url = "/" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;
远程上下文得到了:

Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
properties.put(Context.PROVIDER_URL, "http-remoting://" + host + ":" + port);
properties.put("jboss.naming.client.ejb.context", "true");
properties.put(Context.SECURITY_PRINCIPAL, "adminapp");
properties.put(Context.SECURITY_CREDENTIALS, "adminpwd");
资料来源:

希望能有帮助