A bug was uncovered that could cause earlier versions of JBoss EAP to throw an exception when testing a datasource.
The exception presented while using the LDAP protocol in the datasource "connection-url" tag. The product was failing to instantiate +InitialContextFactory+ because the "org.jboss.as.connector" module was not able to access some of the JDK provided classes (such as +com.sun.jndi.ldap.LdapCtxFactory+). This resulted in a datasource connection test failure when the Datasource "connection-url" was using "ldap://" protocol.
This issue was resolved by adding a dependency on +sun.jdk+ to the +org.jboss.as.connector+ module. This makes the required JDK classes accessible from the connector module and the datasource testing using CLI using "test-connection-in-pool" operation succeeds.