dependency-track icon indicating copy to clipboard operation
dependency-track copied to clipboard

postgresql jdbc error

Open vineshub opened this issue 4 years ago • 3 comments

os version:centos7.9 kernel5.4 docker version:20 postgresql version:9.6 dependency-track version:4.2.0

dependency-track-api container is not working.

this is error log:

ERROR [UpgradeMetaProcessor] Unable to load JDBC driver. java.lang.ClassNotFoundException: 'org.postgresql.Driver' at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) at java.base/java.lang.ClassLoader.loadClass(Unknown Source) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:538) at java.base/java.lang.ClassLoader.loadClass(Unknown Source) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Unknown Source) ................ ERROR [UpgradeInitializer] An error occurred determining database schema version. Unable to continue. alpine.upgrade.UpgradeException: Unable to load JDBC driver. at alpine.upgrade.UpgradeMetaProcessor.createConnection(UpgradeMetaProcessor.java:189) at alpine.upgrade.UpgradeMetaProcessor.(UpgradeMetaProcessor.java:62) at org.dependencytrack.upgrade.UpgradeInitializer.contextInitialized(UpgradeInitializer.java:53) at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:1068) at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:572) at org.eclipse.jetty.server.handler.ContextHandler.contextInitialized(ContextHandler.java:997) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:746) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1449) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1414) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:911) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) at org.eclipse.jetty.server.Server.start(Server.java:423) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97) at org.eclipse.jetty.server.Server.doStart(Server.java:387) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) at alpine.embedded.EmbeddedJettyServer.main(EmbeddedJettyServer.java:98) Caused by: java.lang.ClassNotFoundException: 'org.postgresql.Driver'

use H2 can working but external mod postgresql is not ,please help me

vineshub avatar Apr 01 '21 09:04 vineshub

@kalivenis Can you please attach your environment variables/configuration (mask sensitive data) set for the database connection? We have connected successfully to PostgreSQL databases using the settings recommended under the PostgreSQL example at https://docs.dependencytrack.org/getting-started/database-support/

grEvenX avatar Mar 25 '22 20:03 grEvenX

Hey, I am getting the same error when connecting AWS Aurora Postgre Database with API application hosted on AWS ECS with Fargate(Linux). Here is the dockerfile.


Use the dependencytrack/apiserver image as base image for the dtrack-apiserver service

FROM dependencytrack/apiserver

Set environment variables for the DependencyTrack API server

ENV ALPINE_DATABASE_MODE=external ENV ALPINE_DATABASE_URL=URL:5432/dtrack ENV ALPINE_DATABASE_DRIVER=org.postgresql.Driver ENV ALPINE_DATABASE_USERNAME= ENV ALPINE_DATABASE_PASSWORD=

Expose the DependencyTrack API server port

EXPOSE 8080

Set the command to start the DependencyTrack API server

CMD ["java", "-jar", "dependency-track-apiserver.jar"]


We have dtrack named database in Aurora.

Please let me know how to resolve it. @grEvenX @vineshub

mananJain01 avatar Jan 29 '24 06:01 mananJain01

Hey, I am getting the same error when connecting AWS Aurora Postgre Database with API application hosted on AWS ECS with Fargate(Linux). Here is the dockerfile. ...

Did you get this resolved?

chalbersma avatar May 15 '24 00:05 chalbersma