cancel
Showing results for 
Search instead for 
Did you mean: 

Java Bean runtime error: Exception while trying to get InitialContext

Former Member
0 Kudos

I just completed JA300 and am trying to do the samples back at my company. Thanks in advance for pointing me in the right direction. I am thinking that there is a setup problem of some sort.

I am getting an error in NWDI when trying to run a sample "HelloWorld" java bean program.

My remote caller class contains the following:

//TODO: Adapt host name

jndiCtxProps.put(Context.PROVIDER_URL, "sapdvepa.na.atxglobal.com:3900");

jndiCtxProps.put(Context.SECURITY_PRINCIPAL, "Administrator");

jndiCtxProps.put(Context.SECURITY_CREDENTIALS, "apassword");

jndiCtxProps.put(Context.INITIAL_CONTEXT_FACTORY,

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

Shouldn't "sapdvepa.na.atxglobal.com:3900" be the SDM box and port? 3900 is the Message Server Port.

Here is my log after attempting to run...

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:

sapdvepa.na.atxglobal.com:3900 Reason: Cannot open connection on host: 172.20.5.33 and port: 3900]

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.sap.training.client.EJBRemoteCaller.main(EJBRemoteCaller.java:28)

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

sapdvepa.na.atxglobal.com:3900 Reason: Cannot open connection on host: 172.20.5.33 and port: 3900

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)

... 5 more

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The P4 port can be found at:

For this logon to the Portal:

--> Choose 'System Administration'

--> Choose 'Support'

--> Click on the Top Level Area 'SAP WebAS System Information'

--> In the section Test and Configuration tools click on 'SAP WebAS System Information'

Former Member
0 Kudos

This error was related to not using the P4 port. This problem is resolved.