> We tried placing the pd4ml.lic file in the lib folder (same level as the pd4ml.jar)

It is definitely wrong. PD4ML can find pd4ml.lic in the classpath root (i.e WEB-INF/classes, when pd4ml.jar is in WEB-INF/lib) or in the work dir of the application (whose actual location is not always obvious). It cannot scan lib/ folders.

If the project structure is too complex and various JARs are locaed by different classloaders, sometimes it is the easiest just to pack pd4ml.lic to the root level of pd4ml.jar (using any zip tool)