Skip to Content
0
Former Member
Feb 13, 2007 at 03:52 AM

Regarding connection to JNDI using Local host

360 Views

Hi,

I would really appreciate, if you could provide some help to connect to localhost.

I have 6.40 and I am writing a simple EJB module using nwds with hello message.

The following things have been set up.

1. Loop back adapter 10.10.0.10

2. In the host file I have put an entry 10.10.0.10 WJDSOUZA

3. In the NWDS message serverhost localhost port 3601.

4. the NWDS show j2ee engine shows all green ( sdm.dispatcher,server)

The following java gives me JNDI error

System.out.print("\nInitializing JNDI properties ... ");

Properties jndiCtxProp = new java.util.Properties();

jndiCtxProp.put(Context.INITIAL_CONTEXT_FACTORY,

"com.sap.engine.services.jndi.InitialContextFactoryImpl");

jndiCtxProp.put(Context.PROVIDER_URL, "WJDSOUZA:3601");

System.out.print("done");

System.out.print("\nInstantiating JNDI Context ... ");

Context jndiCtx = new InitialContext(jndiCtxProp);

System.out.print("done");

The error is

Initializing JNDI properties ... done

Instantiating JNDI Context ... com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception while trying to get InitialContext. [Root exception is com.sap.engine.interfaces.cross.DestinationException: cannot establish connection with any of the available instances:

WJDSOUZA:3601 Reason: Cannot open connection on host: 10.10.0.10 and port: 3601]

at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:455)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)

at javax.naming.InitialContext.init(InitialContext.java:219)

at javax.naming.InitialContext.<init>(InitialContext.java:195)

at com.ibm.training.ejb.test.go(test.java:47)

at com.ibm.training.ejb.test.main(test.java:25)

Caused by: com.sap.engine.interfaces.cross.DestinationException: cannot establish connection with any of the available instances:

WJDSOUZA:3601 Reason: Cannot open connection on host: 10.10.0.10 and port: 3601

at com.sap.engine.interfaces.cross.Destination.getNextAvailableBroker(Destination.java:53)

at com.sap.engine.interfaces.cross.Destination.getRemoteBroker(Destination.java:33)

at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:340)

... 6 more