Started getting unknown error: Chrome failed to start: exited normally. (unknown error: DevToolsActivePort file doesn't exist) - selenium-chromedriver

Chrome version is recently upgraded to 108.x version and all of sudden my scripts have started failing and getting below exception:
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited normally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location C:\Program Files\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
I have gone through different forums but none of the solutions worked. I am running my scripts on stand alone machine with Windows 11, Java Version as 17 and below maven dependencies I am using:
<dependencies>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.2.1</version>
</dependency>
</dependencies>
How can I resolve this issue? I have tried all the options mentioned in below question:
WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser
I have tried all the options mentioned in below question:
WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser

Did you put your class files or jar file in an external storage instead of the SSD or hard disk that originally belonged to your PC? Such as a USB storage or an SD card. Sometimes issues like your description occur in that situation.

Related

eXist-db installing MySQL connector

Does anyone know the steps to correctly install the MySQL JDBC driver into eXist-db for MacOS? I’m following http://www.exist-db.org/exist/apps/wiki/HowTo/SQLDatabases/QueryingSQLDatabases, but am stuck at 1.2. Everything I try results in the error
exerr:ERROR sql:get-connection() Cannot find database driver class: com.mysql.jdbc.Driver [at line 4, column 20]
I’ve installed mysql-connector-java-8.0.22.jar into
/Applications/eXist-db.app/Contents/Java/
/Applications/eXist-db.app/Contents/lib/user/
/Applications/eXist-db.app/Contents/Resources/lib/user/
/Applications/eXist-db.app/Contents/Resources/etc/webapp/WEB-INF/lib/
And none of these locations resolved the error. I must be missing a step.
Are you working with eXist-db 5?
It is important to register the JDBC driver jar file in eXist-db. The jar file is placed in the $EXIST_HOME$/lib directory and the dependency on the jar file must be registered in eXist-db by adding an entry similar to the following in etc/startup.xml where the relativePath is the relative path to the jar file from the lib directory.
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.18</version>
<relativePath>jdbc/mysql-connector-java-8.0.18.jar</relativePath>
</dependency>

Quarkus org.jboss.resteasy.spi.UnhandledException: Unable to find a MessageBodyReader of content-type application/json

I am trying to implement the REst Client example from the Quarkus website (code 1:1): https://quarkus.io/guides/rest-client
When I launch http://localhost:8080/country/name/greece I get:
Error handling ce3120e3-1a55-418e-a5a1-a17a80d7e278-1, org.jboss.resteasy.spi.UnhandledException: javax.ws.rs.ProcessingException: RESTEASY003145: Unable to find a MessageBodyReader of content-type application/json;charset=utf-8 and type interface java.util.Set
After some reading on the internets I stumbled upon a hint, that it could be connected to a missing Jackson dependency.
So I added the below and reran (same error regardless of the version):
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
<version>1.3.0.Alpha2</version>
</dependency>
Now I get the following issue:
Error handling 00077d3a-bbdb-48ee-b84b-653bf98baefc-2, org.jboss.resteasy.spi.UnhandledException:
javax.ws.rs.ProcessingException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:
Unrecognized field "topLevelDomain" (class org.acme.Country),
not marked as ignorable (4 known properties: "capital", "alpha2Code", "name", "currencies"])
My stack is Quarkus 1.2.1, JDK 12.0.2 and Windows 10.
Any ideas what I might be doing wrong?
I had the same error at my project, it stopped happening when I added this dependency:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jsonb</artifactId>
</dependency>

Cannot resolve type problems with eclipse

It seems that I got the wires crossed & ask you to point me the right direction.
I have a problem with the Eclipse IDE for Enterprise Java Developers (version: 2019-06 (4.12.0), build id: 20190614-1200). There is a code part where I get the error message MysqlDataSource cannot be resolved to a type. Searching the Web, I found out that this class is included in the download of mysql-connector-java JAR 8.0.14 with all dependencies. I added it over the 'Fix project setup…', where I added the JAR file to the libraries of the Java Build Path.
Unfortunately, the error message does not vanish. Can you see what I am doing wrong?
Edit 1:
With the hint from another Website, I found out that the hibernate JAR included was the source files JAR. So, I corrected it the hibernate-entitymanager JAR, clicked "Clean…" under "Project", but to no avail: the EntityManager is still unlocatable. (Well, after several tries, the first error message to resolve is no more with MySQL.)
As I learned from somebody on another Web site, the following lines have to be added to the pom.xml file:
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.2.Final</version>
</dependency>
or
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>

java.lang.NoSuchMethodError: com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder; while launching Chrome through ChromeDriver

Hi I am facing this issue while launching the driver.
Starting ChromeDriver 2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73) on port 4097
Only local connections are allowed.
Exception in thread "main" java.lang.NoSuchMethodError: com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;
at org.openqa.selenium.json.Json.<clinit>(Json.java:47)
at org.openqa.selenium.logging.profiler.HttpProfilerLogEntry.constructMessage(HttpProfilerLogEntry.java:37)
at org.openqa.selenium.logging.profiler.HttpProfilerLogEntry.<init>(HttpProfilerLogEntry.java:29)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
at isf.Login.main(Login.java:21)
Can anybody tell what i am missing ..because same libs i am using for another project and its working fine there.
I was facing the same issue and got resolved using below approach:
If you check JSON class at line 47, setLenient() is missing.
This issue is possibly due to conflicts in Gson versions.
Go to your repository:
C:\Users\User_name\.m2\repository\com\google\code\gson
Delete all the existing folders.
Now, add below maven dependency in your pom file:
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
<scope>provided</scope>
</dependency>
Re-build your pom.xml file and execute the script.
In case you are using maven, you should add the following dependency:
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
That should solve it. Gson package version should be correlated with latest Selenium version.

Encrypt a Java application with Cloud KMS example

https://codelabs.developers.google.com/codelabs/cloud-bookshelf-java-cloud-kms/index.html#0
I'm getting following error after downloading additional Bookshelf app files ( Step 7)
[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.3.8.v20160314:run-exploded (default-cli) on project bookshelf-3: Execution default-cli of goal org.eclipse.jetty:jetty-maven-plugin:9.3.8.v20160314:run-exploded failed: An API incompatibility was encountered while executing org.eclipse.jetty:jetty-maven-plugin:9.3.8.v20160314:run-exploded: java.lang.NoSuchMethodError: com.google.cloud.ServiceOptions.(Ljava/lang/Class;Ljava/lang/Class;Lcom/google/cloud/ServiceOptions$Builder;Lcom/google/cloud/ServiceDefaults;)
https://codelabs.developers.google.com/codelabs/cloud-bookshelf-java-cloud-kms/index.html#0
like Tim mentioned, you're getting this error because that codelab is currently instructing users to download an older version of the KMS library (v1beta1). You can see this in the pom.xml file in the GCS bucket downloaded, for the google-api-services-cloudkms artifact, whose version is v1beta1-rev1-1.22.0.
To fix the issue, edit the pom.xml file in the bucket to point to the current v1 version, you can find the current version here: https://mvnrepository.com/artifact/com.google.apis/google-api-services-cloudkms. At the time I'm writing this, its v1-rev41-1.23.0.
Current:
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-cloudkms</artifactId>
<version>v1beta1-rev1-1.22.0</version>
</dependency>
Fix
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-cloudkms</artifactId>
<version>v1-rev41-1.23.0</version>
</dependency>
You're also going to need to resolve all of the v1beta1 references inside src/main/java/com/example/getstarted/util/CloudKeyManagementServiceHelper.java
For more information and guides on how to use Google Cloud KMS Java, I'd suggest looking at our java samples.
Thanks