• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JNDI

 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am trying to create subcontext in weblogic server using the below code
and if i try to run the same program again then it has to throw an Exception
same name not to use but it is not giving any exception.everytime it is
crating new subcontext with the same name eveythough we are not destroying
the context.why?


import javax.naming.*;
import java.rmi.*;
import java.util.*;

public class UseJndi0{
public static void main(String args[]){
try{
Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, "t3://localhost:7001");
h.put(Context.SECURITY_PRINCIPAL, "admin");//user
h.put(Context.SECURITY_CREDENTIALS, "inetadmin");
Context ic = new InitialContext(h);
System.out.println(" initial context = "+ ic);
// initialcontext is like rooot of the tree
//now let us try to create sub context ( assume subcontext as a branch)
Context subcon1 = ic.createSubcontext("inetsolv");
System.out.println("subcontext created");
}catch (Exception e){System.out.println(e);}
}
}
 
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic