0 Replies Latest reply on Jun 28, 2002 8:20 AM by berserksangr

    jBoss3.0+jndi+fs federation acces - HELP!

    berserksangr Newbie

      Hi... Please help me with following: I want to have acces to files in directory c:\datafiles\channels\channel1\ on harddisk through JNDI - I mean reading, creating etc.
      So I deploy this service in my JBoss 3.0:
      (...)

      data

      java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
      java.naming.provider.url=file:c:/datafiles/

      javax.naming.InitialContext

      (...)

      JNDIView shows everything OK - files bound perfectly to JNDI tree. But following code doesn't work. It fires javax.naming.CannotProceedException (complete output under the code). In my jndi.properities I've got:
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=localhost

      code:
      (...)
      File scriptFile;
      Context scriptContext;
      ObjectOutputStream scriptObjectOutputStream;
      try
      {
      scriptContext = new InitialContext(System.getProperties());
      scriptFile = (File)javax.rmi.PortableRemoteObject.narrow(
      scriptContext.lookup("data/Channels/Channel1/script.dsf"),
      File.class);
      }
      catch(NamingException ne)
      {
      System.err.println("ERROR binding script file");
      ne.printStackTrace();
      }
      (...)

      fires:

      javax.naming.CannotProceedException; remaining name
      'Channels/Channel1/script.dsf'
      at
      javax.naming.spi.ContinuationContext.getTargetContext(ContinuationContext.java:43)
      at
      javax.naming.spi.NamingManager.getContinuationContext(NamingManager.java:766)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:557)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at Main.exportScript(Main.java:22)
      at Main.main(Main.java:71)

      TIA