3 Replies Latest reply on Apr 26, 2007 3:39 AM by Jignesh P

    can not access file from another machine

    Jignesh P Newbie

      Hi All,

      I am using jboss-4.0.5.GA. In my java file I am accessing folder which is on the another machine of same network by java.io.File class.
      -----------
      File file = new File( "\\\\taligentportal\\DMDOCSERVER\\23050\\2006\\2639680" );
      if ( file.exists() )
      {
      System.out.println( "File present" );
      }
      else
      {
      System.out.println( "File NOT present" );
      }
      -----------
      Here "2639680" is folder present on "taligentportal" machine. But in this case the program prints "File NOT present" message in log.

      I have checked sharing permission on folder DMDOCSERVER of "taligentportal" machine. All rights are given to "EVERYONE" user. This machine is running Windows 2000 OS. The JBoss Server is running on Windows 2003 Server OS.

      Now strange thing is that when I run standalone program (on JBoss instance machine) having the same code, it is working fine and prints "File present" message.

      So is it something in JBoss that preventing access of network resources when application running?

      Let me know if you can help me.

      Thanks.

        • 1. Re: can not access file from another machine
          Peter Johnson Master

          Are you running JBoss AS as a service or from a command line? If as a service, what account are you using (system?)

          On taligentportal, in the Local Security Policy, turn on "Audit account logon events". Then run the code and look at what events show up in the Security log. The events should tell you which user is attempting to access the file. Especially note any differences between when you can successfully access the file from a standalone app and cannot access from within jboss. (You might have to restart the machines to flush out any existing connections between the machines.)

          And no, there is nothing in JBoss that is preventing this, this is all OS-related (could be firewall, login account, or any other of a multitude of things).

          • 2. Re: can not access file from another machine
            Jignesh P Newbie

            Thanks Peter,

            I will look and let you know.

            Jignesh

            • 3. Re: can not access file from another machine
              Jignesh P Newbie

              hi Peter,

              I have checked sharing and security properties of DMDOCSERVER folder on TALIGENTPORTAL machine.
              Under Security tab, I have ticked the check box "Allow inheritable permissions form parent to propagate to this object", which was not ticked previously.

              After applying the changes when I started my application, my code works fine.

              Thanks for your suggestion. It cleared my doubts.

              Jignesh