问:
Saving Color into Core Data for the iOS and macOS Apps
I am building an app (SwiftUI) which will be used for iOS and macOS platform. One of the challenges, I am facing is storing Color (SwiftUI) into the database. In other apps I have used NSValueTransformer to use it with UIColor or NSColor but now the problem is that iOS and macOS share the codebase. I am using Core Data so the data model is being shared but the data saved is on separate SQLite files. If I want to sync the data to iCloud then would't I face issues if iOS app stored color as UIColor and macOS app stored color as NSColor?

How can I resolve this issue?

答:
import UIKit
import CoreData

class saveDataScreenViewController: UIViewController {

```<code>@IBOutlet weak var txtName: UITextField!
@IBOutlet weak var txtId: UITextField!
@IBOutlet weak var txtUserName: UITextField!
@IBOutlet weak var txtPassword: UITextField!
@IBOutlet weak var btnSave: UIButton!

//MARK: - Create context for save data

let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext

override func viewDidLoad() {
    super.viewDidLoad()

}

//MARK: - save button click with validation and saving data to core data

@IBAction func didTapSave(_ sender: UIButton) {

    if txtName.text!.isEmpty {
        let alert = UIAlertController(title: "Alert", message: "Please enter Name", preferredStyle: .alert)
        let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
        alert.addAction(okAction)
        present(alert, animated: true, completion: nil)
    } else if txtId.text!.isEmpty {
        let alert = UIAlertController(title: "Alert", message: "Please enter id", preferredStyle: .alert)
        let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
        alert.addAction(okAction)
        present(alert, animated: true, completion: nil)
    } else if txtUserName.text!.isEmpty {
        let alert = UIAlertController(title: "Alert", message: "Please enter username", preferredStyle: .alert)
        let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
        alert.addAction(okAction)
        present(alert, animated: true, completion: nil)
    } else if txtPassword.text!.isEmpty {
        let alert = UIAlertController(title: "Alert", message: "Please enter password", preferredStyle: .alert)
        let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
        alert.addAction(okAction)
        present(alert, animated: true, completion: nil)
    } else {
        let Entity = NSEntityDescription.insertNewObject(forEntityName: "EntityName", into: context)
        clinicEntity.setValue(txtName.text!, forKey: "Name")
        clinicEntity.setValue(txtId.text!, forKey: "id")
        clinicEntity.setValue(txtPassword.text!, forKey: "password")
        clinicEntity.setValue(txtUserName.text!, forKey: "username")

        do {
            try context.save()
            self.txtUserName.text = ""
            self.txtPassword.text = ""
            self.txtName.text = ""
            self.txtId.text = ""
            self.navigationController?.popViewController(animated: true)
        } catch {
            print("Error while insert data!")
        }
    }

}
</code>```

}

Body:
import UIKit
import CoreData

class saveDataScreenViewController: UIViewController {

@IBOutlet weak var txtName: UITextField!
@IBOutlet weak var txtId: UITextField!
@IBOutlet weak var txtUserName: UITextField!
@IBOutlet weak var txtPassword: UITextField!
@IBOutlet weak var btnSave: UIButton!

//MARK: - Create context for save data

let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext

override func viewDidLoad() {
    super.viewDidLoad()

}

//MARK: - save button click with validation and saving data to core data

@IBAction func didTapSave(_ sender: UIButton) {

    if txtName.text!.isEmpty {
        let alert = UIAlertController(title: "Alert", message: "Please enter Name", preferredStyle: .alert)
        let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
        alert.addAction(okAction)
        present(alert, animated: true, completion: nil)
    } else if txtId.text!.isEmpty {
        let alert = UIAlertController(title: "Alert", message: "Please enter id", preferredStyle: .alert)
        let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
        alert.addAction(okAction)
        present(alert, animated: true, completion: nil)
    } else if txtUserName.text!.isEmpty {
        let alert = UIAlertController(title: "Alert", message: "Please enter username", preferredStyle: .alert)
        let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
        alert.addAction(okAction)
        present(alert, animated: true, completion: nil)
    } else if txtPassword.text!.isEmpty {
        let alert = UIAlertController(title: "Alert", message: "Please enter password", preferredStyle: .alert)
        let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
        alert.addAction(okAction)
        present(alert, animated: true, completion: nil)
    } else {
        let Entity = NSEntityDescription.insertNewObject(forEntityName: "EntityName", into: context)
        clinicEntity.setValue(txtName.text!, forKey: "Name")
        clinicEntity.setValue(txtId.text!, forKey: "id")
        clinicEntity.setValue(txtPassword.text!, forKey: "password")
        clinicEntity.setValue(txtUserName.text!, forKey: "username")

        do {
            try context.save()
            self.txtUserName.text = ""
            self.txtPassword.text = ""
            self.txtName.text = ""
            self.txtId.text = ""
            self.navigationController?.popViewController(animated: true)
        } catch {
            print("Error while insert data!")
        }
    }

}

}


来源: stackexchange

问:
IntelliJ - Unable to start web server; nested exception is java.lang.IllegalStateException: Temp directory 'C:\WINDOWS\TEMP' does not exist
Created a spring boot project in IntelliJ but getting error while running.

Below is the error

```<code>org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.IllegalStateException: Temp directory 'C:\WINDOWS\TEMP' does not exist
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) ~[spring-boot-2.6.1.jar:2.6.1]
at com.example.studentapplication.StudentApplication.main(StudentApplication.java:10) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.6.1.jar:2.6.1]
Caused by: java.lang.IllegalStateException: Temp directory 'C:\WINDOWS\TEMP' does not exist
    at org.springframework.util.Assert.state(Assert.java:97) ~[spring-core-5.3.13.jar:5.3.13]
    at org.springframework.boot.system.ApplicationTemp.getTempDirectory(ApplicationTemp.java:125) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.system.ApplicationTemp.getPath(ApplicationTemp.java:96) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.system.ApplicationTemp.getDir(ApplicationTemp.java:89) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.servlet.server.SessionStoreDirectory.getValidDirectory(SessionStoreDirectory.java:46) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory.getValidSessionStoreDir(AbstractServletWebServerFactory.java:306) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory.getValidSessionStoreDir(AbstractServletWebServerFactory.java:302) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.configurePersistSession(TomcatServletWebServerFactory.java:439) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.configureSession(TomcatServletWebServerFactory.java:414) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.configureContext(TomcatServletWebServerFactory.java:390) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.prepareContext(TomcatServletWebServerFactory.java:253) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:205) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160) ~[spring-boot-2.6.1.jar:2.6.1]
    ... 13 common frames omitted
</code>```

答:
This happens if you don't have privileges' to access the TEMP folder .

Solution to this if you are using IntellijIDE --> Edit Run
Configuration --> VM option update below -Djava.io.tmpdir=c:<your
path>

For example

```<code>-Djava.io.tmpdir=c:\user\mytempclass
</code>```

ContentLicense: CC BY-SA 4.0

Body:
Created a spring boot project in IntelliJ but getting error while running.

Below is the error

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.IllegalStateException: Temp directory 'C:\WINDOWS\TEMP' does not exist
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) ~[spring-boot-2.6.1.jar:2.6.1]
at com.example.studentapplication.StudentApplication.main(StudentApplication.java:10) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.6.1.jar:2.6.1]
Caused by: java.lang.IllegalStateException: Temp directory 'C:\WINDOWS\TEMP' does not exist
    at org.springframework.util.Assert.state(Assert.java:97) ~[spring-core-5.3.13.jar:5.3.13]
    at org.springframework.boot.system.ApplicationTemp.getTempDirectory(ApplicationTemp.java:125) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.system.ApplicationTemp.getPath(ApplicationTemp.java:96) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.system.ApplicationTemp.getDir(ApplicationTemp.java:89) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.servlet.server.SessionStoreDirectory.getValidDirectory(SessionStoreDirectory.java:46) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory.getValidSessionStoreDir(AbstractServletWebServerFactory.java:306) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory.getValidSessionStoreDir(AbstractServletWebServerFactory.java:302) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.configurePersistSession(TomcatServletWebServerFactory.java:439) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.configureSession(TomcatServletWebServerFactory.java:414) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.configureContext(TomcatServletWebServerFactory.java:390) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.prepareContext(TomcatServletWebServerFactory.java:253) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:205) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182) ~[spring-boot-2.6.1.jar:2.6.1]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160) ~[spring-boot-2.6.1.jar:2.6.1]
    ... 13 common frames omitted

Body:
This happens if you don't have privileges' to access the TEMP folder .

Solution to this if you are using IntellijIDE --> Edit Run
Configuration --> VM option update below -Djava.io.tmpdir=c:<your
path>

For example

-Djava.io.tmpdir=c:\user\mytempclass


问:
remove file's end and the begigng using powershell
i have a folder contains  pdf files starting with paracel_ and end with _manifest

for example :
paracel_123_manifest

i use this command to remove the "manifest" from the file but i dont konw how to remove the "paracel" from the satart of the file

$dir = "C:\temp"
$phrase = "_manifest"

$length=$phrase.Length

Get-ChildItem $dir -Recurse| Where-Object { $.Name -like "$phrase" } | Rename-Item -NewName { $.name.substring(0,$.BaseName.length-$length)+$.Extension}# -WhatIf -verbose

thanks in advance!!
hope someone can assist
A

答:
```<code>$dir = "C:\temp"
$phrase = "_manifest"

Get-ChildItem $dir -Filter "paracel_*$phrase*.pdf" -Recurse | ForEach-Object {
    Rename-Item $_.FullName -NewName ($_.Name.Replace("_manifest","")).Replace("paracel_","") -WhatIf -verbose
}
</code>```

You were on the right path. I just changed the filter and put parsed the items in a foreach loop.

Body:
$dir = "C:\temp"
$phrase = "_manifest"

Get-ChildItem $dir -Filter "paracel_*$phrase*.pdf" -Recurse | ForEach-Object {
    Rename-Item $_.FullName -NewName ($_.Name.Replace("_manifest","")).Replace("paracel_","") -WhatIf -verbose
}

You were on the right path. I just changed the filter and put parsed the items in a foreach loop.


问:
Connect to Heroku ClearDB with SpringBoot
I am new to Heroku and I am trying to deploy my spring-boot application which is connecting to a MySQL database, since Heroku does not support native MySQL, I looked for an alternative in the internet for MySQL and I found ClearDB, so I created it and I was able to connect to it locally, but when I deploy it to Huroku it throws an error and refused to start,

here are the logs I got:

```Feb 08 08:01:19 denty-auth heroku/web.1 State changed from crashed to starting
Feb 08 08:01:22 denty-auth heroku/web.1 Starting process with command `java -Dserver.port=6526 $JAVA_OPTS -jar target/denty-auth.jar`
Feb 08 08:01:23 denty-auth app/web.1 Create a Procfile to customize the command used to run this process: https://devcenter.heroku.com/articles/procfile
Feb 08 08:01:23 denty-auth app/web.1 Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
Feb 08 08:01:23 denty-auth app/web.1 Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
Feb 08 08:01:25 denty-auth app/web.1   .   ____          _            __ _ _
Feb 08 08:01:25 denty-auth app/web.1  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
Feb 08 08:01:25 denty-auth app/web.1 ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
Feb 08 08:01:25 denty-auth app/web.1  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
Feb 08 08:01:25 denty-auth app/web.1   '  |____| .__|_| |_|_| |_\__, | / / / /
Feb 08 08:01:25 denty-auth app/web.1  =========|_|==============|___/=/_/_/_/
Feb 08 08:01:25 denty-auth app/web.1  :: Spring Boot ::        (v2.2.0.RELEASE)
Feb 08 08:01:25 denty-auth app/web.1 2022-02-08 16:01:24.715  INFO 4 --- [           main] com.SpringBootSecurityApplication        : Starting SpringBootSecurityApplication vdenty-auth.0.0.1 on 7e553246-f0e4-4a84-a0c4-3f329d7a720b with PID 4 (/app/target/denty-auth.jar started by u27630 in /app)
Feb 08 08:01:25 denty-auth app/web.1 2022-02-08 16:01:24.719  INFO 4 --- [           main] com.SpringBootSecurityApplication        : No active profile set, falling back to default profiles: default
Feb 08 08:01:26 denty-auth app/web.1 2022-02-08 16:01:26.345  INFO 4 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
Feb 08 08:01:27 denty-auth app/web.1 2022-02-08 16:01:27.080  INFO 4 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 711ms. Found 2 repository interfaces.
Feb 08 08:01:27 denty-auth app/web.1 2022-02-08 16:01:27.526  INFO 4 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:27.836  INFO 4 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 6526 (http)
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:27.847  INFO 4 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:27.847  INFO 4 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.27]
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:27.895  INFO 4 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:27.896  INFO 4 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 3067 ms
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:28.508 ERROR 4 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.
Feb 08 08:01:28 denty-auth app/web.1 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121) ~[HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353) ~[HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473) [HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562) [HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) [HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81) [HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.denty.config.DatabaseConfig.dataSource(DatabaseConfig.java:23) [classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at com.denty.config.DatabaseConfig$$EnhancerBySpringCGLIB$$adfdbc65.CGLIB$dataSource$0(<generated>) [classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at com.denty.config.DatabaseConfig$$EnhancerBySpringCGLIB$$adfdbc65$$FastClassBySpringCGLIB$$804cbe3a.invoke(<generated>) [classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) [spring-core-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) [spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at com.denty.config.DatabaseConfig$$EnhancerBySpringCGLIB$$adfdbc65.dataSource(<generated>) [classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:640) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:475) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:874) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:778) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:226) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:400) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth heroku/web.1 Process exited with status 1
Feb 08 08:01:28 denty-auth heroku/web.1 State changed from starting to crashed
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at com.SpringBootSecurityApplication.main(SpringBootSecurityApplication.java:10) ~[classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) ~[denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) ~[denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1 Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1340) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.NativeSession.connect(NativeSession.java:157) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    ... 72 common frames omitted
Feb 08 08:01:28 denty-auth app/web.1 Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
Feb 08 08:01:28 denty-auth app/web.1    at sun.security.ssl.HandshakeContext.<init>(HandshakeContext.java:171) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.security.ssl.ClientHandshakeContext.<init>(ClientHandshakeContext.java:103) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.security.ssl.TransportContext.kickstart(TransportContext.java:220) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:428) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.protocol.ExportControlled.performTlsHandshake(ExportControlled.java:316) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.protocol.StandardSocketFactory.performTlsHandshake(StandardSocketFactory.java:188) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.protocol.a.NativeSocketConnection.performTlsHandshake(NativeSocketConnection.java:99) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:329) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    ... 79 common frames omitted
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:28.510  WARN 4 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/denty/config/DatabaseConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:28.513  INFO 4 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:28.524  INFO 4 --- [           main] ConditionEvaluationReportLoggingListener :
Feb 08 08:01:28 denty-auth app/web.1 Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:28.527 ERROR 4 --- [           main] o.s.boot.SpringApplication               : Application run failed
Feb 08 08:01:28 denty-auth app/web.1 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/denty/config/DatabaseConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:787) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:226) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at com.SpringBootSecurityApplication.main(SpringBootSecurityApplication.java:10) [classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/denty/config/DatabaseConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:645) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    ... 36 common frames omitted
Feb 08 08:01:28 denty-auth app/web.1 Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:640) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    ... 50 common frames omitted
Feb 08 08:01:28 denty-auth app/web.1 Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:29 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:29 denty-auth app/web.1    ... 51 common frames omitted
Feb 08 08:01:29 denty-auth app/web.1 Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
Feb 08 08:01:29 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:29 denty-auth app/web.1    at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:29 denty-auth app/web.1    ... 64 common frames omitted
Feb 08 08:01:29 denty-auth app/web.1 Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
Feb 08 08:01:29 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:29 denty-auth app/web.1    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    ... 72 common frames omitted
Feb 08 08:01:29 denty-auth app/web.1 Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
Feb 08 08:01:29 denty-auth app/web.1    ... 79 common frames omitted
Feb 08 08:02:25 denty-auth app/api Build succeeded

```
<p>my application.properties:</p>
```spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
spring.datasource.url=jdbc:mysql://eu-cdbr-west-02.cleardb.net/heroku_f0199c2dce52aa7?createDatabaseIfNotExist=true&autoReconnect=true&useSSL=false&reconnect=true
spring.datasource.username=baf4cc3740fa70
spring.datasource.password=***************
```
<p>my pom.xml:</p>
```        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
```

can you guys help me fixing it please? :)

答:
I was looking a lot and finally, I found the solution,
the problem was the Java version and MySQL connector version lack of compatibility, in local, I am using a newer version of Java (17th) and in my QA I am using the 8th version,

so all I had to do is to specify the version of MySQL connector, pom.xml:

```<code><dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.21</version>
</dependency>
</code>```

Additional Information

A recent Java update, specifically Red Hat/CentOS, disables TLSv1 and TLSv1.1 by default for Java 8

The MySQL JDBC driver will attempt to use TLSv1 and/or TLSv1.1 if the MySQL database version is below one of the following: 8.0, 5.7.28, 5.6.46

Body:
I am new to Heroku and I am trying to deploy my spring-boot application which is connecting to a MySQL database, since Heroku does not support native MySQL, I looked for an alternative in the internet for MySQL and I found ClearDB, so I created it and I was able to connect to it locally, but when I deploy it to Huroku it throws an error and refused to start,

here are the logs I got:

Feb 08 08:01:19 denty-auth heroku/web.1 State changed from crashed to starting
Feb 08 08:01:22 denty-auth heroku/web.1 Starting process with command `java -Dserver.port=6526 $JAVA_OPTS -jar target/denty-auth.jar`
Feb 08 08:01:23 denty-auth app/web.1 Create a Procfile to customize the command used to run this process: https://devcenter.heroku.com/articles/procfile
Feb 08 08:01:23 denty-auth app/web.1 Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
Feb 08 08:01:23 denty-auth app/web.1 Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
Feb 08 08:01:25 denty-auth app/web.1   .   ____          _            __ _ _
Feb 08 08:01:25 denty-auth app/web.1  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
Feb 08 08:01:25 denty-auth app/web.1 ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
Feb 08 08:01:25 denty-auth app/web.1  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
Feb 08 08:01:25 denty-auth app/web.1   '  |____| .__|_| |_|_| |_\__, | / / / /
Feb 08 08:01:25 denty-auth app/web.1  =========|_|==============|___/=/_/_/_/
Feb 08 08:01:25 denty-auth app/web.1  :: Spring Boot ::        (v2.2.0.RELEASE)
Feb 08 08:01:25 denty-auth app/web.1 2022-02-08 16:01:24.715  INFO 4 --- [           main] com.SpringBootSecurityApplication        : Starting SpringBootSecurityApplication vdenty-auth.0.0.1 on 7e553246-f0e4-4a84-a0c4-3f329d7a720b with PID 4 (/app/target/denty-auth.jar started by u27630 in /app)
Feb 08 08:01:25 denty-auth app/web.1 2022-02-08 16:01:24.719  INFO 4 --- [           main] com.SpringBootSecurityApplication        : No active profile set, falling back to default profiles: default
Feb 08 08:01:26 denty-auth app/web.1 2022-02-08 16:01:26.345  INFO 4 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
Feb 08 08:01:27 denty-auth app/web.1 2022-02-08 16:01:27.080  INFO 4 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 711ms. Found 2 repository interfaces.
Feb 08 08:01:27 denty-auth app/web.1 2022-02-08 16:01:27.526  INFO 4 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:27.836  INFO 4 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 6526 (http)
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:27.847  INFO 4 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:27.847  INFO 4 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.27]
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:27.895  INFO 4 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:27.896  INFO 4 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 3067 ms
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:28.508 ERROR 4 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.
Feb 08 08:01:28 denty-auth app/web.1 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121) ~[HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353) ~[HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473) [HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562) [HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) [HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81) [HikariCP-3.4.1.jar!/:na]
Feb 08 08:01:28 denty-auth app/web.1    at com.denty.config.DatabaseConfig.dataSource(DatabaseConfig.java:23) [classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at com.denty.config.DatabaseConfig$$EnhancerBySpringCGLIB$$adfdbc65.CGLIB$dataSource$0(<generated>) [classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at com.denty.config.DatabaseConfig$$EnhancerBySpringCGLIB$$adfdbc65$$FastClassBySpringCGLIB$$804cbe3a.invoke(<generated>) [classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) [spring-core-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) [spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at com.denty.config.DatabaseConfig$$EnhancerBySpringCGLIB$$adfdbc65.dataSource(<generated>) [classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:640) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:475) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:874) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:778) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:226) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:400) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth heroku/web.1 Process exited with status 1
Feb 08 08:01:28 denty-auth heroku/web.1 State changed from starting to crashed
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) [spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at com.SpringBootSecurityApplication.main(SpringBootSecurityApplication.java:10) ~[classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) ~[denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) ~[denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1 Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1340) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.NativeSession.connect(NativeSession.java:157) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    ... 72 common frames omitted
Feb 08 08:01:28 denty-auth app/web.1 Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
Feb 08 08:01:28 denty-auth app/web.1    at sun.security.ssl.HandshakeContext.<init>(HandshakeContext.java:171) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.security.ssl.ClientHandshakeContext.<init>(ClientHandshakeContext.java:103) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.security.ssl.TransportContext.kickstart(TransportContext.java:220) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:428) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.protocol.ExportControlled.performTlsHandshake(ExportControlled.java:316) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.protocol.StandardSocketFactory.performTlsHandshake(StandardSocketFactory.java:188) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.protocol.a.NativeSocketConnection.performTlsHandshake(NativeSocketConnection.java:99) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:329) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:28 denty-auth app/web.1    ... 79 common frames omitted
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:28.510  WARN 4 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/denty/config/DatabaseConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:28.513  INFO 4 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:28.524  INFO 4 --- [           main] ConditionEvaluationReportLoggingListener :
Feb 08 08:01:28 denty-auth app/web.1 Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
Feb 08 08:01:28 denty-auth app/web.1 2022-02-08 16:01:28.527 ERROR 4 --- [           main] o.s.boot.SpringApplication               : Application run failed
Feb 08 08:01:28 denty-auth app/web.1 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/denty/config/DatabaseConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:787) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:226) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.0.RELEASE.jar!/:2.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at com.SpringBootSecurityApplication.main(SpringBootSecurityApplication.java:10) [classes!/:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_322-heroku]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [denty-auth.jar:denty-auth.0.0.1]
Feb 08 08:01:28 denty-auth app/web.1 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/denty/config/DatabaseConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:645) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    ... 36 common frames omitted
Feb 08 08:01:28 denty-auth app/web.1 Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:640) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:28 denty-auth app/web.1    ... 50 common frames omitted
Feb 08 08:01:28 denty-auth app/web.1 Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Communications link failure
Feb 08 08:01:28 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:29 denty-auth app/web.1    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
Feb 08 08:01:29 denty-auth app/web.1    ... 51 common frames omitted
Feb 08 08:01:29 denty-auth app/web.1 Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
Feb 08 08:01:29 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:29 denty-auth app/web.1    at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.18.jar!/:8.0.18]
Feb 08 08:01:29 denty-auth app/web.1    ... 64 common frames omitted
Feb 08 08:01:29 denty-auth app/web.1 Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
Feb 08 08:01:29 denty-auth app/web.1 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Feb 08 08:01:29 denty-auth app/web.1    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_322-heroku]
Feb 08 08:01:29 denty-auth app/web.1    ... 72 common frames omitted
Feb 08 08:01:29 denty-auth app/web.1 Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
Feb 08 08:01:29 denty-auth app/web.1    ... 79 common frames omitted
Feb 08 08:02:25 denty-auth app/api Build succeeded

my application.properties:

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
spring.datasource.url=jdbc:mysql://eu-cdbr-west-02.cleardb.net/heroku_f0199c2dce52aa7?createDatabaseIfNotExist=true&autoReconnect=true&useSSL=false&reconnect=true
spring.datasource.username=baf4cc3740fa70
spring.datasource.password=***************

my pom.xml:

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>

can you guys help me fixing it please? :)

Body:
I was looking a lot and finally, I found the solution,
the problem was the Java version and MySQL connector version lack of compatibility, in local, I am using a newer version of Java (17th) and in my QA I am using the 8th version,

so all I had to do is to specify the version of MySQL connector, pom.xml:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.21</version>
</dependency>

Additional Information

A recent Java update, specifically Red Hat/CentOS, disables TLSv1 and TLSv1.1 by default for Java 8

The MySQL JDBC driver will attempt to use TLSv1 and/or TLSv1.1 if the MySQL database version is below one of the following: 8.0, 5.7.28, 5.6.46


问:
What is the best way to increase the performance of this code?
I need to fetch the data from multiple related tables with pagination in C#.

The performance of the below code is slow by using the multiple include statements as I need to fetch the related data. What is the best optimization I can do here?

Note that I have the primary key column of type uniqueidentifier.

```<code>var data = await dbcontext.CandidateForm
                          .Include(candidate => candidate.PersonalDetail)
                          .Include(candidate => candidate.AcademicQualifications)
                          .Include(candidate => candidate.TeachingExperiences)
                          .Include(candidate => candidate.CandidateHigherQualification)
                          .Where(x => x.PostCategory == PostName)
                          .OrderByDescending(x => x.CreatedDate)
                          .Skip((filter.PageNumber - 1) * filter.PageSize)
                          .Take(filter.PageSize)
                          .ToListAsync();
</code>```

答:
first make a query that finds PostCategoryId and then

```<code>.Where(x => x.PostCategoryId == PostId)
</code>```

search base on integer is more faster than string
next if you can select specific columns that you need

```<code>.ToListAsync();
</code>```

alone, selects all columns in table, that is heavy compared to one or more columns.
next, instead of includes its better you select exactly what you want from that tables

Body:
I need to fetch the data from multiple related tables with pagination in C#.

The performance of the below code is slow by using the multiple include statements as I need to fetch the related data. What is the best optimization I can do here?

Note that I have the primary key column of type uniqueidentifier.

var data = await dbcontext.CandidateForm
                          .Include(candidate => candidate.PersonalDetail)
                          .Include(candidate => candidate.AcademicQualifications)
                          .Include(candidate => candidate.TeachingExperiences)
                          .Include(candidate => candidate.CandidateHigherQualification)
                          .Where(x => x.PostCategory == PostName)
                          .OrderByDescending(x => x.CreatedDate)
                          .Skip((filter.PageNumber - 1) * filter.PageSize)
                          .Take(filter.PageSize)
                          .ToListAsync();

Body:
first make a query that finds PostCategoryId and then

.Where(x => x.PostCategoryId == PostId)

search base on integer is more faster than string
next if you can select specific columns that you need

.ToListAsync();

alone, selects all columns in table, that is heavy compared to one or more columns.
next, instead of includes its better you select exactly what you want from that tables


问:
Tizen Studio "repository configutation cannot be downloaded"
I'm trying to install the Samsung TV extension packages in Tizen Package Manager. When I go to the "Extension SDK" page I should see the tools to download but nothing is there. When I check in settings I see that the package repo url isn't working:

http://download.tizen.org/sdk/tizenstudio

"The repository configutation cannot be downloaded"

What can I do? I tried installing the package manually but  I just get "Installation failed" :S

答:
I can download tv extension.

I downloaded TizenStudio 4.5.1 version from https://developer.tizen.org/

I used https://download.tizen.org/sdk/tizenstudio URL on the package-manger instead of http://download.tizen.org/sdk/tizenstudio

I installed tv extension


问:
ASP.NET Storing global variables - accessible from every page
I am building a large application and I ususally use a simple session to store private  global information however as the application could be rather large I belive this could be a problem due to the amount of memory sessions it could have.

Is there a better way to store such variables?

For example, when the user logs in I want to store data about that user and display it where needed without having to query the database each time.

答:
use cookies - they would work irrespective of your load balance environments

other options include:

1) writing your sessionvalues to a sql database - you can configure your asp.net app to configure session state to use sql server - but this has its own problems as sessions never time out (so u need to handle this via code explicitly)

2) if not using sql server - basically you would face a problem when you have too many users and you implement load balancing on your web server - so a user can go to a different web server in the same session (and it would not work)

there is a work around for this too - its called STICKY SESSIONS - where your web server guarantees your user would always hit the same web server within the session

3) with .net 2.0 provider model, you can even write your own session storage provider by implementing their delegates - so you can create your own xml files on your web server / shared server to read / write session data there :-)

so there are many ways you can solve this. however the simplest and cost effective solution is to use cookies

OwnerDisplayName: HenryH

LastEditorDisplayName: Rich B

ContentLicense: CC BY-SA 2.5

OwnerDisplayName: Raj

LastEditorDisplayName: Raj


问:
Index was outside the bounds of the array - RichTextBox lines setvalue
I've searched online and on StackOverflow, but I can't seem to find the answer to my question, although some of them came very close.

I am programming for .Net in Delphi Prism. I have a RichTextBox on a WinForm and I need to insert a line of text at the top every time program does insert. So, I am doing the following and it runs upto the line and raises the following exception.

offending code:

```<code>RichTextBox1.Lines.SetValue(str,0);
</code>```

Exception:
Index was outside the bounds of the array

I think, I think I know why it is raising the exception. It's because there are no lines inserted into RichTextBox. So, my program really can't insert any line of text. I need to really insert line of text at the top everytime my program inserts a new line of text.

If I do call RichTextBox1.AppendText(str);, then it works and inserts the str text without newline, but it appends at the end. I want it inserting text at the top every time.

How do you insert line of text into RichTextBox?
Thanks.

答:
The Lines property of the textbox is simply an array of string. So you need to add one element, move all elements one index down and insert your new text at the first index.

Also the Text property of the textbox is a string. Strings in .NET are immutable, so you need to fully replace the value.

One approach would be like this:

```<code>RichTextBox1.Text := "YourNewText" + Environment.NewLine + RichTextBox1.Text;
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I've searched online and on StackOverflow, but I can't seem to find the answer to my question, although some of them came very close.

I am programming for .Net in Delphi Prism. I have a RichTextBox on a WinForm and I need to insert a line of text at the top every time program does insert. So, I am doing the following and it runs upto the line and raises the following exception.

offending code:

RichTextBox1.Lines.SetValue(str,0);

Exception:
Index was outside the bounds of the array

I think, I think I know why it is raising the exception. It's because there are no lines inserted into RichTextBox. So, my program really can't insert any line of text. I need to really insert line of text at the top everytime my program inserts a new line of text.

If I do call RichTextBox1.AppendText(str);, then it works and inserts the str text without newline, but it appends at the end. I want it inserting text at the top every time.

How do you insert line of text into RichTextBox?
Thanks.

Body:
The Lines property of the textbox is simply an array of string. So you need to add one element, move all elements one index down and insert your new text at the first index.

Also the Text property of the textbox is a string. Strings in .NET are immutable, so you need to fully replace the value.

One approach would be like this:

RichTextBox1.Text := "YourNewText" + Environment.NewLine + RichTextBox1.Text;


问:
Delete a node(or more nodes) between others in a linked list C
Hi I'm creating a program for school where I have to:

Create structures

Create functions to print my linked list

Create functions to insert an element to the bottom of the list

Delete duplicate elements.

I created all a part the last one step(delete function). Can you help me to know what is the right way? This is my code:

```<code>#include <stdio.h>
#include <string.h>
#include <stdlib.h>

/*STRUCTURE*/
typedef struct punto {
    int x;
    int y;
} PUNTO;

typedef struct quadrato {
    PUNTO v;
    int lato;
} QUADRATO;

typedef struct nodo {
    QUADRATO q;
    struct nodo *next;
} NODO;

/*PRINT LIST*/
void stampaQuadrato(QUADRATO q) {
    printf("The square has the side equal to %d and coordinates of the lower left vertex (%d,%d)\n", q.lato, q.v.x, q.v.y);
}

void stampaLista(NODO *head) {
    if(head->next==NULL) {
        printf("List empty!\n");
    } else {
        while(head->next != NULL) {
            head = head->next;
            stampaQuadrato(head->q);
        }
    }
}

/*ADD*/
QUADRATO creaQuadrato() {

    QUADRATO nuovo;

    printf("Side measurement: ");
    scanf("%d", &nuovo.lato);
    printf("\n");
    printf("Coordinates of the lower left vertex\n");
    printf("x: ");
    scanf("%d", &nuovo.v.x);
    printf("\n");
    printf("y: ");
    scanf("%d", &nuovo.v.y);
    printf("\n");

    return nuovo;

}

void insert(NODO *head) {
    NODO* nuovoNodo = malloc(sizeof(NODO));
    nuovoNodo->q = creaQuadrato();
    if(head==NULL) {
        head = head->next;
        head = nuovoNodo;
    } else {
        while(head->next != NULL) {
            head = head->next;
        }
        head->next = nuovoNodo;
    }
}

/*DELETE*/
void deleteDuplicates(NODO *head) {
    if(head==NULL) {
        printf("There are no element in the list!\n");
    } else {
        while(head->next != NULL) {
            if(head->q.lato == head->next->q.lato &&
               head->q.v.x == head->next->q.v.x &&
               head->q.v.y == head->next->q.v.y) {
                   NODO* nodoQuad = head->next;
                   head->next = nodoQuad->next;
                   //head->next = head->next->next;
                   free(nodoQuad);
                   printf("Element deleted!\n");
               } else {
                   head = head->next;
               }
        }
    }
}

int main() {
    NODO *head = malloc(sizeof(NODO));
    head->next = NULL;
    int scelta = -1;

    while(scelta != 0) {
        printf("Choose one\n");
        printf("Press 1 --> See list\n");
        printf("Press 2 --> Insert new square(quadrato)\n");
        printf("Press 3 --> Delete duplicates\n");
        printf("Press 0 --> Stop program\n");
        scanf("%d", &scelta);

        if(scelta==1) {
            stampaLista(head);
        }
        else if(scelta==2) {
            insert(head);
        }
        else if(scelta==3) {
            deleteDuplicates(head);
        }
        else if(scelta==0) {
            printf("See you soon ;)\n");
        }

        }

}
</code>```

答:
I found a good function to delete duplicates also with the help of other users.
This is the code:</p>
```<code>void deleteDuplicates(NODO* head) {
        while(head != NULL && head->next != NULL) {
            NODO* nodoQuad = head;
            while(nodoQuad->next != NULL) {
            if(head->q.lato == nodoQuad->next->q.lato &&
               head->q.v.x == nodoQuad->next->q.v.x &&
               head->q.v.y == nodoQuad->next->q.v.y) {
                   NODO* dealloca = nodoQuad->next;
                   nodoQuad->next = nodoQuad->next->next
                   free(dealloca);
                   printf("Element deleted!\n");
               } else {
                   nodoQuad = nodoQuad->next;
               }
        }
        head = head->next;
        }
}
</code>```

Body:
Hi I'm creating a program for school where I have to:

Create structures

Create functions to print my linked list

Create functions to insert an element to the bottom of the list

Delete duplicate elements.

I created all a part the last one step(delete function). Can you help me to know what is the right way? This is my code:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

/*STRUCTURE*/
typedef struct punto {
    int x;
    int y;
} PUNTO;

typedef struct quadrato {
    PUNTO v;
    int lato;
} QUADRATO;

typedef struct nodo {
    QUADRATO q;
    struct nodo *next;
} NODO;

/*PRINT LIST*/
void stampaQuadrato(QUADRATO q) {
    printf("The square has the side equal to %d and coordinates of the lower left vertex (%d,%d)\n", q.lato, q.v.x, q.v.y);
}

void stampaLista(NODO *head) {
    if(head->next==NULL) {
        printf("List empty!\n");
    } else {
        while(head->next != NULL) {
            head = head->next;
            stampaQuadrato(head->q);
        }
    }
}

/*ADD*/
QUADRATO creaQuadrato() {

    QUADRATO nuovo;

    printf("Side measurement: ");
    scanf("%d", &nuovo.lato);
    printf("\n");
    printf("Coordinates of the lower left vertex\n");
    printf("x: ");
    scanf("%d", &nuovo.v.x);
    printf("\n");
    printf("y: ");
    scanf("%d", &nuovo.v.y);
    printf("\n");

    return nuovo;

}

void insert(NODO *head) {
    NODO* nuovoNodo = malloc(sizeof(NODO));
    nuovoNodo->q = creaQuadrato();
    if(head==NULL) {
        head = head->next;
        head = nuovoNodo;
    } else {
        while(head->next != NULL) {
            head = head->next;
        }
        head->next = nuovoNodo;
    }
}

/*DELETE*/
void deleteDuplicates(NODO *head) {
    if(head==NULL) {
        printf("There are no element in the list!\n");
    } else {
        while(head->next != NULL) {
            if(head->q.lato == head->next->q.lato &&
               head->q.v.x == head->next->q.v.x &&
               head->q.v.y == head->next->q.v.y) {
                   NODO* nodoQuad = head->next;
                   head->next = nodoQuad->next;
                   //head->next = head->next->next;
                   free(nodoQuad);
                   printf("Element deleted!\n");
               } else {
                   head = head->next;
               }
        }
    }
}

int main() {
    NODO *head = malloc(sizeof(NODO));
    head->next = NULL;
    int scelta = -1;

    while(scelta != 0) {
        printf("Choose one\n");
        printf("Press 1 --> See list\n");
        printf("Press 2 --> Insert new square(quadrato)\n");
        printf("Press 3 --> Delete duplicates\n");
        printf("Press 0 --> Stop program\n");
        scanf("%d", &scelta);

        if(scelta==1) {
            stampaLista(head);
        }
        else if(scelta==2) {
            insert(head);
        }
        else if(scelta==3) {
            deleteDuplicates(head);
        }
        else if(scelta==0) {
            printf("See you soon ;)\n");
        }

        }

}

Body:
I found a good function to delete duplicates also with the help of other users.
This is the code:

void deleteDuplicates(NODO* head) {
        while(head != NULL && head->next != NULL) {
            NODO* nodoQuad = head;
            while(nodoQuad->next != NULL) {
            if(head->q.lato == nodoQuad->next->q.lato &&
               head->q.v.x == nodoQuad->next->q.v.x &&
               head->q.v.y == nodoQuad->next->q.v.y) {
                   NODO* dealloca = nodoQuad->next;
                   nodoQuad->next = nodoQuad->next->next
                   free(dealloca);
                   printf("Element deleted!\n");
               } else {
                   nodoQuad = nodoQuad->next;
               }
        }
        head = head->next;
        }
}


问:
Set Tooltip over line Chartjs
I wanna show tooltips over the line not only on data points.
I also tried the chartjs-plugin-crosshair but it doesn't work in V3 of chartjs.

答:
The following combination of chartjs-plugin-crosshair and chart.js seems to be working fine for me.

"chart.js": "^3.4.0",
"chartjs-plugin-crosshair": "^1.2.0"
```
<p>I am initiating the <code>Chart</code> object like below:</p>
<pre class="lang-js prettyprint-override"><code>Chart.register(CrosshairPlugin);
</code>```

Which can be used properly in an useEffect block:

useEffect(() =>
  Chart.register(CrosshairPlugin);
  return () => {
    Chart.unregister(CrosshairPlugin);
  };
}, []);
```
<p>And then you can pass the options of the chart like below:</p>
```{
  ...,
  options: {
    plugins: {
      crosshair: {
        line: {
          color: "#d1d1d1",
          width: 1,
        },
        sync: {
          enabled: true,
          group: 1,
          suppressTooltips: false,
        },
        zoom: {
          enabled: false,
        },
      }
    }
  }
}
```

Note that the configurations above, will keep the crosshair pointer synced over all your charts rendered on the same component. You may need to change the behavior here.

Title: Set Tooltip over line Chartjs

Body:
The following combination of chartjs-plugin-crosshair and chart.js seems to be working fine for me.

"chart.js": "^3.4.0",
"chartjs-plugin-crosshair": "^1.2.0"

I am initiating the Chart object like below:

Chart.register(CrosshairPlugin);

Which can be used properly in an useEffect block:

useEffect(() =>
  Chart.register(CrosshairPlugin);
  return () => {
    Chart.unregister(CrosshairPlugin);
  };
}, []);

And then you can pass the options of the chart like below:

{
  ...,
  options: {
    plugins: {
      crosshair: {
        line: {
          color: "#d1d1d1",
          width: 1,
        },
        sync: {
          enabled: true,
          group: 1,
          suppressTooltips: false,
        },
        zoom: {
          enabled: false,
        },
      }
    }
  }
}

Note that the configurations above, will keep the crosshair pointer synced over all your charts rendered on the same component. You may need to change the behavior here.


问:
Upgrading Azure AKS without downtime
I was looking for method to upgrade k8s version without downtime for Azure AKS and found this amazing blog post https://omichels.github.io/zerodowntime-aks.html but I got error at the start only

So currently running version of k8s in my region is no more available. When I tried to create a temporary nodepool got below error

```<code>(AgentPoolK8sVersionNotSupported) Version 1.19.6 is not supported in this region.
Please use [az aks get-versions] command to get the supported version list in this region.
For more information, please check https://aka.ms/supported-version-list
</code>```

What can I do to achieve zero downtime upgrade?

答:
Here is how I upgraded without downtime, for your reference.

Upgrade control plane only. (Can finish it on azure portal)

Add a new Node pool. Now the version of new node pool is higher(same with control plane). Then add a label to it, e.g.  nodePool=newNodePool.

Patch all application to the new node pool. (By nodeSelector)

$ kubectl get deployment -n {namespace} -o name | xargs kubectl patch -p "{\"spec\":{\"template\":{\"spec\":{\"nodeSelector\":{\"nodePool\":\"newNodePool\"}}}}}" -n {namespace}

Check the pods if are scheduled to the new node pool.

$ kubectl get pods -owide

Delete the old node pool.

Title: Upgrading Azure AKS without downtime

Body:
I was looking for method to upgrade k8s version without downtime for Azure AKS and found this amazing blog post https://omichels.github.io/zerodowntime-aks.html but I got error at the start only

So currently running version of k8s in my region is no more available. When I tried to create a temporary nodepool got below error

(AgentPoolK8sVersionNotSupported) Version 1.19.6 is not supported in this region.
Please use [az aks get-versions] command to get the supported version list in this region.
For more information, please check https://aka.ms/supported-version-list

What can I do to achieve zero downtime upgrade?