public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException {
if (xaResource != null && xaResourceWrapper != null) {
xaResource = xaResourceWrapper.wrap(xaResource, container.getContainerID().toString());
}
EndpointHandler endpointHandler = new EndpointHandler(container, beanContext, instanceFactory, xaResource);
MessageEndpoint messageEndpoint = null;
try {
messageEndpoint = (MessageEndpoint) Proxy.newProxyInstance(classLoader, interfaces, endpointHandler);
} catch (IllegalArgumentException e) {
//try to create the proxy with tccl once again.
ClassLoader tccl = Thread.currentThread().getContextClassLoader();