A UDR connection can be made only from the thread executing a Java UDR. Make sure the connection is not created on a child thread forked by the UDR.