I'm having trouble getting a custom SPI to be properly loaded by the java ServiceLoader in wildfly. It seems that WILDFLY has its own implementation of the loader and is ignoring SPI implementations in any jar whether it is a global module or a jar belonging to the deployment whether it be in an ear or war. The jar has properly defined a META-INF/services folder and within that folder it contains a UTF-8 text file named java.util.spi.ResourceBundle.ResourceBundleControlProvider. There is a class defined in the jar that implements that interface. When i use this jar in a normal java application it automatically recognizes that the jar has a SPI and loads it accordingly and I'm able to use the ResourceBundle API just fine and it recognizes that implemented provider without problem. Â
However when I try to bundle this same jar in a deployable war file, on wildfly it doesn't load the SPI properly and I'm not able to use the ResourceBundle API. Â
I've also tried to add the jar, the one containing the SPI, as a global module instead of packaging it with the war and specify it in the domain:ee <global-modules> area and denote it's services="true". That doesn't work either.  I've done a bunch of different packaging and nothing seems to work. I've verified that jar is loaded and is visible and the class available through the class loader.
So what am I missing here? Is wildfly just looking at specific SPI's? Because I've turned on TRACE debugging and I can see that wildfly is looking for certain implementations in the META-INF/services folder so I'm a bit confused. Â