Elipse, java, j2ee, client, jndi, jboss, propertiesRuning an Ejb client is a trivial thing, but over the years I have found some people do struggle with putting jndi.properties file on classpath.

So this tip is about how you provide VM arguments on command line required by a client. These arguments are normally located in jndi.properties file when invoking an ejb client.

I'm using JBoss as my app server. Shown above is how client puts VM arguments on command path.

Also shown (below) how client is coded/ looks like when used this option.







Second way to run a client is by hard coding the context factory name and
provider url as shown below .


















And third option which is universal way is to put jndi.properties file on client's classpath. Content of jndi.propeties file is

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099


Del.icio.us Digg! My StumbleUpon Page