I believe that I am close, but I still have no cigar.  Having read most of
the jnp code, I realize that JNP has implemented LinkRef and not Reference
as I first thought.  In looking through org.jnp.client.Mail, I see that
LinkRef is supportted and that the use of it is to bind a LinkRef object
with an embedded URL.  This URL may start with jnp://somemachine:someport.

So I run an experiment with 2 separate instances of JBoss running on the
same machine and I have Naming enabled on two different ports (1099, 1098).
I basically do a bind of:

      env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY,
        "org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, "syan.zantaz.com:1099");
      env.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");

        InitialContext ic = new InitialContext(env);

        ... create a couple of intermediate levels of name foo ...
        ... create a NamingContext nc pointing to foo ...

        nc.bind("linksomewhere", new
LinkRef(jnp://syan.zantaz.com:1098/foo1));  // this already exists

        ... later in the code I do ...

        Context ctx = ic.lookup("foo/linksomewhere");

At this point, I am getting the following exception.  Am I using this
incorrectly?

javax.naming.NameNotFoundException: foo1 not bound      
        at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:245)   
        at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)

        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)        
        at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)      
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:298)

        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:282)

        at javax.naming.InitialContext.lookup(InitialContext.java:350)  
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:370)

        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:282)

        at javax.naming.InitialContext.lookup(InitialContext.java:350)  
        at com.zantaz.base.temp.Test6.run(Test6.java:89)        
        at com.zantaz.base.temp.Test6.main(Test6.java:21) 

In walking through the code, it looks like env for the InitialContext is
reapplied for LinkRef.  This seems incorrect to me, but I don't claim to
understand everything.

Sam

-----Original Message-----
From: Scott M Stark [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 06, 2001 11:41 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Anyone know how to federate across multiple
jnp ...


jnp is the name of the jndi provider used by JBoss and is the protocol
url just as t3 is the weblogic's.
The jnp.properties file is used as the default values. If you don't set the
port
values via the NamingService mbean attributes then the jnp.properties file
is used.

This jboss.jcml entry:
  <mbean code="org.jboss.naming.NamingService"
name="DefaultDomain:service=Naming" />
along with this jnp.properties file:
### JNP server configuration
jnp.port=1299
jnp.rmiPort=0

results in the naming service starting on port 1299:

...
[Naming] Starting
[Naming] Starting jnp server
[Naming] Started jnpPort=1299, rmiPort=0
[Naming] Naming started on port 1299
[Naming] Started

The

----- Original Message ----- 
From: "Guy Rouillier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 07, 2001 10:53 AM
Subject: Re: [JBoss-user] Anyone know how to federate across multiple jnp
...


> >                 Properties env = new Properties();
> >                 env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> "org.jnp.interfaces.NamingContextFactory");
> >                 env.setProperty(Context.PROVIDER_URL,
> "jnp://localhost:1099");
> >                 env.setProperty(Context.URL_PKG_PREFIXES ,
> "org.jboss.naming:org.jnp.interfaces");
> >                 InitialContext ctx = new InitialContext(env);
> 
> I left this in jboss.jcml:
> 
>   <!-- JNDI -->
>   <mbean code="org.jboss.naming.NamingService"
> name="DefaultDomain:service=Naming">
>     <attribute name="Port">1099</attribute>
>   </mbean>
> 
> and changed jnp.properties to this:
> 
>     jnp.port=1299
>     jnp.log=true
> 
> My client could connect with this in its jndi.properties file:
> 
>     java.naming.provider.url=w2k-pro  OR
>     java.naming.provider.url=w2k-pro:1099
> 
> but failed when I put this in jndi.properties:
> 
>     java.naming.provider.url=jnp://w2k-pro:1299
> 
> with the following error:
> 
>     Exception caught: javax.naming.ServiceUnavailableException: jnp [Root
> exception
>     is java.net.UnknownHostException: jnp]
> 
> Obviously, I'm confused.
> 
> (1) What is the relationship between jnp and jndi?
> (2) When is jnp used?  In the default configuration, I only see the naming
> service specified in the jboss.jcml mbean started, as follows:
> 
>     [Naming] Starting
>     [Naming] [Naming] Started on port 1099
>     [Naming] Naming started on port 1099
>     [Naming] Started
> 
> When does jnp come into play, and when does jnp.properties get used?
> 



_______________________________________________
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