簡體   English   中英

Wildfly 8.1.0進行EJB遠程調用時出錯

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

我已經在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

我已將application.xml文件和module.xml文件配置為使用"rb"應用程序名稱和"remot"模塊名稱。 當我啟動服務器時,它啟動沒有錯誤,並部署了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");

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

希望能幫助到你。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM