initializeJndiName();
Class[] interfaces = getInterfaces();
Class proxyClass = java.lang.reflect.Proxy.getProxyClass(container.getBeanClass().getClassLoader(), interfaces);
final Class[] constructorParams =
{InvocationHandler.class};
proxyConstructor = proxyClass.getConstructor(constructorParams);
try
{
Util.rebind(container.getInitialContext(), jndiName, createProxy());
} catch (NamingException e)
{
NamingException namingException = new NamingException("Could not bind service proxy factory for EJB container with ejb name " + container.getEjbName() + " into JNDI under jndiName: " + container.getInitialContext().getNameInNamespace() + "/" + jndiName);
namingException.setRootCause(e);
throw namingException;
}