First I hope they get the old forums back soon...this is truely a pain...

I need to have a federated namespace in the Jboss jndi tree...that is I need
to be able to get RMI objects from an armi server through the jboss jndi
tree. I have had some moderate sucess with the ExternalContext jmcl
configuration:

<mbean code="org.jboss.naming.ExternalContext"
name="DefaultDomain:service=ExternalContext,jndiName=mailboxes">
    <attribute name="JndiName">mailboxes</attribute>
        <attribute name="Properties">mailbox.properties</attribute>
        <attribute
name="InitialContext">javax.naming.InitialContext</attribute>
        <!--<attribute
name="InitialContext">com.sun.jndi.rmi.registry.RegistryContext</attribute>-
->
        <!--<attribute
name="InitialContext">org.jnp.interfaces.NamingContext</attribute>-->
        <attribute name="RemoteAccess">true</attribute>
  </mbean>

Only the javax.naming.InitialContext "InitialContext" attributre works. The
other throw method not found exceptions (I think because they don't have
no-arg contructors, but try to find the java docs for
com.sun.jndi.rmi.registry.RegistryContext to find out what it does take!!!)

Anyway, the mailbox.properites file is this:

ava.naming.factory.initial=com.sun.jndi.rmi.registry.RegistryContextFactory
java.naming.provider.url=rmi://localhost:5555

The RMI server and jboss-2.4.4 (final relaease) are running on the same
machine.

When the RMI server is started, then jboss, my JNDIView looks like this:

Global JNDI Namespace
  +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
  +- TopicConnectionFactory[link -> ConnectionFactory] (class:
javax.naming.LinkRef)
  +- mailboxes (class: javax.naming.Context)
  |   +- KOMtoEVS (class: java.lang.Object)
  |   +- EVStoKOM (class: java.lang.Object)
  |   +- KPStoKOM (class: java.lang.Object)
  +- UserTransactionSessionFactory (class: org.jboss.tm.usertx.....

etc


If I try to get a context like this:

env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "127.0.0.1:1099");
System.out.println("Connecting for initial context...");
Context ctx=new InitialContext(env);
System.out.println("looking up ctx...");
Object otherctx=ctx.lookup("mailboxes");
System.out.println("otherctx is "+otherctx.getClass().toString());


my output is this:

Connecting for initial context...
looking up ctx...
otherctx is class javax.naming.Reference

The lookup appears to be returning a javax.naming.Reference instead of a
context (it seemed to work under 2.4.3 but that had other problems)

if I change Object otherctx=ctx.lookup("mailboxes"); to Object
otherctx=ctx.lookup("mailboxes/EVStoKOM");

I get the following error:

Connecting for initial context...
looking up ctx...
javax.naming.NotContextException
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:399)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
        at javax.naming.InitialContext.lookup(InitialContext.java:350)
        at
gc.cse.ccekms.kom.msglistener.KomMailboxInit.main(KomMailboxInit.java:70)cou
ldn't bind mailbox

So has any one been able to get an rmi-jndi federated namespace to work
under 2.4.4? Am I missing something? Where exactily is the javadoc for the
com.sun.jndi.rmi.* packages?


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

Reply via email to