what is cannot find symbol this SimpleTimeLimiter create THREAD POOL

0 votes
Hi,

Through command line, I'm trying to compile a java program that simply opens a webpage.   This program runs successfully under eclipse.

package Package1;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class TestTest
{
 
    public static void main(String args[])
    {    
        String baseUrl = "https://google.com";    
        String driverPath = "C:\\Eclipse\\Drivers\\Chromedriver.exe";
        WebDriver driver;
        
        System.setProperty("webdriver.chrome.driver", driverPath);
        driver = new ChromeDriver();
        driver.get(baseUrl);
        driver.manage().window().maximize();
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    }    
}

I'm setting the path on command line and then running javac command.

C:\Eclipse\WorkSpace\Test1>set classpath=C:\Eclipse\lib\*;C:\Eclipse\Drivers\*;C:\Program Files\Java\jdk-14\*
C:\Eclipse\WorkSpace\Test1>javac -d bin C:\Eclipse\WorkSpace\Test1\src\Package1\TestTest.java

However when I run the program, I get the following error.  I can't find anything online that would explain what these errors are.

Thanks in advance!

C:\Eclipse\lib\client-combined-3.141.59-sources.jar(/org/openqa/selenium/net/UrlChecker.java):62: error: cannot find symbol
    this(SimpleTimeLimiter.create(THREAD_POOL));
                          ^
  symbol:   method create(ExecutorService)
  location: class SimpleTimeLimiter
C:\Eclipse\lib\client-combined-3.141.59-sources.jar(/org/openqa/selenium/net/UrlChecker.java):75: error: method callWithTimeout in interface TimeLimiter cannot be applied to given types;
      timeLimiter.callWithTimeout((Callable<Void>) () -> {
                 ^
  required: Callable<T>,long,TimeUnit,boolean
  found:    Callable<Void>,long,TimeUnit
  reason: cannot infer type-variable(s) T
    (actual and formal argument lists differ in length)
  where T is a type-variable:
    T extends Object declared in method <T>callWithTimeout(Callable<T>,long,TimeUnit,boolean)
C:\Eclipse\lib\client-combined-3.141.59-sources.jar(/org/openqa/selenium/net/UrlChecker.java):115: error: method callWithTimeout in interface TimeLimiter cannot be applied to given types;
      timeLimiter.callWithTimeout((Callable<Void>) () -> {
                 ^
  required: Callable<T>,long,TimeUnit,boolean
  found:    Callable<Void>,long,TimeUnit
  reason: cannot infer type-variable(s) T
    (actual and formal argument lists differ in length)
  where T is a type-variable:
    T extends Object declared in method <T>callWithTimeout(Callable<T>,long,TimeUnit,boolean)
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
Nov 6, 2020 in Java by zaraaq
• 270 points

edited Nov 6, 2020 by Gitika 2,057 views

Hello, @Zaraaq,

Could you please mention what exact error you are facing while executing the code?

Hi Gitlka,

Thank you for a quick response.  See the error below.  Thanks

C:\Eclipse\lib\client-combined-3.141.59-sources.jar(/org/openqa/selenium/net/UrlChecker.java):62: error: cannot find symbol
    this(SimpleTimeLimiter.create(THREAD_POOL));
                          ^
  symbol:   method create(ExecutorService)
  location: class SimpleTimeLimiter
C:\Eclipse\lib\client-combined-3.141.59-sources.jar(/org/openqa/selenium/net/UrlChecker.java):75: error: method callWithTimeout in interface TimeLimiter cannot be applied to given types;
      timeLimiter.callWithTimeout((Callable<Void>) () -> {
                 ^
  required: Callable<T>,long,TimeUnit,boolean
  found:    Callable<Void>,long,TimeUnit
  reason: cannot infer type-variable(s) T
    (actual and formal argument lists differ in length)
  where T is a type-variable:
    T extends Object declared in method <T>callWithTimeout(Callable<T>,long,TimeUnit,boolean)
C:\Eclipse\lib\client-combined-3.141.59-sources.jar(/org/openqa/selenium/net/UrlChecker.java):115: error: method callWithTimeout in interface TimeLimiter cannot be applied to given types;
      timeLimiter.callWithTimeout((Callable<Void>) () -> {
                 ^
  required: Callable<T>,long,TimeUnit,boolean
  found:    Callable<Void>,long,TimeUnit
  reason: cannot infer type-variable(s) T
    (actual and formal argument lists differ in length)
  where T is a type-variable:
    T extends Object declared in method <T>callWithTimeout(Callable<T>,long,TimeUnit,boolean)
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors

Hi, @zaraaq,

You can follow this https://guava.dev/releases/23.0/api/docs/com/google/common/util/concurrent/SimpleTimeLimiter.html#create-java.util.concurrent.ExecutorService- 

As you have got multiple errors I hope this would help you.

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Java

0 votes
4 answers

“Cannot find symbol” compilation error

The "Cannot find symbol" errors generally occur when you ...READ MORE

answered Dec 16, 2020 in Java by Gitika
• 65,770 points
42,403 views
0 votes
1 answer

What is ?: this operator called in java ? how dose it function?

? :  is the Conditional operator and is ...READ MORE

answered Jun 11, 2018 in Java by sophia
• 1,400 points
905 views
+2 votes
1 answer

What is the meaning of "this" keyword in Java?

public class MyThisTest { private int ...READ MORE

answered Oct 10, 2018 in Java by Daisy
• 8,140 points
885 views
0 votes
0 answers

how to solve thread-cannot find symbol

Feb 11, 2019 in Java by anonymous
1,088 views
0 votes
2 answers

What is the meaning of purpose of this command: java -jar <some jar file>.jar ?

JAR (Java Archive) file is a package file ...READ MORE

answered Mar 22, 2019 in Java by Omkar
• 69,220 points
2,619 views
0 votes
1 answer

What is Modeshape. How can i use this?

ModeShape is an open-source implementation of the JSR-283 specification and ...READ MORE

answered Mar 30, 2020 in Java by Gitika
• 65,770 points
1,050 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,673 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,142 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,221 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,874 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP