我在2周前从jenkins下载了wso2 cep 4.0.0-SNAPSHOT。
当我从cep配置cassandra输出发布者时,我将其绑定到事件流。当我测试事件流时,调用cassandra输出发布者并且我有一个例外。在整个日志之上,例外情况为:
log4j: reset attribute= "false".
log4j: Threshold ="null".
log4j: Level value for root is [DEBUG].
log4j: root level set to DEBUG
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %-5p [%c{1}] %m%n].
log4j: Adding appender named [myAppender] to category [root].
17:12:16,449 INFO [CassandraHostRetryService] Downed Host Retry service started with queue size -1 and retry delay 10s
17:12:16,517 INFO [JmxMonitor] Registering JMX me.prettyprint.cassandra.service_EventPublisher_risultato_cassandra:ServiceType=hector,MonitorType=hector
17:12:16,543 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,548 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,549 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,550 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,551 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,552 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,553 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,554 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,558 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,563 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,569 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,576 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,579 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,584 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,589 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,591 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,592 DEBUG [ConcurrentHClientPool] Concurrent Host pool started with 16 active clients; max: 50 exhausted wait: 0
17:12:16,641 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-1>
17:12:16,643 ERROR [HConnectionManager] MARK HOST AS DOWN TRIGGERED for host localhost(127.0.0.1):9042
17:12:16,645 ERROR [HConnectionManager] Pool state on shutdown: <ConcurrentCassandraClientPoolByHost>:{localhost(127.0.0.1):9042}; IsActive?: true; Active: 1; Blocked: 0; Idle: 15; NumBeforeExhausted: 49
17:12:16,646 INFO [ConcurrentHClientPool] Shutdown triggered on <ConcurrentCassandraClientPoolByHost>:{localhost(127.0.0.1):9042}
17:12:16,647 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-5>
17:12:16,650 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-15>
17:12:16,650 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-4>
17:12:16,652 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-11>
17:12:16,653 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-12>
17:12:16,655 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-14>
17:12:16,655 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-7>
17:12:16,656 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-13>
17:12:16,658 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-9>
17:12:16,659 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-6>
17:12:16,659 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-16>
17:12:16,661 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-2>
17:12:16,663 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-10>
17:12:16,664 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-3>
17:12:16,667 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-8>
17:12:16,669 INFO [ConcurrentHClientPool] Shutdown complete on <ConcurrentCassandraClientPoolByHost>:{localhost(127.0.0.1):9042}
17:12:16,669 INFO [CassandraHostRetryService] Host detected as down was added to retry queue: localhost(127.0.0.1):9042
17:12:16,670 DEBUG [HThriftClient] Creating a new thrift connection to localhost(127.0.0.1):9042
17:12:16,670 WARN [HConnectionManager] Could not fullfill request on this host CassandraClient<localhost:9042-1>
17:12:16,671 WARN [HConnectionManager] Exception:
me.prettyprint.hector.api.exceptions.HectorTransportException: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
at me.prettyprint.cassandra.service.ExceptionsTranslatorImpl.translate(ExceptionsTranslatorImpl.java:39)
at me.prettyprint.cassandra.service.AbstractCluster$4.execute(AbstractCluster.java:195)
at me.prettyprint.cassandra.service.AbstractCluster$4.execute(AbstractCluster.java:185)
at me.prettyprint.cassandra.service.Operation.executeAndSetResult(Operation.java:104)
at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:253)
at me.prettyprint.cassandra.service.AbstractCluster.describeKeyspace(AbstractCluster.java:199)
at it.vige.test.cassandra.CassandraWso2Test.cassandraConnection(CassandraWso2Test.java:46)
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:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
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)
Caused by: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
at org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport.java:133)
at org.apache.thrift.transport.TFramedTransport.read(TFramedTransport.java:101)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378)
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297)
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:204)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
at org.apache.cassandra.thrift.Cassandra$Client.recv_describe_keyspace(Cassandra.java:1241)
at org.apache.cassandra.thrift.Cassandra$Client.describe_keyspace(Cassandra.java:1228)
at me.prettyprint.cassandra.service.AbstractCluster$4.execute(AbstractCluster.java:190)
... 28 more
17:12:16,675 ERROR [CassandraHostRetryService] Downed Host retry failed attempt to verify CassandraHost
org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
at org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport.java:133)
at org.apache.thrift.transport.TFramedTransport.read(TFramedTransport.java:101)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378)
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297)
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:204)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
at org.apache.cassandra.thrift.Cassandra$Client.recv_describe_cluster_name(Cassandra.java:1101)
at org.apache.cassandra.thrift.Cassandra$Client.describe_cluster_name(Cassandra.java:1089)
at me.prettyprint.cassandra.connection.CassandraHostRetryService.verifyConnection(CassandraHostRetryService.java:214)
at me.prettyprint.cassandra.connection.CassandraHostRetryService.access$100(CassandraHostRetryService.java:24)
at me.prettyprint.cassandra.connection.CassandraHostRetryService$1.run(CassandraHostRetryService.java:75)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
17:12:16,683 INFO [HConnectionManager] Client CassandraClient<localhost:9042-1> released to inactive or dead pool. Closing.
17:12:16,683 DEBUG [HThriftClient] Closing client CassandraClient<localhost:9042-1>
17:12:16,684 ERROR [CassandraWso2Test] Test fallito
me.prettyprint.hector.api.exceptions.HectorException: All host pools marked down. Retry burden pushed out to client.
at me.prettyprint.cassandra.connection.HConnectionManager.getClientFromLBPolicy(HConnectionManager.java:390)
at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:244)
at me.prettyprint.cassandra.service.AbstractCluster.describeKeyspace(AbstractCluster.java:199)
at it.vige.test.cassandra.CassandraWso2Test.cassandraConnection(CassandraWso2Test.java:46)
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:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
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)
以上我在conf / cassandra.yaml中配置cassandra 2.2.1:
#cluster_name: 'Test Cluster'
cluster_name: 'EventPublisher_risultato_cassandra'
以及我如何开始它:
.../bin/cassandra
以上如何在cep中配置输出发布者:
<?xml version="1.0" encoding="UTF-8"?>
<eventPublisher name="risultato_cassandra" statistics="disable"
trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
<from streamName="gpsspace_entrati" version="1.0.0"/>
<mapping customMapping="disable" type="map"/>
<to eventAdapterType="cassandra">
<property name="key.space.name">seme</property>
<property name="port">9042</property>
<property name="hosts">localhost</property>
<property name="column.family.name">seme</property>
</to>
</eventPublisher>
这是一个使用以下方法模拟错误的测试代码:
<dependency>
<groupId>org.hectorclient.wso2</groupId>
<artifactId>hector-core</artifactId>
<version>1.1.4.wso2v1</version>
</dependency>
作为依赖
package it.vige.test.cassandra;
import static org.junit.Assert.fail;
import static org.slf4j.LoggerFactory.getLogger;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import org.slf4j.Logger;
import me.prettyprint.cassandra.service.CassandraHostConfigurator;
import me.prettyprint.hector.api.Cluster;
import me.prettyprint.hector.api.ddl.KeyspaceDefinition;
import me.prettyprint.hector.api.factory.HFactory;
public class CassandraWso2Test {
private Logger logger = getLogger(getClass());
@Test
public void cassandraConnection() {
try {
Cluster cluster;
// Connect to the cluster and keyspace "seme"
Map<String, String> staticProperties = new HashMap<String, String>();
staticProperties.put("key.space.name", "seme");
staticProperties.put("replication.factor", null);
staticProperties.put("port", "9042");
staticProperties.put("hosts", "localhost");
staticProperties.put("strategy.class", null);
staticProperties.put("user.name", null);
staticProperties.put("indexed.columns", null);
staticProperties.put("column.family.name", "seme");
CassandraHostConfigurator chc = new CassandraHostConfigurator();
chc.setHosts(staticProperties.get("hosts"));
if (staticProperties.get("port") != null) {
chc.setPort(Integer.parseInt(staticProperties.get("port")));
}
cluster = HFactory.createCluster("EventPublisher_risultato_cassandra", chc, null);
String keySpaceName = staticProperties.get("key.space.name");
KeyspaceDefinition existingKeyspaceDefinition = cluster.describeKeyspace(keySpaceName);
logger.info("existingKeyspaceDefinition = " + existingKeyspaceDefinition);
} catch (Exception ex) {
logger.error("Test fallito", ex);
fail();
}
}
}
答案 0 :(得分:0)
在cassandra中启用thrift来解决问题。
nodetool enablethrift
并将事件发布者配置为在9160端口上连接