EJBCLIENT000025:当EJB调用发生在Spring引导上下文到Wildfly服务器上下文的调用中时,没有EJB接收器可用于处理错误

时间:2019-05-31 09:15:32

标签: java spring-boot ejb rmi

EJBCLIENT000025:当EJB调用发生在Wildfly服务器上下文的Spring Boot上下文中时,没有EJB接收器可用于处理错误。

我尝试配置JNDI属性,然后尝试在Spring Boot和其他非Spring Boot上下文之间建立连接。但是未建立连接,当我们尝试获取数据时会出现以下错误。

```@Bean  
public Context context() throws NamingException {
    Properties jndiProps = new Properties();
    jndiProps.put("java.naming.factory.initial", "org.jboss.naming.remote.client.InitialContextFactory");
    jndiProps.put("jboss.naming.client.ejb.context", true);
    jndiProps.put("java.naming.provider.url",  "http-remoting://192.168.101.136:8080");
    jndiProps.put( Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming" );
    jndiProps.put( Context.SECURITY_PRINCIPAL, "admin" );
    jndiProps.put( Context.SECURITY_CREDENTIALS, "jboss" );
    return new InitialContext(jndiProps);
}

@Bean
public Users userDelegate(Context context) throws NamingException {

    return (Users) context.lookup(this.getFullName(Users.class));
}

private String getFullName(Class classType) {
    String moduleName = "collab-ejb/";
    String beanName = classType.getSimpleName();
    String viewClassName = classType.getName();
    return "java:global/collab-ear/" +moduleName + beanName + "!" + viewClassName;
}

we are looking for RMI connection between springboot context and EJB context in wildfly server.Please suggest any way to get data with EJB call.

0 个答案:

没有答案