eXist-db installing MySQL connector - mysql

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>

Related

maven-connector-java, module not found

Successfully I did my first JDBC program using MariaDB, Maven, Java-11.
Now I have to access MySQL and just exchanged the MariaDB dependency by
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.28</version>
</dependency>
I figured out, that com.mysql.jdbc and com.mysql.cj and other modules are hosted in the mysql-connector-java-8.0.28.jar.
Hence, in module-info.java I exchanged
requires org.mariadb.jdbc;
by
requires com.mysql.jdbc;
I also tried
requires com.mysql.cj;
but still, the maven-compiler-plugin:3.9.0 complains
module not found
What did I miss, here?
khmarbaise has put me on the right track: I almost forgot that there are legacy jar files around not prepared for easy integration into JPMS. To include the jar file mysql-connector-java-8.0.28.jar, which comes without a module-info.class, I had to enter
requires java.sql;
requires mysql.connector.java;
to my module-info.java.
The module name mysql.connector.java is derived from the name of its jar file by omitting the version info and substituting the dashes by dots.

terminating: loadlib libVisionProxy.dylib not available in /Users/priya/Library/Application Support/Sikulix/SikulixLibs_201510051707

I have added below 2 dependencies in POM file for running a Sikuli program and getting the error
"loadlib: libVisionProxy.dylib not available in /Users/priya/Library/Application Support/Sikulix/SikulixLibs_201510051707"
what should I do to fix this issue in my MAC system.
**Dependency added.**
'<dependency>
<groupId>org.sikuli</groupId>
<artifactId>sikuli-api</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>com.sikulix</groupId>
<artifactId>sikulixapi</artifactId>
<version>2.0.4</version>
</dependency>'
In Maven dependency I can see the Jar added are
Sikuli-api 1.2.0 ,
Sikuli-core 1.2.2 ,
sikulixapi 2.0.4.,
sikulix2tigervnc 1.1.4
sikuli-api and sikulixapi are two different packages, that should not be used together. decide for one of them.
For SikuliX: Delete the folder /Users/priya/Library/Application Support/Sikulix/ and Strat all over again.

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