JBossEJB应用程序停止接受连接

JBossEJB应用程序停止接受连接,jboss,ejb,Jboss,Ejb,我们正在运行一个web应用程序,该应用程序作为单个ear文件部署到JBoss 7.1.1,并且使用了许多ejb。我们遇到了一个问题,所有的东西都正常工作,但是应用程序每天有两次停止接受连接。发生这种情况时,服务器日志中将显示以下内容: 14:49:00,582 ERROR [org.jboss.remoting.remote.connection] (Remoting "step" read-1) JBREM000200: Remote connection failed: java.io.IO

我们正在运行一个web应用程序,该应用程序作为单个ear文件部署到JBoss 7.1.1,并且使用了许多ejb。我们遇到了一个问题,所有的东西都正常工作,但是应用程序每天有两次停止接受连接。发生这种情况时,服务器日志中将显示以下内容:

14:49:00,582 ERROR [org.jboss.remoting.remote.connection] (Remoting "step" read-1) JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of 1195986768
以下内容也出现在日志的上游:

14:33:29,042 INFO  [org.jboss.as.naming] (Remoting "step" task-3) JBAS011806: Channel end notification received, closing channel Channel ID 676ac4e7 (inbound) of Remoting connection 611812ed to null
14:33:50,071 ERROR [org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler] (EJB default - 10) Could not write method invocation result for method due to : org.jboss.remoting3.NotOpenException: Writes closed
at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:107) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]
at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:296) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.writeMethodInvocationResponse(MethodInvocationMessageHandler.java:330)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$500(MethodInvocationMessageHandler.java:64)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:226)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]
这是我们在尝试创建ejb连接时在客户端看到的异常

javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: Operation failed with status WAITING]
   at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)
   at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:121)
   at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
   at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
   at javax.naming.InitialContext.init(InitialContext.java:242)
   at javax.naming.InitialContext.<init>(InitialContext.java:216)
Caused by: java.lang.RuntimeException: Operation failed with status WAITING
       at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:89)
       at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:56)
       at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)
       at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)
       at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)
       ... 91 more
当我们打开JBoss管理控制台时,它表明应用程序仍然处于部署和启用状态

鉴于我们看到的错误,什么会导致应用程序停止接受连接

任何帮助都将不胜感激


提前谢谢

听起来4447端口不喜欢它所接收的。4447是正确的端口吗?也许应该是9999?您的xml文件中配置了什么?谢谢djb!是的,港口是4447。在几个小时内,一切都正常工作,并且由于出现上述错误消息而突然停止工作。今天,我们添加了一个补丁,修复了ejb连接没有关闭的问题,我们今天还没有看到这个问题。然而,我仍然有点怀疑这是否是问题的真正原因,因为我们在连接未关闭时看到的错误消息与jboss停止接受连接时看到的消息不同。上述问题是否是由针对端口的拒绝服务类型的攻击引起的4447? 或者在看到端口上的传入流量后,反病毒软件可能正在阻止该端口?我现在不在工作。。。明天我将挖掘xml配置。再次感谢!你可以运行wireshark来监控流量-有可能是某个随机反病毒或windows服务正在ping该端口吗?这也有道理。同时,您可能希望为连接构建一些自动重新连接逻辑。
public void initialize(String host, int port, String instance, String user, String password) {
        this.host = host;
        this.port = port;
        this.user = user;
        if (instance != null) {
            this.instance = instance;
        }
        final Properties jndiProperties = new Properties();
        String providerURL = "remote://" + host + ":" + port;
        jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, org.jboss.naming.remote.client.InitialContextFactory.class.getName());
        jndiProperties.put(Context.PROVIDER_URL, providerURL);
        jndiProperties.put("jboss.naming.client.ejb.context", true);
        jndiProperties.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
        jndiProperties.put(Context.SECURITY_PRINCIPAL, user);
        jndiProperties.put(Context.SECURITY_CREDENTIALS, password);
        try {
            context = new InitialContext(jndiProperties);
            logger.info("JNDI context initialized.");
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }