6 Replies Latest reply on Jun 4, 2004 4:53 PM by hbaxmann

    UNC path in URLDeploymentScanner

    mrslinkyman

      Is it possible to use a UNC path in the URLs attribute of the URLDeploymentScanner in jboss-service.xml? We are running Jboss on a pair of Windows 2000 machines and our ear files are on a central file server shared between the 2 machines. The file server is accessible via the network. I'd rather not deal with a shared drive setup. I'd rather access the files via their UNC paths similar to how IIS will allow a resource to be mapped via its UNC path.

        • 1. Re: UNC path in URLDeploymentScanner
          hbaxmann

          according to the JDK docs, yes:

          Extract from http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html

          For Microsoft Windows platforms, the prefix of a pathname that contains a drive specifier consists of the drive letter followed by ":" and possibly followed by "\" if the pathname is absolute. The prefix of a UNC pathname is "\\"; the hostname and the share name are the first two names in the name sequence. A relative pathname that does not specify a drive has no prefix.

          anotherone:

          http://forum.java.sun.com/thread.jsp?thread=284309&forum=31&message=1116630

          your google

          • 2. Re: UNC path in URLDeploymentScanner
            mrslinkyman

            Maybe I didn't formulate the question correctly. I know that Java can handle UNC paths corrrectly. What I was looking for is the syntax to use in the URLDeploymentScanner's "URLs" attribute in the jboss-service.xml file. I've tried the following:

            file:////Server/share/path
            file://Server/Share/path
            //Server/Share/path
            \\Server\Share\path

            None of the above seem to work. I'm thinking that I need to use a variant of the file: syntax, but I'm not sure what will work.

            Thanks for the help in advance.

            • 3. Re: UNC path in URLDeploymentScanner
              hbaxmann

              file://Server/Share/path and
              //Server/Share/path

              should doit according to

              http://www.ietf.org/rfc/rfc2396.txt.

              Maybe a bug in around makeURL ?

              But you may enable debugging - see docs - and should see:

              "Adding URL from spec:"
              "URL: "

              use the source, luke

              bax

              • 4. Re: UNC path in URLDeploymentScanner
                hbaxmann

                But anyway: As fas as I can see, the deployment URL should be relative to the server home.

                bax

                • 5. Re: UNC path in URLDeploymentScanner
                  mrslinkyman

                  I did go to Google.
                  I did look at the source.
                  All before I posted.
                  What I found after trial and error was that the following does work

                  file://\\SERVER\SHARE\path

                  Seems odd to me that it would be like this, but I suspect that JBoss is passing anything after file:// directly to the File class to find the correct location. Maybe this is a feature, maybe this is a bug, I can't tell.
                  But I did find a solution.

                  The one other caveat about using UNC paths, in case anyone else runs into this problem, is that the user that jboss runs as (either specified via a service descriptor in Windows or as run from a command line) must be resolvable to the server whose UNC path is being used. In other words if you are running JBoss on a server using a local user then, no matter how the share's permissions are set up, jboss will not be able to see the UNC path. Both servers must have access to the same user information provided by a common domain controller.

                  Thanks for the help.

                  • 6. Re: UNC path in URLDeploymentScanner
                    hbaxmann

                    There should a replacement of the System.PathSeperator taken place in the during URL parsing ...

                    wondering

                    bax