Hey

Tim Drury wrote:
> Mike, I only had to do two things to get my client running
> remotely.  First, the client has to know the server is remote.
> I lookup the server name/IP in "document.properties":
> 
>       // put the document server properties file into the system properties
>       Properties props = new Properties();
>       Properties sysprops = System.getProperties();
>       try
>       {
>          props.load(new java.io.FileInputStream("document.properties"));
>          sysprops.putAll(props);
>       }
>       catch (Exception ex)
>       {
>          ex.printStackTrace();
>          System.exit(-1);
>       }
>       System.setProperties(sysprops);

The following would work too:
System.getProperties().load(new FileInputStream("document.properties"));


> Here is the document.properties file:
> 
> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
> java.naming.provider.url=192.168.1.102:1099
> 
> 192.168.1.102 is my Linux server running jBoss.
> 
> The other change is on the server.  All I had to do was change conf/
> jboss.properties and set java.rmi.server.hostname=192.168.1.102 instead
> of "localhost" (the default).

Remember that if you name it jndi.properties and include it in the
clients classpath, you wouldn't have to do anything at all since JNDI
automatically loads the properties in jndi.properties during new
InitialContext().

/Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to