简体   繁体   English

Wildfly 8.1.0进行EJB远程调用时出错

[英]Error in wildfly 8.1.0 making a EJB remote invocation

i have made an application in wildly 8.1.0 that uses a EJB remote session bean, but when i do the lookup i get this error: 我已经在wildly 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

I have configured the application.xml file and module.xml file to use the "rb" application name and "remot" module name. 我已将application.xml文件和module.xml文件配置为使用"rb"应用程序名称和"remot"模块名称。 When I start the server, It starts without errors, and deploys the EJB , so i think the problem is in the client, this is the code of the client: 当我启动服务器时,它启动没有错误,并部署了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);**
    }

Maybe the error is in the distinct name, that is empty, thanks for your help. 可能是错误的名称是唯一的,为空,谢谢您的帮助。

I was experiencing the same issue on wildfly 10.1. 我在Wildfly 10.1上遇到了同样的问题。 I solved replacing "ejb:" with "/". 我解决了用“ /”替换“ ejb:”的问题。 In your case: 在您的情况下:

 String url = "/" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;

And the remote context got with: 远程上下文具有:

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");

SOURCE: https://blog.akquinet.de/2014/09/26/jboss-eap-wildfly-three-ways-to-invoke-remote-ejbs/ 消息来源: https : //blog.akquinet.de/2014/09/26/jboss-eap-wildfly-three-ways-to-invoke-remote-ejbs/

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM