CorruptModelException during work item execution - autodesk-forge

I'm totally new with the Forge design-automation (V3 Beta)
During the work item execution inside the design-automation framework, the CorruptModelException is thrown.
The model (.rvt) being sent will open without problem in the desktop environment (R2018).
I tried to purge unused and resaved, but it didn't help. Here's the part from the log that tells the problem.
[04/17/2019 10:11:16] Found an addIn for registration: xxx.addin
[04/17/2019 10:11:16] Initializing RCE....
[04/17/2019 10:11:16] Initializing RevitCoreEngine (and possibly running stub installer)...
[04/17/2019 10:11:16] Language not specified, using English as default
[04/17/2019 10:11:18] Initialize and get RCE: (VersionBuild) 18.0.0.0 (VersionNumber) 2018 (SubVersionNumber) 2018.3
[04/17/2019 10:11:18] Autodesk.Revit.Exceptions.CorruptModelException: The model could not be opened: Unspecified error
[04/17/2019 10:11:18] (COleException 0x80004005)
[04/17/2019 10:11:18] at Autodesk.Revit.ApplicationServices.Application.OpenDocumentFile(String fileName)
[04/17/2019 10:11:18] at DesignAutomationFramework.DesignAutomationData..ctor(Application revitApp, String mainModelPath)
[04/17/2019 10:11:18] at DesignAutomationFramework.DesignAutomationReadyEventArgs..ctor(Application revitApp, String mainModelPath)
[04/17/2019 10:11:18] at DesignAutomationFramework.DesignAutomationBridge.SetDesignAutomationReady(Application revitApp, String mainModelPath)
[04/17/2019 10:11:18] at RevitCoreEngineTest.RceConsoleApplication.Program.UserMain(CommandLineArgs cl)
[04/17/2019 10:11:22] RESULT: Failure - Result of running user app is failure
[04/17/2019 10:11:22] Finished running. Process will return: TestError
[04/17/2019 10:11:22] ====== Revit finished running: revitcoreconsole ======
[04/17/2019 10:11:22] Process exit code: 4
[04/17/2019 10:11:22] End Revit Core Engine standard output dump.
[04/17/2019 10:11:22] Error: Application revitcoreconsole.exe exits with code 4 which indicates an error.
[04/17/2019 10:11:22] End script phase.
[04/17/2019 10:11:22] Error: An unexpected error happened during phase CoreEngineExecution of job.
[04/17/2019 10:11:22] Job finished with result FailedExecution
One example file I'm tryuing to use can be found from here:
https://www.dropbox.com/s/chffmh62wlmuwx7/empty.rvt?dl=0
Could someone test, whether he can use this with Revit 2018 design automation.
I'm also a bit confused about Workitem API. The documentation says that I NEED to use 3 legged auth. (which seems to be awfully difficulty as it requires additional signatures in the request (?)...), but the step by step guide shows it with 2-legged, which is otherwise working OK for me too. This is probably not the reason to my difficulties.
Any ideas...?

The link the provided in the comments is not a direct download link. If you click on the link, it takes you to a webpage:
https://www.dropbox.com/s/chffmh62wlmuwx7/empty.rvt?dl=0
The workitem input arguments need a direct download link to be able to process the file correctly. For example, a direct download link to the exact same file is
https://dl.dropboxusercontent.com/s/chffmh62wlmuwx7/empty.rvt

Related

Revit Design Automation failedExecution with code -536852669

I was running a workitem on Design Automation for Revit, and it crashed with code 536852669. Looking at the log, it seems like it had almost finished the job when it crashed:
[06/08/2022 20:55:21] End Revit Core Engine standard output dump.
[06/08/2022 20:55:21] Error: Application revitcoreconsole.exe exits with code -536852669 which indicates an error.
[06/08/2022 20:55:21] End script phase.
[06/08/2022 20:55:21] Error: An unexpected error happened during phase CoreEngineExecution of job.
[06/08/2022 20:55:21] Job finished with result FailedExecution
The addon is a custom exporter (based on IExportContext) and was processing a relatively large model (7GB of Revit files). Any idea what may have caused the crash?

Each project is throwing ControllerConnectionException on startup

Ok, I don't rly know where to start, but let's do this.
So for two weeks I had my last working day where everything was working fine in VS 2019 (16.11.4). Today I wanted to start a project, and i got the following error message:
Unfortunately, a process used by VS has encountered an unrecoverable error.
Stack Trace:
Microsoft.ServiceHub.Client.ControllerConnectionException : Controller terminated before accepting connections. Exit code: -1073741674.
at async Microsoft.ServiceHub.Client.HubControllerClient.StartAsync(<Unknown Parameters>)
at async Microsoft.ServiceHub.Client.HubClient.LaunchOrFindControllerAsync(<Unknown Parameters>)
at async Microsoft.ServiceHub.Client.HubClient.GetLocationServiceAsync(<Unknown Parameters>)
at async Microsoft.ServiceHub.Utility.Shared.ServiceHubRetry.ExecuteAsync[TReturnType](<Unknown Parameters>)
at async Microsoft.ServiceHub.Utility.Shared.ServiceHubRetry.ExecuteAsync[TReturnType](<Unknown Parameters>)
at async Microsoft.ServiceHub.Client.HubClient.GetThisAsRemoteServiceBrokerAsync(<Unknown Parameters>)
at async Microsoft.ServiceHub.Client.HubClient.<Reset>b__54_0(<Unknown Parameters>)
at async Microsoft.VisualStudio.Threading.AsyncLazy`1.<>c__DisplayClass13_0.<GetValueAsync>b__0[T](<Unknown Parameters>)
at async Microsoft.ServiceHub.Client.HubClient.GetPipeAsync(<Unknown Parameters>)
at async Microsoft.ServiceHub.Client.HubClient.RequestServiceAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.Remote.ServiceHubRemoteHostClient.RequestServiceAsync(<Unknown Parameters>)
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Followed by another error:
There was an error activating the remote language server. Plese select Help > Send Feedback > Report a problem.
These errors also appear, when I create a new project. The only way I can start VS19 without errors is, when I click "Continue without code" in the popup.
So I tried to repair or modify VS. When I want to repair it, it failed. The popup which is prepairing the repair info is shutting down with no error message.
I didn't find that much information in the internet, especially with the error code.
Furthermore I detected, that I cannot install or uninstall VS19. Plus, I cannot install VS22, because it is aborting again after the "preparing the VS installer". Again no error is poping up.
A sample log:
[2cf4:0001][2021-12-15T17:45:47] Saving the current locale (de-DE) to user.json.
[2cf4:0001][2021-12-15T17:45:47] Setting the telemetry services
[2cf4:0004][2021-12-15T17:45:47] Creating a new telemetry service.
[2cf4:0001][2021-12-15T17:45:47] Visual Studio Installer Version: 3.0.4496
[2cf4:0001][2021-12-15T17:45:47] Raw Command line: "C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe"
[2cf4:0001][2021-12-15T17:45:47] Using registry value of (1) to theme installer.
[2cf4:0001][2021-12-15T17:45:47] Getting singleton lock. Mutex name: DevdivInstallerUI
[2cf4:0004][2021-12-15T17:45:47] Telemetry session ID: ...
[2cf4:0001][2021-12-15T17:45:47] Getting singleton lock succeed.
[2cf4:0006][2021-12-15T17:45:47] Creating new ExperimentationService
[2cf4:0006][2021-12-15T17:45:47] Telemetry property VS.ABExp.Flights : lazytoolboxinit;fwlargebuffer;refactoring;spmoretempsbtn1;asloff;keybindgoldbarext;asynccsproj;vsfricheditor;completionapi;tn-vsmacnps-7;toggleblockcomment;tasmigddvs;multitenanttasmigration_002;vsfdevcom2;lsprmsgvol;debugger-init-asynccf;vswnewinstaller;links_carousel_tfl;azure_links_tf
**[2cf4:0003][2021-12-15T17:45:47] An abnormal shutdown was detected from the previous telemetry session.**
[2cf4:0004][2021-12-15T17:45:47] Telemetry property vs.willow.source : WPF
[2cf4:0004][2021-12-15T17:45:47] Telemetry property vs.willow.locale : de-DE
[2cf4:0004][2021-12-15T17:45:47] Telemetry property vs.willow.installerversion : 3.0.4496.34889
[2cf4:0004][2021-12-15T17:45:47] Telemetry property vs.willow.startmethod : direct
[2cf4:0004][2021-12-15T17:45:47] Telemetry property vs.willow.activityid : ...
[2cf4:0004][2021-12-15T17:45:47] Telemetry property vs.willow.campaign : 70
[2cf4:0004][2021-12-15T17:45:47] Telemetry property vs.willow.passive : False
[2cf4:0004][2021-12-15T17:45:47] Telemetry property vs.willow.quiet : False
[2cf4:0004][2021-12-15T17:45:47] Telemetry property vs.willow.processtype : ui
[2cf4:0001][2021-12-15T17:45:47] Monitor center position: 960, 585
[2cf4:0001][2021-12-15T17:45:47] Showing the window.
I didn't really know what Telemetry was for. Can this cause any issues due to fireall/network problems, that I cannot install, repair, uninstall VS?
With sfc /scannow I got following lines:
2021-12-16 16:25:52, Info CSI 00000293 [SR] Cannot repair member file [l:15]'mscorlib.ni.dll' of NetFx4-mscorlib_ni, version 4.0.15805.350, arch amd64, versionScope neutral, pkt {l:8 b:b03f5f7f11d50a3a} in the store, hash mismatch
2021-12-16 16:25:52, Info CSI 00000294 [SR] This component was referenced by [l:78]'Package_3_for_KB5004331~31bf3856ad364e35~amd64~~10.0.4400.1.5004331-51_neutral'
2021-12-16 16:25:52, Info CSI 00000295 Hashes for file member [l:15]'mscorlib.ni.dll' do not match.
2021-12-16 16:25:52, Info CSI 00000297 [SR] Could not reproject corrupted file \??\C:\Windows\Microsoft.NET\Framework64\v4.0.30319\NativeImages\\mscorlib.ni.dll; source file in store is also corrupted
Does this have any connection to my general problem?
Maybe(!) a very similar problem, this guy was facing:
https://developercommunity.visualstudio.com/t/visual-studio-installer-vs2019-keep-crashing-sudde/711824
So... (further) things I tried:
Installed .NET Frameworks again
Tried the reapair tools for VS and .NET
Tried to repair VS19, but I cant
Run sfc scannow
Run chkdsk scan
Several reboots, restarting VS, ...

Autodesk Forge third party updater dialog issue

We can open Revit files on Autodesk forge but recently we have run into a Revit file that have content from a third party plugin. When you open the file manually you get this dialog:
We think this dialog is causing this file to stop from loading the file further. Our question is how can we suppress this dialog.
We've added the Custom Failure Handling (as suggested), but it seems that this code is not even executed: we don't see any logs. The failure seems to occur directly after our log when our plugin starts (see ** Plugin code starts here.)
...
Running RevitAssemblyResolver....
Initializing RevitCoreEngine...
Selected Revit\RCE install Path: (from app.config) C:\RevitDir
Resolving location of Revit/RevitCoreEngine installation...
Running user application....
Found an addIn for registration: PlugIn01.addin
Initializing RCE....
Initializing RevitCoreEngine (and possibly running stub installer)...
Language not specified, using English as default
application.ActiveAddInId.GetGUID() = 000bd853-36e4-461f-9171-c5aceda4e724
** Plugin code starts here.
Initialize and get RCE: (VersionBuild) 18.0.0.0 (VersionNumber) 2018 (SubVersionNumber) 2018.3
Autodesk.Revit.Exceptions.InternalException: An internal error has occurred.
at Autodesk.Revit.ApplicationServices.Application.OpenDocumentFile(ModelPath modelPath, OpenOptions openOptions)
at DesignAutomationFramework.DesignAutomationData..ctor(Application revitApp, String mainModelPath)
at DesignAutomationFramework.DesignAutomationReadyEventArgs..ctor(Application revitApp, String mainModelPath)
at DesignAutomationFramework.DesignAutomationBridge.SetDesignAutomationReady(Application revitApp, String mainModelPath)
at RevitCoreEngineTest.RceConsoleApplication.Program.UserMain(CommandLineArgs cl)
RESULT: Failure - Result of running user app is failure
Finished running. Process will return: TestError
====== Revit finished running: revitcoreconsole ======
...
What we eventually did to have a successful run, was to recreate a new central file. Maybe the file was corrupt to start with.

An unexpected error happened during phase Publishing of job

I am trying to use the ForgeApp with Revit. For the same I am trying to execute the workitem from Postman. During the execution I am getting below error.
An unexpected error happened during phase Publishing of job.
The parts of the actual report (after removing some of the sensitive info) is as follows:
[10/15/2020 05:45:24] Finished running. Process will return: Success
[10/15/2020 05:45:24] ====== Revit finished running: revitcoreconsole ======
[10/15/2020 05:45:25] End Revit Core Engine standard output dump.
[10/15/2020 05:45:25] End script phase.
[10/15/2020 05:45:25] Start upload phase.
[10/15/2020 05:45:25] Error: Non-optional output [result.json] is missing.
[10/15/2020 05:45:25] Error: An unexpected error happened during phase Publishing of job.
[10/15/2020 05:45:25] Job finished with result FailedMissingOutput
[10/15/2020 05:45:25] Job Status:
From the error it is clear that the Plugin has failed in processing but it gives give much idea as to why it has failed . After receiving this error, I tried to debug locally by following https://forge.autodesk.com/blog/design-automation-debug-revit-plugin-locally
But during debugging it is failing with below error while Executing the Plugin itself. It executes the Onstartup without any issues but after that it is not going in HandleDesignAutomationReadyEvent.
Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0xdb9b8a8d, on thread 0x3784*
So I am not sure what to ahead to resolve this. If I can get this working somehow in the Local with Debugger or through Postman then it would help.
Further update - I have now found the root cause. Even though it was complaining about the missing output file leading me to believe the code was not running properly, the actual root cause was that it was not finding the model from the inputFile parameter. This became clear once I tried putting Console.Write in the Plugin code and then debugging became easy. I wasn't sure Console would be printed in the output at first and hence turned the debug logs off at first . But as I didn't have any other means to have the verbose logging , I put in lots of Console write and now got to know the root cause. Thanks

Spring Boot: Jdbc javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify

I am currently learning more about implementing JDBC and using databases in a Spring Boot webapp, and I encountered the following Stack Trace written in the bottom of the post.
I have created a simple Employee model, and I am trying to execute some database code on the same class which my main() lies in. The model and the main class are the only two java files existing in this whole project. I am trying to implement the following run() code that overrides the one from the interface, CommandLineRunner, but I do not get the logs that should come after log.info("Part A:"):
log.info("Part A:")
employees.forEach(employee -> {log.info(employee.toString());
log.info("part a");});
--Things I noticed:
I noticed that the last line of the log before the stack trace starts comes from: "Thread-1" instead of "main". I think that means that a thread from somewhere other than the main encountered an error and closed connection before when it should close normally.
Also, I think that because HikariPool closed before "peer's close_notify", which I presume that it refers to the normal closure of HikariPool, I am not able to see the final bit of logging that I have kept trying to procure. The final bit of logging that I want to see is the logging of the employee that has become inserted into my database.
The final bit of logging that I want to see should be procured from this line of code:
employees.forEach(employee -> {log.info(employee.toString());
log.info("part a");});
--Things to note:
Because of this line in the log, I thought I would see the employee inserted into my database, but when I queried directly on MySQL Command Line Client, it returned an empty set:
2018-11-03 21:08:35.362 INFO 2408 --- [ main] c.j.jdbctest1.JdbcTest1Application : rows affected: 1
I don't understand why a row has been affected when nothing has been inserted into the database.
The stacktrace and logs: (The stacktrace pasted below actually repeats itself several more times but I cut it off for brevity.)
2018-11-03 21:08:32.997 INFO 2408 --- [ main] c.j.jdbctest1.JdbcTest1Application : Starting JdbcTest1Application on KitKat with PID 2408 (C:\Users\Nano\Downloads\jdbc-test1\jdbc-test1\target\classes started by Nano in C:\Users\Nano\Downloads\jdbc-test1\jdbc-test1)
2018-11-03 21:08:33.003 INFO 2408 --- [ main] c.j.jdbctest1.JdbcTest1Application : No active profile set, falling back to default profiles: default
2018-11-03 21:08:33.770 INFO 2408 --- [ main] c.j.jdbctest1.JdbcTest1Application : Started JdbcTest1Application in 1.024 seconds (JVM running for 1.778)
2018-11-03 21:08:33.770 INFO 2408 --- [ main] c.j.jdbctest1.JdbcTest1Application : Creating tables
2018-11-03 21:08:33.770 INFO 2408 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2018-11-03 21:08:34.082 INFO 2408 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2018-11-03 21:08:35.135 INFO 2408 --- [ main] c.j.jdbctest1.JdbcTest1Application : Inserting Baggins Hopkins
2018-11-03 21:08:35.362 INFO 2408 --- [ main] c.j.jdbctest1.JdbcTest1Application : rows affected: 1
2018-11-03 21:08:35.362 INFO 2408 --- [ main] c.j.jdbctest1.JdbcTest1Application : Querying for employee
2018-11-03 21:08:36.065 INFO 2408 --- [ main] c.j.jdbctest1.JdbcTest1Application : Part A:
2018-11-03 21:08:36.065 INFO 2408 --- [ Thread-1] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
Sat Nov 03 21:08:36 KST 2018 WARN: Caught while disconnecting...
EXCEPTION STACK TRACE:
** BEGIN NESTED EXCEPTION **
javax.net.ssl.SSLException
MESSAGE: closing inbound before receiving peer's close_notify
STACKTRACE:
javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:129)
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:264)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:255)
at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:645)
at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:624)
at com.mysql.cj.protocol.a.NativeProtocol.quit(NativeProtocol.java:1312)
at com.mysql.cj.NativeSession.quit(NativeSession.java:182)
at com.mysql.cj.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:1750)
at com.mysql.cj.jdbc.ConnectionImpl.close(ConnectionImpl.java:720)
at com.zaxxer.hikari.pool.PoolBase.quietlyCloseConnection(PoolBase.java:135)
at com.zaxxer.hikari.pool.HikariPool.lambda$closeConnection$1(HikariPool.java:441)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
** END NESTED EXCEPTION **
The Java Code:
#SpringBootApplication
public class JdbcTest1Application implements CommandLineRunner {
private static final Logger log = LoggerFactory.getLogger(JdbcTest1Application.class);
#Autowired
JdbcTemplate jdbcTemplate;
public static void main(String[] args) {
SpringApplication.run(JdbcTest1Application.class, args);
}
#Override
public void run(String... args) throws Exception {
log.info("Creating tables");
jdbcTemplate.execute("DROP TABLE IF EXISTS employees");
jdbcTemplate.execute("CREATE TABLE employees (emp_id int, name varchar(100), role varchar(100), status varchar(100))");
log.info("Inserting Baggins Hopkins");
int rowsAffected = jdbcTemplate.update("INSERT INTO EMPLOYEE(EMP_ID, NAME, ROLE, STATUS)"
+ " VALUES(1,'Baggins Hopkins','thief','WORKING')");
log.info("rows affected: "+ Integer.toString(rowsAffected));
log.info("Querying for employee");
String sql = "SELECT emp_id,name,role,status FROM employees";
List<Employee> employees = jdbcTemplate.query(sql,(rs, rowNum)->
new Employee(rs.getInt("emp_id"), rs.getString("name"),
rs.getString("role"),Status.valueOf(rs.getString("status"))));
log.info("Part A:");
employees.forEach(employee -> {log.info(employee.toString());
log.info("part a");});
}
}
Also just in case this matters, I pasted this code from application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/employee_database
spring.datasource.username=employee
spring.datasource.password=employee
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
The SSL connection to the database is failing, try changing your datasource URL to:
spring.datasource.url=jdbc:mysql://localhost:3306/employee_database?useSSL=false
The warning looks like a MySQL driver bug with Java 11 and SSL enabled : https://bugs.mysql.com/bug.php?id=93590
Deactivating encryption because of a driver warning is a bad idea.
Your insertion problem looks more like a classic transaction issue though, I doubt it is related to the SSL warning.
This Worked for me
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
<version>8.0.20</version>
</dependency>
I also faced the same issue.
if you look the the stacktrace, it's cleary mentioned what to do -
Sat Mar 16 09:00:01 IST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'.
You need either to explicitly disable SSL by setting **useSSL=false**, or set **useSSL=true** and provide truststore for server certificate verification.
so after disabling the ssl by making changes in data source url solved the problem -
spring.datasource.url=jdbc:mysql://localhost:3306/security?useSSL=false
To solve this problem, it took me about three days.
(Edit: This is a workaround for testing and not actually a solution.)
At first, I started solving the problem from trying to configure my own SSL for mysql, and I spent quite a few hours on that. Too much time had passed until I realized configuring it had to do with Cmake and C++, which made me give up. It was very frustrating. However I did not give up and tried to disable SSL entirely through a method that hasn't been found. And I eventually did find the method. Here it is:
You have to use the legacy password for MySQL. The legacy password is the way MySQL authenticated things in version 5.7x.
Open up the MySQL installer again, and reconfigure the MySQL Server settings.
When you get there you will see this screen:
The screen that you should get to
You might get some errors when reaching the final stage of the reconfiguration:
I had problems at the final stage I had no idea how to fix so I uninstalled MySQL altogether. I use windows. I deleted the MySQL project root directory from Program Files to uninstall MySQL. I also deleted the databases saved in Program Data (a hidden folder in the C Drive) because I wanted to start afresh(WARNING: this will delete all your previously saved data!). Uninstalling MySQL from the control panel might not be enough to completely erase MySQL from your computer.
Delete all *.pem files in C:\ProgramData\MySQL\MySQL Server 8.0\Data. (or move it somewhere else, which is what I did)
You might not see ProgramData in the C Drive. That is because it is a hidden folder. In order to see hidden folders:
search for folder options in the control panel.
Go to view.
Under 'Advanced settings' and under 'Hidden files and folders' of that, click "Show hidden files, folders, and drives."
Go to C:\ProgramData\MySQL\MySQL Server 8.0 and open my.cnf (or my.ini). Add the following line after [mysqld]:
ssl=0
Then save. It should work now.
References:
https://community.atlassian.com/t5/Confluence-questions/MySQL-Public-Key-Retrieval-is-not-allowed/qaq-p/778956
https://scalegrid.io/blog/configuring-and-managing-ssl-on-your-mysql-server/
My similar problem in a tomcat trying to conect via ssl to Aurora mysql (AWS)
I solved the problem by updating the driver version from 'mysql-connector-java-5.1.40.jar' to 'mysql-connector-java-5.1.49.jar', and installing a root CA into ceacerts:
keytool -import -trustcacerts -file rds-ca-2019-root.pem -keystore /<your_java_home>/lib/security/cacerts
Hope be use to you
Try using the following URL. As they suggested use useSSL=false Also, Make sure to use <&amp> instead of just & when you have multiple properties defined in your URL.
jdbc:mysql://localhost:3306/TestDB?serverTimezone=PST&useSSL=false
I was also facing the same issue
But then i updated the mysql-connector-java version from 5.1.46 to 8.0.20 and by changing com.mysql.jdbc.Driver to com.mysql.cj.jdbc.Driver
it solved my issue
My similary prolem is in spark,
I solove the problem by down the java verion from
'openjdk version "1.8.0_275"' to 'openjdk version "1.8.0_265"',
hope be use to you
I had this issue and decided to use Carrier Pigeon Protocol's solution until I accidentally solved it by updating Tomcat from version 9.0.12 to 9.0.16.
I faced a similar issue when I upgraded the Java version in my server to 11 from 8.
The spring boot started supporting Java 11 from 2.1 and onwards. So make sure your project's dependencies are also updated accordingly. This is relevant for this answer as SpringBoot also influence MySQL connector, Hibernate core, and other dependencies.
The inability to connect to DB was resulting in some more NoClassDefFoundErrors. So make sure you solve this first before looking into other errors.
An example pom dependency for the SpringBoot starter
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.12.RELEASE</version>
<relativePath />
</parent>
Hope this helps someone.
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: name-unit] Unable to build Hibernate SessionFactory
I had exactly the same problem, I also modified a false my useSSL like this useSSL=false and it works fine.
I think for those who use intelliJ ultimate the error the problem does not arise. But for those who use the community version "yes" also for those who are on netbeans like my case. This concerns the management of persistence.xml files and the EntityManagerHolder file
Rather than disabling SSL/TLS I appended the following to the database connection string: &enabledTLSProtocols=TLSv1.2