• Post Reply Bookmark Topic Watch Topic
  • New Topic

HFE First Chapter JNDI problem  RSS feed

 
Amit Rampurkar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have gone through all the posts and tried this to get working but its not


Code for Client:

try
{
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.enterprise.naming.SerialInitContextFactory");
ht.put(Context.PROVIDER_URL,"ldap://localhost:3700");
Context ic = new InitialContext(ht);
Object o = ic.lookup("Advisor");
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow(o,AdviceHome.class);
Advice advisior = home.create();
System.out.println(advisior.getTheMessage());
}
catch(Exception ex)
{
ex.printStackTrace();
}
my executable looks like
java -cp .;D:\HFE\Advice\AdviceAppClient.jar;C:\Sun\AppServer\appser-rt.jar AdviceClient

the error I am getting is

Exception in thread "main" java.lang.NoClassDefFoundError: javax/security/jacc/PolicyContextException
at com.sun.enterprise.security.SSLUtils.<clinit>(SSLUtils.java:72)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.<init>(IIOPSSLSocketFact
ory.java:149)



can someone help me
 
Amit Rampurkar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
forgot to mention, if I am using

ht.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory"); instead of
ht.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.enterprise.naming.SerialInitContextFactory");

I am getting
javax.naming.CommunicationException: Request 1 cancelled.
[ December 28, 2006: Message edited by: Amit Rampurkar ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!