Thanks for the reply. What I need is to use jnp as a general purpose naming
service. We just need to store up to a hundred entries and only need
naming, so, we do not want to get into a separate naming/directory
service/server.

The following is an example code (based from JNDITutorial). The issue is:
after I run this code, and restart jboss, and I lookup, can I get the
button?

/////////////////////////////////////////////////////////////////////////////////////////////////////////
    public static void main(String[] args) {
     Hashtable env = new Hashtable(11);
     env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
                env.put(Context.PROVIDER_URL,
"ldap://fog.saf.pe-c.com:389/o=JNDITutorial";);

     try {

         Context ctx = new InitialContext(env);

         // Create object to be bound
         Button b = new Button("Push me2");

         // Perform bind
         ctx.bind("cn=Button2", b);

         // Check that it is bound
         Button b2 = (Button)ctx.lookup("cn=Button2");
         System.out.println(b2);

         // Close the context when we're done
         ctx.close();
     } catch (NamingException e) {
         System.out.println("Operation failed: " + e);
     }
    }









                                                                                       
                                                   
                    "Guy Rouillier"                                                    
                                                   
                    <[EMAIL PROTECTED]>        To:     
<[EMAIL PROTECTED]>                                        
                    Sent by:                            cc:                            
                                                   
                    [EMAIL PROTECTED]        Subject:     Re: [JBoss-user] 
persistent bind to jnp possible?                    
                    eforge.net                                                         
                                                   
                                                                                       
                                                   
                                                                                       
                                                   
                    05/02/2001 07:01 PM                                                
                                                   
                    Please respond to jboss-user                                       
                                                   
                                                                                       
                                                   
                                                                                       
                                                   




Not really sure what you are asking, but see my message from yesterday.
You
can put the jnp into the jndi-name in your jboss.xml deployment descriptor.
Because it is in your jar file, it will persist.  That will allow that one
EJB to be referenced from that jar.

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 02, 2001 4:50 PM
Subject: [JBoss-user] persistent bind to jnp possible?


>
> Hi,
>
> Is it possible to bind something to jnp and then shut down/restart jboss,
> and can still lookup the bounded info?
> e.g., bind some app configuration info into jnp and get it later, even
> after restart jboss.
>
> If it not possible, any work around? Do I need to use "External JNDI
> Configuration and JNDI Viewing"?
> -- if I need to do it within an ejbean and want to keep the
initialContext
> not hardcoded? if doing bind/lookup
> only from ordinary clients, seems that we can simply use a directory for
> app config info.
>
> Can we change jnp to make it only read-only, but wirte also? How
difficult
> it is? How desirable?
>
>
> thanks
>
>
> Kai
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user





_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to