2015-05-06 35 views
1

我已经取得了wildly 8.1.0一个使用EJB远程会话bean的应用程序,但是当我做了查找我得到这个错误:错误wildfly 8.1.0制作EJB远程调用

EJBCLIENT000025: No EJB receiver available for handling [appName:rb, moduleName:remot, distinctName:] combination for invocation context [email protected] 

我已经配置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);** 
    } 

也许错误是在不同的名称,这是空的,谢谢你的帮助。

回答

0

我在野蝇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/

希望它能帮助。