Hej.
First of all: sorry for maybe asking a very simple question, I am very new to Java.
Here is my problem: I updated the dependenciy of an ancient code from using net.sourceforge.htmlunit
version 2.8 to 2.37.0 (this was recommended by the Github security bot).
Now my code is not compiling and throws two errors.
Here is the relevant code:
import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.WebClient;
...
WebClient webClient = new WebClient(FIREFOX_3);
webClient.setTimeout(50000);
HtmlPage page = webClient.getPage("http://king.smith.man.ac.uk/mcpred/");
- First error:
[ERROR] ./MissedCleavageAnalysisAdaptor.java:[64,53] cannot find symbol
[ERROR] symbol: variable FIREFOX_3
- Second error:
[ERROR] ./MissedCleavageAnalysisAdaptor.java:[65,26] cannot find symbol
[ERROR] symbol: method setTimeout(int)
I managed to avoid the first error by simply deleting the "FIREFOX_3". Using "FIREFOX" (= newest version of firefox) or "FIREFOX_78" instead did not work and threw the same error.
With the second error, I cannot see the problem. I tried other integers or first defining an integer int timeout = 50000;
and webClient.setTimeout(timeout);
. Always the same error occurs. It seems like the method setTimeout
was not imported. However, this should be imported together with WebClient
, shouldn't it?
Can you please give me a hint how to tackle these errors?
Thanks a lot!
question from:
https://stackoverflow.com/questions/65884322/updating-to-htmlunit-2-37-0-settimeout-build-failure 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…