cancel
Showing results for 
Search instead for 
Did you mean: 

unable to get the InitialContext?

Former Member
0 Kudos

Hi,

I am facing a strange problem. I have deployed a EAR application with some session beans and the two war files. When I am trying to get the InitialContext I am getting an exception saying "Wrong security principle/credentials." I am using the Administrator as PRINCIPLE to get the InitialContext. The below are the given details:

-


Hashtable ht=new Hashtable();

ht.put("java.naming.factory.initial","com.sap.engine.services.jndi.InitialContextFactoryImpl");

ht.put("java.naming.provider.url","localhost:50000");

ht.put("java.naming.security.principal","Administrator");

ht.put("java.naming.security.credentials","#cosl123");

Context ctxt=new InitialContext(ht);

-


can anybody suggest me a way to solve this problem?

Thanks,

Ashok.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

What context do you get when you do not include the hashtable? Will this line fail?

Context ctxt=new InitialContext();

Former Member
0 Kudos

Hi,

I also checked with 50004 but of no use. I think the problem is somthing different. I am using Administrator as PRINCIPLE is that OK? Beacuse in the log file i seeing a error "Wrong security principle/credentials". Please show me a way to solve this problem this is very urgent.

Ashok.

SidBhattacharya
Product and Topic Expert
Product and Topic Expert
0 Kudos

If the war and ear are on the same box then you can just do a new InitialContext() to get the context.

If not, then you need to specify the PROVIDER_URL etc..

sid-desh
Advisor
Advisor
0 Kudos

Hi Ashok,

In my opinion your provider url should be localhost:5XX04.

In my opinion it should be the P4 port.

Hope this helps.

Regards

Sidharth