java - Wildfly10 - EJB 远程客户端 - 无响应

标签 java wildfly wildfly-10

我目前正在将我们的代码从 Jboss7 迁移到 Wildfly10。
服务器本身启动完全正常。 当尝试将我们的客户端与正在工作的新 wildfly10 服务器连接以进行 ejb 远程调用时,它根本无法工作。
我唯一能处理的是以下错误:

org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector setupEJBReceivers WARN: Could not register a EJB receiver for connection to remote-ip:8080 java.lang.RuntimeException: Operation failed with status WAITING at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:94) at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:80) at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51) at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:161) at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:118) at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:47) at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:281) at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:291) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:178) at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146) at com.sun.proxy.$Proxy2.connect(Unknown Source) at de.cinovo.rcp.test.RemoteEJBClient.invokeStatelessBean(RemoteEJBClient.java:39) at de.cinovo.rcp.test.RemoteEJBClient.main(RemoteEJBClient.java:25)

Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:de.cinovo.tcc.server-ear, moduleName:de-cinovo-tcc-server-ejb-6.0-SNAPSHOT, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@180542f at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:798) at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:128) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186) at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:255) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:200) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:183) at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146) at com.sun.proxy.$Proxy2.connect(Unknown Source) at de.cinovo.rcp.test.RemoteEJBClient.invokeStatelessBean(RemoteEJBClient.java:39) at de.cinovo.rcp.test.RemoteEJBClient.main(RemoteEJBClient.java:25)

尝试连接时,服务器日志中没有显示任何错误、警告、信息或任何内容。
在调用尝试期间观察时,通过 tcp 在端口上有一些操作。

真正有趣的部分是:
如果我在我的本地机器上使用相同的 wildfly 设置,则完全相同的连接方法有效,但仅当使用 localhost 作为 jboss-ejb-client.properties 中的 ip 地址时>。 一旦我将 ip 更改为 127.0.0.1 或我当前的 ip 地址,它将失败并出现与上述相同的错误。

相关信息:

  • Wildfly 将响应端口 8080 上的 telnet
  • Wildfly 是唯一监听 8080 的服务
  • 我的/etc/hosts 配置正确
  • 更改端口并不能解决问题
  • Wildfly 版本 10.1.0.Final
  • 我的standalone.xml

    中的相关部分
    <subsystem xmlns="urn:jboss:domain:remoting:3.0">
        <endpoint/>
        <http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
    </subsystem>
    [...]
    <subsystem xmlns="urn:jboss:domain:undertow:3.1">
        <buffer-cache name="default"/>
        <server name="default-server">
            <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
        [...]
    </subsystem>
    [...]
    <interfaces>
        <interface name="public">
            <any-address/>
        </interface>
    </interfaces>
    [...]
    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="http" interface="public" port="${jboss.http.port:8080}"/>
        <socket-binding name="https" port="${jboss.https.port:8443}"/>
    [...]
    </socket-binding-group>
    
  • 我的 jboss-ejb-client.properties

    endpoint.name=client-endpoint
    remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
    remote.connections=default
    remote.connection.default.host=<host-ip>
    remote.connection.default.port=8080
    remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
    remote.connection.default.username=<usernmae>
    remote.connection.default.password=<pswd>
    
  • 客户端代码

    final Hashtable jndiProperties = new Hashtable();
    jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
    final Context context = new InitialContext(jndiProperties);
    [...]
    return context.lookup("ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName);
    
  • EJB-Client-Maven-Dependency :

    <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-ejb-client-bom</artifactId>
        <version>10.1.0.Final</version>
        <type>pom</type>
    </dependency>
    

有人遇到同样的问题并且知道我做错了什么吗?

最佳答案

看起来 socket.binding-group 中的 standalone.xml 中缺少定义:

<outbound-socket-binding name="remote-ejb">
  <local-destination socket-binding-ref="http"/>
</outbound-socket-binding>

关于java - Wildfly10 - EJB 远程客户端 - 无响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43120825/

相关文章:

java - 用于 Websphere MQ 连接定义的 Wildfly 资源适配器

java - JAVA EE WildFly 项目启动时执行的类是什么?

postgresql - 如何在 Wildfly 10.1.0 上正确使用数据源?

performance - 使用 Jmeter 的 JBOSS wildfly 10 性能调优

java - 迭代集合并删除满足特定条件的项目的快速方法

java - 有没有Phrase head finder?

java - 如何使用unboundid SDK减少AD主机不可达时间的超时异常?

java - org.wildfly.extension.undertow JBAS010409 : Unbound data source

wildfly - Wildfly 10 中的内容类型问题

java调用mysql c3p0函数