I have the Java code below that works fine on a basic Main class example. Great!
However, when it's deployed on Wildfly (10.0.0) application server the mentioned class isn't found and an exception is thrown. I've tested on another application server like IBM Websphere Application (8.0 and 9.0) and it also works.
Does someone have an idea why does this happens on Wildfly?
The Code:
String resConfName = "sun.net.dns.ResolverConfiguration";
Class resConfClass = Class.forName(resConfName);
The Exception:
java.lang.ClassNotFoundException: sun.net.dns.ResolverConfiguration from [Module "deployment.myApp.ear.myApp.war:main" from Service Module Loader]
My Wildfly Environment: (sad face)
- Wildfly 10.0.0
- using jdk1.8.0_152
My Websphere 8 Environment: (happy face)
- WAS 8.0.0.12
- using jdk1.6.0_45
My Websphere 9 Environment: (happy face)
- WAS 9.0.0.11
- using jdk1.8.0_152
Simple main example: (happy face)
- using jdk1.6.0_45 or jdk1.8.0_152
Thank you in advance!