web3j icon indicating copy to clipboard operation
web3j copied to clipboard

The filter cann't work at all after the geth client shutdown and restart ?

Open IcyLemon opened this issue 8 years ago • 2 comments

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.

IcyLemon avatar Mar 21 '18 01:03 IcyLemon

This problem is already addressed in #359

Daantie avatar Mar 21 '18 21:03 Daantie

@Daantie I see, many thanks.

IcyLemon avatar Mar 23 '18 10:03 IcyLemon