The first connection is established properly using the following commands:
stratioStreamingAPI = StratioStreamingAPIFactory.create().initializeWithServerConfig(kafkaServer, kafkaPort, zooKeeperServer, zooKeeperPort);
Then, we close the connection and create a new connection but an exception is thrown.
stratioStreamingAPI.close();
StratioStreamingAPIFactory.create().initializeWithServerConfig(kafkaServer, kafkaPort,
zooKeeperServer, zooKeeperPort);
The log when creating the second connection before the StratioEngineConnectionException:
INFO StratioStreamingAPI$ - Establishing connection with the engine...
WARN ZookeeperConsumer - Unable to check zNode: /stratio/streaming/engine
WARN StratioStreamingAPI$ - Ephemeral node does not exist
The entire log:
INFO StratioStreamingAPI$ - Establishing connection with the engine...
INFO CuratorFrameworkImpl - Starting
DEBUG CuratorZookeeperClient - Starting
DEBUG ConnectionState - Starting
DEBUG ConnectionState - reset
INFO ZooKeeper - Client environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT
INFO ZooKeeper - Client environment:host.name=localhost
INFO ZooKeeper - Client environment:java.version=1.8.0_25
INFO ZooKeeper - Client environment:java.vendor=Oracle Corporation
INFO ZooKeeper - Client environment:java.home=/usr/lib/jvm/java-8-oracle/jre
INFO ZooKeeper - Client environment:java.class.path=/home/david/Escritorio/proyectos/stratio-connector-streaming/connector-streaming-ftest/target/test-classes:/home/david/Escritorio/proyectos/stratio-connector-streaming/connector-streaming-ftest/target/classes:/home/david/.m2/repository/com/stratio/crossdata/crossdata-connector/0.1.1/crossdata-connector-0.1.1.jar:/home/david/.m2/repository/com/stratio/crossdata/crossdata-core/0.1.1/crossdata-core-0.1.1.jar:/home/david/.m2/repository/org/antlr/antlr/3.5.2/antlr-3.5.2.jar:/home/david/.m2/repository/org/antlr/ST4/4.0.8/ST4-4.0.8.jar:/home/david/.m2/repository/org/antlr/antlr-runtime/3.5.2/antlr-runtime-3.5.2.jar:/home/david/.m2/repository/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar:/home/david/.m2/repository/org/apache/commons/commons-lang3/3.2.1/commons-lang3-3.2.1.jar:/home/david/.m2/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar:/home/david/.m2/repository/org/infinispan/infinispan-core/6.0.2.Final/infinispan-core-6.0.2.Final.jar:/home/david/.m2/repository/org/infinispan/infinispan-commons/6.0.2.Final/infinispan-commons-6.0.2.Final.jar:/home/david/.m2/repository/org/jboss/spec/javax/transaction/jboss-transaction-api_1.1_spec/1.0.1.Final/jboss-transaction-api_1.1_spec-1.0.1.Final.jar:/home/david/.m2/repository/org/jboss/marshalling/jboss-marshalling-river/1.4.4.Final/jboss-marshalling-river-1.4.4.Final.jar:/home/david/.m2/repository/org/jboss/marshalling/jboss-marshalling/1.4.4.Final/jboss-marshalling-1.4.4.Final.jar:/home/david/.m2/repository/org/jboss/logging/jboss-logging/3.1.2.GA/jboss-logging-3.1.2.GA.jar:/home/david/.m2/repository/org/jgroups/jgroups/3.4.5.Final/jgroups-3.4.5.Final.jar:/home/david/.m2/repository/org/xerial/snappy/snappy-java/1.1.1-M1/snappy-java-1.1.1-M1.jar:/home/david/.m2/repository/net/jpountz/lz4/lz4/1.2.0/lz4-1.2.0.jar:/home/david/.m2/repository/jline/jline/2.11/jline-2.11.jar:/home/david/.m2/repository/joda-time/joda-time/2.3/joda-time-2.3.jar:/home/david/.m2/repository/com/stratio/crossdata/crossdata-common/0.1.1/crossdata-common-0.1.1.jar:/home/david/.m2/repository/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar:/home/david/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar:/home/david/.m2/repository/com/codahale/metrics/metrics-core/3.0.1/metrics-core-3.0.1.jar:/home/david/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.2/jackson-core-asl-1.9.2.jar:/home/david/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.2/jackson-mapper-asl-1.9.2.jar:/home/david/.m2/repository/org/scala-lang/scala-compiler/2.10.4/scala-compiler-2.10.4.jar:/home/david/.m2/repository/com/typesafe/akka/akka-actor_2.10/2.2.4/akka-actor_2.10-2.2.4.jar:/home/david/.m2/repository/com/typesafe/akka/akka-contrib_2.10/2.2.4/akka-contrib_2.10-2.2.4.jar:/home/david/.m2/repository/com/typesafe/akka/akka-remote_2.10/2.2.4/akka-remote_2.10-2.2.4.jar:/home/david/.m2/repository/io/netty/netty/3.6.6.Final/netty-3.6.6.Final.jar:/home/david/.m2/repository/com/google/protobuf/protobuf-java/2.4.1/protobuf-java-2.4.1.jar:/home/david/.m2/repository/org/uncommons/maths/uncommons-maths/1.2.2a/uncommons-maths-1.2.2a.jar:/home/david/.m2/repository/com/typesafe/akka/akka-cluster_2.10/2.2.4/akka-cluster_2.10-2.2.4.jar:/home/david/.m2/repository/net/sandrogrzicic/scalabuff-runtime_2.10/1.2.0/scalabuff-runtime_2.10-1.2.0.jar:/home/david/.m2/repository/com/typesafe/akka/akka-testkit_2.10/2.2.4/akka-testkit_2.10-2.2.4.jar:/home/david/.m2/repository/com/typesafe/config/1.2.0/config-1.2.0.jar:/home/david/.m2/repository/org/scala-lang/scala-reflect/2.10.4/scala-reflect-2.10.4.jar:/home/david/Escritorio/proyectos/stratio-connector-streaming/connector-streaming-core/target/classes:/home/david/.m2/repository/com/stratio/streaming/streaming-api/0.6.0/streaming-api-0.6.0.jar:/home/david/.m2/repository/org/apache/kafka/kafka_2.10/0.8.1.1/kafka_2.10-0.8.1.1.jar:/home/david/.m2/repository/com/yammer/metrics/metrics-core/2.2.0/metrics-core-2.2.0.jar:/home/david/.m2/repository/net/sf/jopt-simple/jopt-simple/3.2/jopt-simple-3.2.jar:/home/david/.m2/repository/com/101tec/zkclient/0.3/zkclient-0.3.jar:/home/david/.m2/repository/org/apache/curator/curator-framework/2.4.1/curator-framework-2.4.1.jar:/home/david/.m2/repository/org/apache/curator/curator-client/2.4.1/curator-client-2.4.1.jar:/home/david/.m2/repository/org/apache/zookeeper/zookeeper/3.4.5/zookeeper-3.4.5.jar:/home/david/.m2/repository/com/stratio/streaming/streaming-commons/0.6.0/streaming-commons-0.6.0.jar:/home/david/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar:/home/david/.m2/repository/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.jar:/home/david/.m2/repository/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar:/home/david/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar:/home/david/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar:/home/david/.m2/repository/com/netflix/curator/curator-test/1.3.3/curator-test-1.3.3.jar:/home/david/.m2/repository/org/javassist/javassist/3.15.0-GA/javassist-3.15.0-GA.jar:/home/david/.m2/repository/org/apache/commons/commons-math/2.2/commons-math-2.2.jar:/home/david/Escritorio/proyectos/stratio-connector-commons/connector-commons-core/target/classes:/home/david/.m2/repository/org/slf4j/slf4j-log4j12/1.7.7/slf4j-log4j12-1.7.7.jar:/home/david/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/home/david/Escritorio/proyectos/stratio-connector-commons/connector-commons-ftest/target/test-classes:/home/david/.m2/repository/junit/junit/4.11/junit-4.11.jar:/home/david/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/home/david/.m2/repository/org/powermock/powermock-api-mockito/1.5.5/powermock-api-mockito-1.5.5.jar:/home/david/.m2/repository/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5.jar:/home/david/.m2/repository/org/powermock/powermock-api-support/1.5.5/powermock-api-support-1.5.5.jar:/home/david/.m2/repository/org/powermock/powermock-core/1.5.5/powermock-core-1.5.5.jar:/home/david/.m2/repository/org/powermock/powermock-reflect/1.5.5/powermock-reflect-1.5.5.jar:/home/david/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar:/home/david/.m2/repository/org/powermock/powermock-module-junit4/1.5.5/powermock-module-junit4-1.5.5.jar:/home/david/.m2/repository/org/powermock/powermock-module-junit4-common/1.5.5/powermock-module-junit4-common-1.5.5.jar:/home/david/Escritorio/eclipse/configuration/org.eclipse.osgi/202/0/.cp/:/home/david/Escritorio/eclipse/configuration/org.eclipse.osgi/201/0/.cp/
INFO ZooKeeper - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
INFO ZooKeeper - Client environment:java.io.tmpdir=/tmp
INFO ZooKeeper - Client environment:java.compiler=
INFO ZooKeeper - Client environment:os.name=Linux
INFO ZooKeeper - Client environment:os.arch=amd64
INFO ZooKeeper - Client environment:os.version=3.13.0-39-generic
INFO ZooKeeper - Client environment:user.name=david
INFO ZooKeeper - Client environment:user.home=/home/david
INFO ZooKeeper - Client environment:user.dir=/home/david/Escritorio/proyectos/stratio-connector-streaming/connector-streaming-ftest
INFO ZooKeeper - Initiating client connection, connectString=127.0.0.1:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@5ccddd20
DEBUG ClientCnxn - zookeeper.disableAutoWatchReset is false
INFO ClientCnxn - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
INFO ClientCnxn - Socket connection established to localhost/127.0.0.1:2181, initiating session
DEBUG ClientCnxn - Session establishment request sent on localhost/127.0.0.1:2181
WARN ClientCnxnSocket - Connected to an old server; r-o mode will be unavailable
INFO ClientCnxn - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x14a3340e8d7001a, negotiated timeout = 60000
INFO ConnectionStateManager - State change: CONNECTED
WARN ConnectionStateManager - There are no ConnectionStateListeners registered.
DEBUG ClientCnxn - Reading reply sessionid:0x14a3340e8d7001a, packet:: clientPath:null serverPath:null finished:false header:: 1,3 replyHeader:: 1,122,0 request:: '/stratio/streaming/engine,F response:: s{23,23,1418199160796,1418199160796,0,0,0,92943096191844353,13,0,23}
DEBUG ClientCnxn - Reading reply sessionid:0x14a3340e8d7001a, packet:: clientPath:null serverPath:null finished:false header:: 2,3 replyHeader:: 2,122,0 request:: '/stratio/streaming/engine,T response:: s{23,23,1418199160796,1418199160796,0,0,0,92943096191844353,13,0,23}
INFO StratioStreamingAPI$ - Initializing kafka topic...
DEBUG ZkConnection - Creating new ZookKeeper instance to connect to 127.0.0.1:2181.
INFO ZkEventThread - Starting ZkClient event thread.
INFO ZooKeeper - Initiating client connection, connectString=127.0.0.1:2181 sessionTimeout=10000 watcher=org.I0Itec.zkclient.ZkClient@16ec5519
INFO ClientCnxn - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
INFO ClientCnxn - Socket connection established to localhost/127.0.0.1:2181, initiating session
DEBUG ClientCnxn - Session establishment request sent on localhost/127.0.0.1:2181
DEBUG ZkClient - Awaiting connection to Zookeeper server
DEBUG ZkClient - Waiting for keeper state SyncConnected
WARN ClientCnxnSocket - Connected to an old server; r-o mode will be unavailable
INFO ClientCnxn - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x14a3340e8d7001b, negotiated timeout = 10000
DEBUG ZkClient - Received event: WatchedEvent state:SyncConnected type:None path:null
INFO ZkClient - zookeeper state changed (SyncConnected)
DEBUG ZkClient - Leaving process event
DEBUG ZkClient - State is SyncConnected
DEBUG ClientCnxn - Reading reply sessionid:0x14a3340e8d7001b, packet:: clientPath:null serverPath:null finished:false header:: 1,3 replyHeader:: 1,123,0 request:: '/brokers/topics/stratio_streaming_requests,F response:: s{47,47,1418199189973,1418199189973,0,1,0,0,36,1,54}
INFO KafkaTopicService - Topic stratio_streaming_requests already exists
DEBUG ClientCnxn - Reading reply sessionid:0x14a3340e8d7001b, packet:: clientPath:null serverPath:null finished:false header:: 2,3 replyHeader:: 2,123,0 request:: '/brokers/topics/stratio_streaming_data,F response:: s{51,51,1418199190082,1418199190082,0,1,0,0,36,1,69}
INFO KafkaTopicService - Topic stratio_streaming_data already exists
DEBUG ClientCnxn - Got ping response for sessionid: 0x14a3340e8d7001b after 12ms
INFO VerifiableProperties - Verifying properties
INFO VerifiableProperties - Property metadata.broker.list is overridden to 127.0.0.1:9092
INFO VerifiableProperties - Property serializer.class is overridden to kafka.serializer.StringEncoder
INFO Producer - Shutting down producer
INFO ProducerPool - Closing all sync producers
INFO VerifiableProperties - Verifying properties
INFO VerifiableProperties - Property metadata.broker.list is overridden to 127.0.0.1:9092
INFO VerifiableProperties - Property serializer.class is overridden to kafka.serializer.StringEncoder
INFO Producer - Shutting down producer
INFO ProducerPool - Closing all sync producers
DEBUG ZkClient - Closing ZkClient...
INFO ZkEventThread - Terminate ZkClient event thread.
DEBUG ZkConnection - Closing ZooKeeper connected to 127.0.0.1:2181
DEBUG ZooKeeper - Closing session: 0x14a3340e8d7001b
DEBUG ClientCnxn - Closing client for session: 0x14a3340e8d7001b
DEBUG ClientCnxn - Reading reply sessionid:0x14a3340e8d7001b, packet:: clientPath:null serverPath:null finished:false header:: 3,-11 replyHeader:: 3,124,0 request:: null response:: null
DEBUG ClientCnxn - Disconnecting client for session: 0x14a3340e8d7001b
INFO ZooKeeper - Session: 0x14a3340e8d7001b closed
DEBUG ClientCnxn - An exception was thrown while closing send thread for session 0x14a3340e8d7001b : Unable to read additional data from server sessionid 0x14a3340e8d7001b, likely server has closed socket
DEBUG ZkClient - Closing ZkClient...done
INFO ClientCnxn - EventThread shut down
DEBUG CuratorFrameworkImpl - Closing
ERROR CuratorFrameworkImpl - Exception while sending Closing event
scala.MatchError: CLOSING (of class org.apache.curator.framework.api.CuratorEventType)
at com.stratio.streaming.api.StratioStreamingAPI$$anon$1.eventReceived(StratioStreamingAPI.scala:338)
at org.apache.curator.framework.imps.CuratorFrameworkImpl$4.apply(CuratorFrameworkImpl.java:272)
at org.apache.curator.framework.imps.CuratorFrameworkImpl$4.apply(CuratorFrameworkImpl.java:265)
at org.apache.curator.framework.listen.ListenerContainer$1.run(ListenerContainer.java:92)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)
at org.apache.curator.framework.listen.ListenerContainer.forEach(ListenerContainer.java:83)
at org.apache.curator.framework.imps.CuratorFrameworkImpl.close(CuratorFrameworkImpl.java:262)
at com.stratio.streaming.api.StratioStreamingAPI.close(StratioStreamingAPI.scala:276)
at com.stratio.connector.streaming.ftest.thread.ThreadConnectionFT.apiStreamingTest(ThreadConnectionFT.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
DEBUG CuratorZookeeperClient - Closing
DEBUG ConnectionState - Closing
DEBUG ZooKeeper - Closing session: 0x14a3340e8d7001a
DEBUG ClientCnxn - Closing client for session: 0x14a3340e8d7001a
DEBUG ClientCnxn - Reading reply sessionid:0x14a3340e8d7001a, packet:: clientPath:null serverPath:null finished:false header:: 3,-11 replyHeader:: 3,125,0 request:: null response:: null
DEBUG ClientCnxn - An exception was thrown while closing send thread for session 0x14a3340e8d7001a : Unable to read additional data from server sessionid 0x14a3340e8d7001a, likely server has closed socket
DEBUG ClientCnxn - Disconnecting client for session: 0x14a3340e8d7001a
INFO ZooKeeper - Session: 0x14a3340e8d7001a closed
INFO ClientCnxn - EventThread shut down
INFO StratioStreamingAPI$ - Establishing connection with the engine...
WARN ZookeeperConsumer - Unable to check zNode: /stratio/streaming/engine
WARN StratioStreamingAPI$ - Ephemeral node does not exist