[jboss-user] [JNDI/Naming/Network] - javax.naming.NoInitialContextException: Can't find property:

joepareti do-not-reply at jboss.com
Fri Jan 4 09:13:53 EST 2008


I am developing a demo based on JBOSS 4.2.0.CR2 on Linux RHEL 3/x86.
The demo includes an EJB (stateless session bean), and a client app that requests services from the bean.

I invariably get the following rt error when launching the client as 
# ant runClientApp

[java] javax.naming.NoInitialContextException: Can't find property: java.naming.factory.initial
[java] at javax.naming.spi.NamingManager.getInitialContext(j ava.util.Hashtable) (/lib/ssa/libgcj.so.4.0.0)
[java] at javax.naming.InitialContext.getDefaultInitCtx() (/lib/ssa/libgcj.so.4.0.0)
[java] at javax.naming.InitialContext.getURLOrDefaultInitCtx (java.lang.String) (/lib/ssa/libgcj.so.4.0.0)
[java] at javax.naming.InitialContext.lookup(java.lang.Strin g) (/lib/ssa/libgcj.so.4.0.0)
[java] at za.co.solms.finance.calculators.LoanCalculatorPane l.connect() (Unknown Source)
[java] at za.co.solms.finance.calculators.LoanCalculatorPane l.init() (Unknown Source)
[java] at za.co.solms.finance.calculators.LoanCalculatorPane l.LoanCalculatorPanel() (Unknown Source)
[java] at za.co.solms.finance.calculators.LoanCalculatorClie nt.LoanCalculatorClient() (Unknown Source)
[java] at za.co.solms.finance.calculators.LoanCalculatorClie nt.main(java.lang.String[]) (Unknown Source)

my jndi.properties, available in classpath and also under $JAVA_HOME, is as follows:
(I also saw jndi.properties is included in the client jar file, so I assume it is taken into account):

java.naming.factory.initial=org.jnp.interfaces.Nam ingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.namingrg. jnp.interfaces
jnp.socketFactory=org.jnp.interfaces.TimedSocketFactory
#Connection timeout (0 == blocking)
jnp.timeout=0
#Read timeout (0 == blocking)
jnp.sotimeout=0

Finally, I started playing around with the client code by e.g. changing the name of the bean in the lookup function ...

Object beanHomeRef
= jndiContext.lookup(jndiName);

into

Object beanHomeRef
= jndiContext.lookup("local/ejb/LoanCalculator");

but without any results 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117059#4117059

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117059



More information about the jboss-user mailing list