'WARN org.web3j.protocol.core.filters.Filter.reinstallFilter(153) -The filter has not been found. Filter id:
Related Docs:
- Filters and Flowables http://docs.web3j.io/4.8.7/getting_started/pub_sub/
- Filters and Events http://docs.web3j.io/4.8.7/advanced/filters_and_events/
- Events https://docs.soliditylang.org/en/develop/contracts.html#events
I am trying to implement reading blockchain events using 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.");
}
}
and this init already fails,
with warning The filter has not been found as if something was missing or got lost:
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
Solution 1:[1]
This seems to be connectivity issue, once ensured that it can connect to blockchain node, the issue is gone.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Paul Verest |
