Anybody succeed in making non-ejbean client (i.e. ordinary client) access
windows file system via jnp federated namespace?

The federated namespace itself seems working, after setup, the tree is like
this:

Global JNDI Namespace

  +- jmx:TWILIGHT:rmi
  +- TopicConnectionFactory
  +- XAQueueConnectionFactory
  +- jmx
  +- UILXAQueueConnectionFactory
  +- RMIXAQueueConnectionFactory
  +- RMIQueueConnectionFactory
  +- ejb20-statelessSession-TraderHomessss
  +- external
  |   +- fs
  |   |   +- Scott
  |   |   |   +- .bindings
  +- XATopicConnectionFactory
  ...............

------------------------------------------------------------------------
test code:
----------------------------------------------------------------------
                Properties env = new Properties();
                env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
                  //env.setProperty(Context.PROVIDER_URL,
"localhost:/external/fs"); //==Q2
                   env.setProperty(Context.PROVIDER_URL,
"localhost:/external");//==== Q2
                   //env.setProperty(Context.PROVIDER_URL,
"localhost:/external/fs/Scott");

                env.setProperty(Context.URL_PKG_PREFIXES ,
"org.jboss.naming:org.jnp.interfaces");

                System.out.println("Connecting to JNDI, env="+env);
                InitialContext ctx = new InitialContext(env);
                System.out.println("Connected to JNDI");


         NamingEnumeration list = ctx.list(""); // Q2
         //NamingEnumeration list = ctx.list("external");    // = Q1
             //NamingEnumeration list = ctx.list("external/fs"); //= Q1
         //NamingEnumeration list = ctx.list("external/fs/Scott"); // Q1

         // Go through each item in list
         while (list.hasMore()) {
          NameClassPair nc = (NameClassPair)list.next();
          System.out.println(nc);
         }

---------------------------------------------------------------------------

Q1) when ctx.list("external") or ctx.list("external/fs"), the results are
the expected:

Connecting to JNDI, env={java.naming.provider.url=localhost:/external/fs,
java.naming.factory.initial=org.jnp.interfaces.NamingCont
xtFactory,
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
Connected to JNDI
fs: org.jnp.interfaces.NamingContext


However, when ctx.list("external/fs/Scott"), it does not work anymore! It
seems related with the <attribute name="RemoteAccess">true</attribute> in
jboss.jcml, because when it is set true, the output is:
---------------------------------------------------------------
Connecting to JNDI, env={java.naming.provider.url=localhost:/external/fs,
java.naming.factory.initial=org.jnp.interfaces.NamingConte
xtFactory,
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
Connected to JNDI
Operation failed: javax.naming.NotContextException
----------------------------------------------------------------
if it is set false, then, the output:
-----------------------------------------------------------------
C:\jbossFromSrc\examples\jndi>java tstNS
Connecting to JNDI, env={java.naming.provider.url=localhost:/external/fs,
java.naming.factory.initial=org.jnp.interfaces.NamingConte
xtFactory,
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
Connected to JNDI
Operation failed: javax.naming.CannotProceedException; remaining name ''
-----------------------------------------------------------------
-----------------------------------------------------------------

Q2) During the process of trying solve the issue of Q1, I encountered
another issue, perhaps can provide some clues?: There is no difference that
Context.PROVIDER_URL is "localhost/external/fs" or  "localhost:/external",
or "localhost", the results of ctx.list("") are the same!


When use external:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\jbossFromSrc\examples\jndi>java tstNS
Connecting to JNDI, env={java.naming.provider.url=localhost:/external,
java.naming.factory.initial=org.jnp.interfaces.NamingContextF
actory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
Connected to JNDI
jmx:TWILIGHT:rmi: org.jboss.jmx.server.RMIConnectorImpl
TopicConnectionFactory: org.jbossmq.SpyTopicConnectionFactory
XAQueueConnectionFactory: org.jbossmq.SpyXAQueueConnectionFactory
jmx: org.jboss.jmx.server.JMXAdaptorImpl
UILXAQueueConnectionFactory: org.jbossmq.SpyXAQueueConnectionFactory
RMIXAQueueConnectionFactory: org.jbossmq.SpyXAQueueConnectionFactory
RMIQueueConnectionFactory: org.jbossmq.SpyQueueConnectionFactory
ejb20-statelessSession-TraderHomessss: $Proxy3
external: org.jnp.interfaces.NamingContext
XATopicConnectionFactory: org.jbossmq.SpyXATopicConnectionFactory

When use external/fs:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Connecting to JNDI, env={java.naming.provider.url=localhost:/external/fs,
java.naming.factory.initial=org.jnp.interfaces.NamingConte
xtFactory,
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
Connected to JNDI
jmx:TWILIGHT:rmi: org.jboss.jmx.server.RMIConnectorImpl
TopicConnectionFactory: org.jbossmq.SpyTopicConnectionFactory
XAQueueConnectionFactory: org.jbossmq.SpyXAQueueConnectionFactory
jmx: org.jboss.jmx.server.JMXAdaptorImpl
UILXAQueueConnectionFactory: org.jbossmq.SpyXAQueueConnectionFactory
RMIXAQueueConnectionFactory: org.jbossmq.SpyXAQueueConnectionFactory
RMIQueueConnectionFactory: org.jbossmq.SpyQueueConnectionFactory
ejb20-statelessSession-TraderHomessss: $Proxy3
external: org.jnp.interfaces.NamingContext
XATopicConnectionFactory: org.jbossmq.SpyXATopicConnectionFactory




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

Reply via email to