943,915 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1910
  • Java RSS
Feb 20th, 2008
0

JNDI help

Expand Post »
This is sasidhar.
I am getting problem with JNDI.
please help to solve this problem.

This is the program I used to work on JNDI.
I am using weblogic 10.0

Java Syntax (Toggle Plain Text)
  1. import javax.naming.*;
  2. import java.rmi.*;
  3. import java.util.*;
  4.  
  5. public class UseJndi{
  6. public static void main(String args[]){
  7. try{
  8. Hashtable h = new Hashtable();
  9. h.put(Context.INITIAL_CONTEXT_FACTORY,
  10. "weblogic.jndi.WLInitialContextFactory");
  11. h.put(Context.PROVIDER_URL, "t3://localhost:7001");
  12. h.put(Context.SECURITY_PRINCIPAL, "admin");//user
  13. h.put(Context.SECURITY_CREDENTIALS, "inetadmin");
  14. Context ic = new InitialContext(h);
  15. System.out.println(" initial context = "+ ic);
  16. NamingEnumeration ne = ic.listBindings("");
  17. while (ne.hasMore()) {
  18. Binding b = (Binding)ne.next();
  19. System.out.println( b.getName());
  20. System.out.println(b.getObject());
  21. }
  22. }catch (Exception e){}
  23. }
  24. }

It is compiling and when I am trying to run this it is showing this problem

Java Syntax (Toggle Plain Text)
  1. E:\programs>java UseJndi
  2. Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/kernel/Kerne
  3. lStatus
  4. at weblogic.jndi.Environment.<clinit>(Environment.java:73)
  5. at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
  6. extFactory.java:117)
  7. at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
  8. at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
  9. at javax.naming.InitialContext.init(Unknown Source)
  10. at javax.naming.InitialContext.<init>(Unknown Source)
  11. at UseJndi.main(UseJndi.java:18)

please give reply to this problem.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sasidharnet is offline Offline
8 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: can someone explain this project to me?
Next Thread in Java Forum Timeline: Mouse Cursor Image





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC