I have written custom java ssl factory and not using the default SSL Factory (org.postgresql.ssl.DefaultJavaSSLFactory) while attempting SSL handshake to postgreSQL
jdblUrl = jdbc:postgresql://hostname:port/dbName?sslmode=verify-ca&sslfactory=PathToMyCustomJavaSSLFactory
Custom SSL Factory class is in different jar file and I am trying to use in the main jar file. I am able to successfully use it while calling DB when I run the application locally in my eclipse. But, when I push the main jar to cloud foundry and try to run it, I am getting ClassNotFoundException for the custom SSL factory class. There are other classes in that jar file which I am able to call from main jar. But only for the custom ssl factory it is throwing ClassNotFoundException .
Can someone please help on what I might be missing.
Exception Trace:
{java.lang.ClassNotFoundException: com.cf.commons.db.ssl.CustomJavaSSLFactory","\tat java.net.URLClassLoader.findClass(URLClassLoader.java:449)","\tat java.lang.ClassLoader.loadClass(ClassLoader.java:482)","\tat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:384)","\tat java.lang.ClassLoader.loadClass(ClassLoader.java:415)","\tat java.lang.Class.forName0(Native Method)","\tat java.lang.Class.forNameFW(Class.java:362)","\tat java.lang.Class.forName(Class.java:270)","\tat org.postgresql.util.ObjectFactory.instantiate(ObjectFactory.java:50)","\tat org.postgresql.core.SocketFactoryFactory.getSslSocketFactory(SocketFactoryFactory.java:64)","\t... 77 more"] }
I am using Java 8