log.info("Remoting JNDI detector starting JNDI server instance since none where specified via configuration.");
log.info("Remoting JNDI server started on host + " + host + " and port " + port);
//If no server information provided, then start one of our own by default
Main server = new Main();
if (namingBean != null)
{
Class namingBeanClass = Class.forName("org.jnp.server.NamingBean");
Method setNamingInfoMethod = server.getClass().getMethod("setNamingInfo", new Class[] {namingBeanClass});
setNamingInfoMethod.invoke(server, new Object[] {namingBean});
}
server.setPort(port);
server.setBindAddress(host);
server.start();
contextFactory = NamingContextFactory.class.getName();
urlPackage = "org.jboss.naming:org.jnp.interfaces";
}
catch(Exception e)