For achieveing lazy initialization, appserver intercepts JDK socket layer using a socket wrapper. Both the issues you are facing would be because of the issue 2547. As both JSR88 and URLConnection accessed from servlet to outside will be using outbound sockets via the socketwrapper and will access the same code path.