【问题标题】:WARN org.web3j.protocol.core.filters.Filter.reinstallFilter(153) -The filter has not been found. Filter id:WARN org.web3j.protocol.core.filters.Filter.reinstallFilter(153) - 未找到过滤器。过滤器编号:
【发布时间】:2021-08-26 06:57:13
【问题描述】:

相关文档:

我正在尝试使用 web3j (v4.8.7) 实现读取区块链事件

/*
 */
@Slf4j
@Component
public class ContractEventSubscriber {

    @Autowired
    Web3j web3j;


    @PostConstruct
    public void init() {
        log.info("Initializing...");
        web3j.blockFlowable(false).subscribe(
                block -> {
                    log.info("New block {}", block);
                }, error -> {
                    log.error("Event error: {}", error, error); //!
                });

        log.info("Initialized.");
    }

}

这个初始化已经失败了, 带有警告The filter has not been found 好像丢失或丢失了什么:

2021-08-26 14:40:23,723 [main] INFO  com.xcompany.web3j.ContractEventSubscriber.init(43) -Initializing...
2021-08-26 14:40:25,134 [pool-2-thread-1] WARN  org.web3j.protocol.core.filters.Filter.reinstallFilter(153) -The filter has not been found. Filter id: 330683721788227458774458119455366581270
Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter.
2021-08-26 14:40:25,420 [pool-2-thread-1] ERROR org.web3j.protocol.core.filters.Filter.lambda$run$0(97) -Error sending request
org.web3j.protocol.core.filters.FilterException: Error sending request
    at org.web3j.protocol.core.filters.Filter.throwException(Filter.java:194)
    at org.web3j.protocol.core.filters.Filter.run(Filter.java:104)
    at org.web3j.protocol.core.filters.Filter.reinstallFilter(Filter.java:155)
    at org.web3j.protocol.core.filters.Filter.pollFilter(Filter.java:137)
    at org.web3j.protocol.core.filters.Filter.lambda$run$0(Filter.java:92)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.InterruptedIOException: interrupted
    at okio.Timeout.throwIfReached(Timeout.kt:98)
    at okio.OutputStreamSink.write(Okio.kt:53)
    at okio.AsyncTimeout$sink$1.write(AsyncTimeout.kt:103)
    at okio.RealBufferedSink.flush(RealBufferedSink.kt:247)
    at okhttp3.internal.http1.Http1ExchangeCodec.finishRequest(Http1ExchangeCodec.kt:158)
    at okhttp3.internal.connection.Exchange.finishRequest(Exchange.kt:90)
    at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:76)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:37)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:84)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:71)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
    at com.huobi.pool.hedging.strategy.contract.config.RetryInterceptor.intercept(RetryInterceptor.java:25)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:194)
    at okhttp3.RealCall.execute(RealCall.kt:67)
    at org.web3j.protocol.http.HttpService.performIO(HttpService.java:165)
    at org.web3j.protocol.Service.send(Service.java:48)
    at org.web3j.protocol.core.Request.send(Request.java:87)
    at org.web3j.protocol.core.filters.BlockFilter.sendRequest(BlockFilter.java:34)
    at org.web3j.protocol.core.filters.Filter.run(Filter.java:59)
    ... 10 common frames omitted

【问题讨论】:

    标签: java ethereum web3-java


    【解决方案1】:

    这似乎是连接问题,一旦确保它可以连接到区块链节点,问题就消失了。

    【讨论】:

      猜你喜欢
      • 2022-01-06
      • 2016-11-21
      • 2012-10-15
      • 2014-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-08
      相关资源
      最近更新 更多