Cannot resolve driver when loaded through a deployed war #293
Replies: 11 comments
-
|
We had the similar experience when we set this up using a war and tomcat back in December. We just made sure there was a bean defined for the native jdbc driver, so that this error wouldn't occur. It wasn't used directly by our app, but it just needed to be called/defined, then the secret manager jdbc driver was able to find it and it worked successfully. |
Beta Was this translation helpful? Give feedback.
-
|
Our current solution passed by setting the drivermanagerprotection to false on the jre memory leak prevention listener on our server.xml, but this doesnt seem too clean. For more information: https://tomcat.apache.org/tomcat-8.0-doc/config/listeners.html#JRE_Memory_Leak_Prevention_Listener_-_org.apache.catalina.core.JreMemoryLeakPreventionListener |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I have the same behaviour, the workaround to set driverManagerProtection to false worked for me as well. |
Beta Was this translation helpful? Give feedback.
-
|
I encountered this issue. Since, i have access to the code, I loaded the driver using class loader. The issue is gone. But this is still a workaround as it does not solve the real issue. I was using the postgresql driver. I have overwritten one of the posgresql classes similar to MySql classes. |
Beta Was this translation helpful? Give feedback.
-
I am getting exact same error. Can you please let me know how you used class loader to load postgresql driver ? |
Beta Was this translation helpful? Give feedback.
-
|
I overritten getDefaultDriverClass method inside AWSSecretsManagerPostgreSQLDriver.java ( as I was using postgres) to load the postgresql driver. JUst do a Class.forName("org.postgresql.Driver", false, this.getClass().getClassLoader());. AFter this the issue with driver load was gone. |
Beta Was this translation helpful? Give feedback.
-
|
Can one elaborate exactly what the line is that needs to get inserted into the server.xml file? @gregory-viale-cbp @devportilla would it look like this?? --> |
Beta Was this translation helpful? Give feedback.
-
|
@nehamallama Your server xml should have the following line : |
Beta Was this translation helpful? Give feedback.
-
|
@devportilla thanks it works. Can confirm that this issue is still active/this solution will temporarily mitigate the error. ~best |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for opening this issue - we are looking into it. |
Beta Was this translation helpful? Give feedback.
-
|
This issue will be resolved by adding driver jar in tomcat lib (in case of externalized tomcat). |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Im having issues while trying to use the connector on a regular spring-boot war deployed artifact on tomcat. So far i have seen the following:
Setup is:
-Packaging type: war
-Spring boot version: 1.3.5.RELEASE with the following starters:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>-Aws secretsmanager jdbc version: 1.0.2
This is happening only when the artifact is a war file and not jar launched application, with the embedded tomcat instead of the external one.
Some guidance would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions