xml - Akka 远程 `system.shutdown()` 导致 EndpointDisassociatedException?

标签 xml akka

我有简单的客户端和服务器设置,在发送所有异步请求后的某个时刻,在服务器确认它后,客户端调用 system.shutdown()。这导致服务器 akka.remote.EndpointDisassociatedException 和一堆日志错误,如下所示。我对日志中的一堆错误不满意,所以我想知道是什么导致了这一切。结果整个系统运行成功,错误仅在客户端关闭时显示。

28.Jun.2013-10:13:01 ERROR EndpointWriter - AssociationError [akka.tcp://MapReduceApp@127.0.0.1:2552] <- [akka.tcp://WordCountClientApp@192.168.224.65:2552]: Error [Disassociated] [
akka.remote.EndpointDisassociatedException: Disassociated
]
28.Jun.2013-10:13:01 DEBUG EndpointWriter - Disassociated [akka.tcp://MapReduceApp@127.0.0.1:2552] <- [akka.tcp://WordCountClientApp@192.168.224.65:2552]
28.Jun.2013-10:13:01 ERROR EndpointWriter - AssociationError [akka.tcp://MapReduceApp@127.0.0.1:2552] -> [akka.tcp://WordCountClientApp@192.168.224.65:2552]: Error [Association failed with [akka.tcp://WordCountClientApp@192.168.224.65:2552]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://WordCountClientApp@192.168.224.65:2552]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$1$$anon$2: Connection refused: /192.168.224.65:2552
]
28.Jun.2013-10:13:01 DEBUG EndpointWriter - Disassociated [akka.tcp://MapReduceApp@127.0.0.1:2552] -> [akka.tcp://WordCountClientApp@192.168.224.65:2552]
28.Jun.2013-10:13:01 ERROR EndpointWriter - AssociationError [akka.tcp://MapReduceApp@127.0.0.1:2552] -> [akka.tcp://WordCountClientApp@192.168.224.65:2552]: Error [Association failed with [akka.tcp://WordCountClientApp@192.168.224.65:2552]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://WordCountClientApp@192.168.224.65:2552]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$1$$anon$2: Connection refused: /192.168.224.65:2552
]
28.Jun.2013-10:13:01 DEBUG EndpointWriter - Disassociated [akka.tcp://MapReduceApp@127.0.0.1:2552] -> [akka.tcp://WordCountClientApp@192.168.224.65:2552]
28.Jun.2013-10:13:01 ERROR EndpointWriter - AssociationError [akka.tcp://MapReduceApp@127.0.0.1:2552] -> [akka.tcp://WordCountClientApp@192.168.224.65:2552]: Error [Association failed with [akka.tcp://WordCountClientApp@192.168.224.65:2552]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://WordCountClientApp@192.168.224.65:2552]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$1$$anon$2: Connection refused: /192.168.224.65:2552
]
28.Jun.2013-10:13:01 DEBUG EndpointWriter - Disassociated [akka.tcp://MapReduceApp@127.0.0.1:2552] -> [akka.tcp://WordCountClientApp@192.168.224.65:2552]

更新:我使用的是 Akka 版本 2.2.0-RC1,Scala 版本是 2.10.0,但它也适用于 Scala 版本 2.10.1。我使用 Maven,软件版本为:

<properties>
    <scala.version>2.10.0</scala.version>
    <akka.version>2.2.0-RC1</akka.version>
    <scalatest.version>2.0.M6-SNAP16</scalatest.version>
    <log4j.version>1.2.17</log4j.version>
    <slf4j.version>1.7.5</slf4j.version>
    <commons-lang3.version>3.1</commons-lang3.version>
    <guava.version>14.0.1</guava.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

以及对应的依赖:

<dependencies>
    <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>${scala.version}</version>
    </dependency>
    <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-actor_2.10</artifactId>
        <version>${akka.version}</version>
        <exclusions>
                <exclusion>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-remote_2.10</artifactId>
        <version>${akka.version}</version>
        <exclusions>
                <exclusion>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-kernel_2.10</artifactId>
        <version>${akka.version}</version>
        <exclusions>
                <exclusion>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-agent_2.10</artifactId>
        <version>${akka.version}</version>
        <exclusions>
                <exclusion>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-zeromq_2.10</artifactId>
        <version>${akka.version}</version>
        <exclusions>
                <exclusion>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-slf4j_2.10</artifactId>
        <version>${akka.version}</version>
        <exclusions>
                <exclusion>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3.version}</version>
    </dependency>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
    </dependency>
    <!-- Test dependencies -->
    <dependency>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest_2.10</artifactId>
        <version>${scalatest.version}</version>
        <scope>test</scope>
    </dependency>
</dependencies>

最佳答案

您可以使用配置属性禁用此日志记录: akka.remote.log-remote-lifecycle-events=off

关于xml - Akka 远程 `system.shutdown()` 导致 EndpointDisassociatedException?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17360303/

相关文章:

scala - 为什么在这种情况下不能将函数名称作为参数传递?

c# - 调用带有 namespace 前缀的 SOAP 方法

java - XMLStreamReader 和 XMLEventReader 有什么区别?

xml - XSLT - 将 XML 转换为不同的 XML

java - 显示启动画面直到应用加载完成

scala - 你如何处理 Akka Flow 中的 future ?

c# - 将 XML 提要读入 XElement

scala - 禁用 Akka ActorSystem 的默认日志记录

scala - 如何使用scala akka流检测重复行

scala - 如何从 Future[Iterator] 创建源?