Thank you all for the reply and sorry to interrupt again. The problem still exists. I think maybe the problem is MySQL library version.
I use MySQL 5.7.12 on server side (192.168.1.230) and CSS OPI on client side (192.168.1.231). I have done all the MySQL configurations before and CSS are successful to connect to MySQL, while for Phoebus I am still
struggling to find the reason.
The configurations for Phoebus are:
org.csstudio.trends.databrowser3/urls=jdbc:mysql://192.168.1.230/archive
org.csstudio.trends.databrowser3/archives=jdbc:mysql://192.168.1.230/archive
Maybe the problem is MySQL library in Phoebus are not suitable to MySQL 5.7.12, I download the mysql-connector-java-5.1.49 from website https://downloads.mysql.com/archives/c-j/, and try to directly replace mysql-connector-java-8.0.30.jar
with mysql-connector-java-5.1.49 in Phoebus folder, the path is product-sns-4.7.3-SNAPSHOT/lib/, however the problem still exists. I wonder if the simply replacement is right or maybe java version is the issue.
CSS 4.5.10-SNAPSHOT community edition could connect to MySQL 5.7.12 successfully to read the historic data on the following java environment:
openjdk version "1.8.0_102"
OpenJDK Runtime Environment (build 1.8.0_102-b14)
OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)
while, If running Phoebus, I have to change to the java environment below (update-alternatives --config java) and thus failed to connect to MySQL 5.7.12 even if the configuration are the same as CSS for the address
of archive Data Server URLs and Archive Data sources, user name and passwords:
java version "16.0.1" 2021-04-20
Java(TM) SE Runtime Environment (build 16.0.1+9-24)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)
I wonder if java version is the issue and if simply replace mysql-connector-java-8.0.30.jar with mysql-connector-java-5.1.49 is right. Thanks again !
The error messages are as follows:
=======================================================================================================================
URL: jdbc:mysql://192.168.1.230/archive
Error:
java.lang.Exception: Cannot connect to jdbc:mysql://192.168.1.230/archive as root
at org.phoebus.framework.rdb.RDBInfo.connect(RDBInfo.java:134)
at org.phoebus.framework.rdb.RDBConnectionPool.getConnection(RDBConnectionPool.java:137)
at org.phoebus.archive.reader.rdb.RDBArchiveReader.getStatusValues(RDBArchiveReader.java:116)
at org.phoebus.archive.reader.rdb.RDBArchiveReader.<init>(RDBArchiveReader.java:70)
at org.phoebus.archive.reader.rdb.RDBArchiveReaderFactory.createReader(RDBArchiveReaderFactory.java:28)
at org.phoebus.archive.reader.ArchiveReaders.createReader(ArchiveReaders.java:50)
at org.csstudio.trends.databrowser3.ui.search.ArchiveListPane.lambda$showArchiveInfo$3(ArchiveListPane.java:76)
at org.phoebus.framework.jobs.Job.execute(Job.java:50)
at org.phoebus.framework.jobs.JobManager.execute(JobManager.java:54)
at org.phoebus.framework.jobs.JobManager.lambda$schedule$0(JobManager.java:45)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:831)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://192.168.1.230/archive
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:702)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)
at org.phoebus.framework.rdb.RDBInfo.connect(RDBInfo.java:130)
... 13 more
==========================================================================================================================