-
1. Re: java.lang.ClassNotFoundException: org.postgresql.Driver
jaikiran Jul 10, 2019 3:08 AM (in response to pmenage)Are you doing any Class.forName(...) calls on the JDBC driver from within your application? If not, I don't see why it would try to load that class in the context of your deployment classloader.
If you are indeed referring to the JDBC driver class within your application, then add a module dependency of the JDBC module (org.postgresql in this example), to your application (myejb.jar). You can do that by following the instructions here Class Loading in WildFly - Latest WildFly Documentation - Project Documentation Editor (see section "Dependencies: Manifest Entries")
-
2. Re: java.lang.ClassNotFoundException: org.postgresql.Driver
pmenage Jul 10, 2019 5:14 AM (in response to jaikiran)Thank you for your answer. I had the solution from an answer received from Stack Overflow (https://stackoverflow.com/questions/56930075/why-wildfly-does-not-find-the-postgresql-driver), which was to use jboss-deployment-structure file which I put in folder ejbModule\Meta-Inf. its content is:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.postgresql"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
To summarise, I had to create a module.xml, file a jboss-deployment-structure.xml file and to modify the standalone.xml file.
Regards
Patrick