Wat is this error abt?

Hi Guys,

I am awfully new to j2EE and try compiling a very simple code in the book.. but it doesnt seem to work.. may I know why?

Many thanks!!

regards

Henry

The code giving this error is:

HelloHome home = (HelloHome)

javax.rmi.PortableRemoteObject.narrow(

ctx.lookup("Hello"), HelloHome.class);

Error message:

"Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resources file: java.naming.factory.initial

at javax.naming.InitialContext.getDefaultInitCtx<InitialContext.java:247>

at javax.naming.InitialContext.getURLorDefaultInitCtx<InitialContext.java:284>

at javax.naming.InitialContext.lookup<InitialContext.java:351>

at HelloClient.main<HelloClient.java:83>"

[922 byte] By [redqueena] at [2007-10-2 17:09:56]
# 1

i found the soln..

just need to include a jndi.properties file with

"

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory

java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

java.naming.provider.url=localhost

"

it works.. =)

cheers

redqueena at 2007-7-13 18:24:52 > top of Java-index,Enterprise & Remote Computing,AVK Portability...