I am trying to improve my understanding of remote EJB invocation.
I have code like this working, which does a remote JNDI lookup on my server:
private InitialContext jndiContext;
private AdderBeanRemote bean1;
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("org.omg.CORBA.ORBInitialHost", "10.0.0.99");
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
jndiContext = new InitialContext(props);
bean1 = (AdderBeanRemote) jndiContext.lookup("com.suspectclass.sgifford.test8bean.AdderBeanRemote");
But that seems way to complicated, and hardcodes a lot of application-specific data into my application; for example, if I wanted to use a different server or renumber my network, I would have to modify my application then recompile and redeploy.
I have seen some solutions that use "jndi.properties", but so far I haven't gotten any to work, and at any rate this would still require me to recompile and redeploy to change anything.
Is there a simpler way of doing this that doesn't require hardcoding my network details into my app? Or is this the best I can do?
Thanks!
-----Scott.