JNDI properties file

S

shoa

Hello

My Client application is built to contact with a Java Server JBoss. I have a
JNDI properties file that is attached with other classes in my .jar client
file. The content of this file is as the following:

-----------------------
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:eek:rg.jnp.interfaces
java.naming.provider.url= 192.168.0.30
-----------------------

It can be see that the "url" here (the last line) presents for the IP
address of the server computer. I know that if the server is changed, I have
to change this IP in this file. This is OK when my client application is a
..jar file (so it is easy to change IP address)

The problem here is that if I create a .exe file from this .jar file, it is
hard to change this IP value (jar file is a zip file, so I can change its
content easily). What I really want is how to setup my Client application so
that I can change (modify) this IP address when I start run the client
application for the first time.

Is there any solution for doing that?

Thank you very much for any help
S.Hoa
 
I

iksrazal

The problem here is that if I create a .exe file from this .jar file, it is
hard to change this IP value (jar file is a zip file, so I can change its
content easily). What I really want is how to setup my Client application so
that I can change (modify) this IP address when I start run the client
application for the first time.

Is there any solution for doing that?

How about using the -D command line option and using
System.getProperties() inside your app?


http://www.javaworld.com/javaworld/javaqa/2001-07/01-qa-0706-env.html

HTH,
iksrazal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,797
Messages
2,569,647
Members
45,378
Latest member
danzeev

Latest Threads

Top