Hi Chris,
 
I tried doing that but didn't have much luck.  Below is the mbean parameters that I used.  I am confused as to when it actually tries to connect to the remote server.  It doesn't seem to ever try and connect - I experiece the same behaivor if the other server isn't even running - whereas you'd expect to get some sort of timeout or something in that case.
 
I can see the external context has bound itself into jndo since I can see "external/ejb" within my jndi tree.  However I can't drill down below that.
 
Any other ideas?
 
Thanks,
 
Gray
 
<mbean code="org.jboss.naming.ExternalContext"
        name="jboss:service=ExternalContext, jndiName=external/ejb">
        <attribute name="JndiName">external/ejb</attribute>
        <attribute name="Properties">/conf/xtriacore-jndi.properties</attribute>
        <attribute name="InitialContext">javax.naming.InitialContext</attribute>
        <attribute name="RemoteAccess">true</attribute>
  </mbean>
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Chris Chen
Sent: Tuesday, June 11, 2002 4:03 PM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] jndi confusion - two servers on same machine

If you are trying to lookup another context from one jboss server to another jboss server, you might wanna try setting up an External  JNDI context inside your servlet Jboss container.  An example mbean for doing such a thing is as follows:

<!-- Bind a remote LDAP server -->
<mbean code="org.jboss.naming.ExternalContext"
name=":service=ExternalContext,jndiName=external/ldap/dscape" >
<attribute name="JndiName">external/ldap/dscape</attribute>
<attribute name="Properties">dscape.ldap</attribute>
<attribute name="InitialContext">
javax.naming.ldap.InitialLdapContext
</attribute>
<attribute name="RemoteAccess">true</attribute>
</mbean>

An example dscape.ldap properties file is as follows:

java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
java.naming.provider.url=ldap://ldaphost.displayscape.com:389/o=displayscape.com
java.naming.security.principal=cn=Directory Manager
java.naming.security.authentication=simple
java.naming.security.credentials=secret


Then, you can lookup data from an external JNDI through the following code:

InitialContext iniCtx = new InitialContext();
LdapContext ldapCtx = iniCtx.lookup("external/ldap/dscape");


This is copied from the JBoss Main Documentation book so if you need more information, get the main documentation off Flashline.


Thanks,
Chris

At 12:48 PM 06/11/2002, you wrote:
Okay so I fooled around with adding an external context mbean to the servlet
server - but it didn't seem to work.  The mbean is created fine but I still
get an error when trying to perform the lookup.  It doesn't seem like it is
ever trying to perform a connection to the external process since I get the
same exception regardless of whether the external process is running or not.

Has anybody been able to use an external context to attach to another jboss
server's naming service using 3.0?



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Gray Jones
Sent: Tuesday, June 11, 2002 2:28 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] jndi confusion - two servers on same machine


I'm trying to run two different servers on the same machine.  The first one
hosts our ejb components and the second one hosts our servlets.  They are
both jboss servers.  In the ejb server I changed the jboss-service.xml file
to publish the naming service on port 1199 instead of the default 1099.

<mbean code="org.jboss.naming.NamingService"
        name="jboss:service=Naming">
    <attribute name="Port">1299</attribute>
  </mbean>
  <mbean code="org.jboss.naming.JNDIView"
        name="jboss:service=JNDIView"/>

Within the servlet server is a factory that is repsonsible for looking up
the home of one of the ejb components in the ejb server.  Below is the
snippet of code to create the initial context.  The file that gets passed in
contains the port of 1199 - which is what the ejb server is set to publish
on.

However it seems like these properties are getting ignored.  The lookup
always seems to attempt to perform its lookup against the local server (ie
the servlet server instead of the ejb server).  If I kill the ejb server,
this lookup doesn't even complain.

So my question is - is it possible to do a lookup from within a jboss server
to an external jboss server?

InputStream streamIn =
Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName
);
        Properties jndiProps = new Properties();
      jndiProps.load(streamIn);
      ctx = new InitialContext(jndiProps);

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1199
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces


_______________________________________________________________

Multimillion Dollar Computer Inventory
Live Webcast Auctions Thru Aug. 2002 -
http://www.cowanalexander.com/calendar



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


_______________________________________________________________

Multimillion Dollar Computer Inventory
Live Webcast Auctions Thru Aug. 2002 - http://www.cowanalexander.com/calendar



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

PGP at ldap://certserver.pgp.com/

Reply via email to