I have a problem with deploying the spring boot application after I delete the database and create new. When I deploy it I got an following exception:
29-Jan-2023 00:16:21.058 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [ROOT] registered the JDBC driver [com.mysql.cj.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 29-Jan-2023 00:16:21.059 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [mysql-cj-abandoned-connection-cleanup] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
I read online, and I try the couple of methods and didn't work reference to the Stack Overflow answer: answer When i move the MySQL driver to tomcat lib folder, I got another exception for class witch is not mark as entity:
javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: persistent class not known
Locally everything working fine. Any clues how to fix the issue, I don't have rights to restart the MySQL database at the moment and I search for fix.
From the answer I only create that class I am not sure if i need to call it somewhere.