web3j
web3j copied to clipboard
The filter cann't work at all after the geth client shutdown and restart ?
I encountered a problem about the filter. I created a Java Web project, registered a filter as follows:
web3j = Web3j.build(new HttpService());
web3j.pendingTransactionObservable().subscribe(tx -> {
// my logic here
});
The code worked fine.
But after I exit the geth client and restarted it, I found that above filter doesn't work at all, that is, my code in the subscribe could not be executed. The error log raised in my IDEA console as follows:
2018-03-21 09:12:34 [ERROR] o.w.p.c.f.Filter - Error sending request [pool-6-thread-2]
org.web3j.protocol.core.filters.FilterException: Invalid request: Unknown Error
at org.web3j.protocol.core.filters.Filter.throwException(Filter.java:154)
at org.web3j.protocol.core.filters.Filter.pollFilter(Filter.java:113)
at org.web3j.protocol.core.filters.Filter.lambda$run$18(Filter.java:75)
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)
The filter returned to normal only if I restarted my Web project. I don't want to restart my project because it is a server.
Who encountered this too and how to resolve it ? Thanks a lot.
This problem is already addressed in #359
@Daantie I see, many thanks.