So I have this application that connects to DB via simple JDBC written in Scala. Everything works fine until I'm trying to run it inside Docker container, there I'm getting the infamous Error during processing of request: 'No suitable driver found for "jdbc:postgresql://0.0.0.0:5439/dev"
I've built a fat jar and when I'm running it on my machine - everything works fine, but the same fat jar that has been put inside docker container via
FROM java:8
COPY target/scala-2.13/loader-0.1.jar /fatjar.jar
CMD ["java", "-jar", "fatjar.jar"]
just can't connect. When I'm trying to debug - I see that driver is there:
val dm = DriverManager.getDrivers()
while (dm.hasMoreElements()) {
println(dm.nextElement().getClass())
}
spits out the same output both on my machine and inside docker. Can anyone point me to a possible piece that I'm missing?