I've the same issue in Hibernate 5.2.9.Final with WildFly 10.1. I also use custom ConnectionProvider and have NO problem with that, only with custom Scanner, so maybe the Scanner loading could also have the ConnectionProvider loading mechanism.