Menu

#185 Classpath Wildcard not working with Network Paths / Network Drives on Windows

All
closed-works-for-me
nobody
None
5
2021-10-16
2021-10-04
No

Classpath Wildcard do not work with Network Paths / Network Drives on Windows.
I was able to get it working with a directory symbolic link to said network path.

wrapper.java.classpath.1=//path/to/network/location/*.jar #Doesn't work
wrapper.java.classpath.1=N:/path/to/network/drive/*.jar #Doesn't work
wrapper.java.classpath.1=C:/directory/symbolic/link/to/network/location/*.jar #Works (mklink /D)

Discussion

  • Ijtaba Hussain

    Ijtaba Hussain - 2021-10-04

    Encountered in 13.00 alpha release

     
  • john

    john - 2021-10-09

    First: having classpath files on a network drive is not recommended in a production and long running environment. The JVM keeps the files open and in case of network issues, or caching issues may result in class not found exceptions, which can occur at any time, not just on startup. It also affects the performance of the application. For this reason yajsw implements network starting of applications: see https://yajsw.sourceforge.io/#mozTocId538610.

    Second: in order to resolve wild cards yajsw needs to list folder contents. However java does not support the listing of UNC paths. Try this out:

            File f1 = new File("file://TESTPC/test");
            String[] files1 = f1.list();
            System.out.println(files1);
    
            File f1 = new File("file://TEST/test/wrapper.jar");
            System.out.println(f2);
    
            File f3 = new File("X:/");
            String[] files3 = f3.list();
            System.out.println(files3);
    

    files1 is null !

    So for this to work you need to mount the network drive (eg assign a drive letter)
    so your

    wrapper.java.classpath.1=N:/path/to/network/drive/*.jar
    

    should work. I tested this with 13.00 and it works for me.
    To find out why it does not work for you pls provide more details:
    error log
    configuration
    does it work using runConsole.bat ?
    is N correctly mounted ?
    what about access rights to the share ?
    when running as service: are you using the yajsw/scripts/mountNetworkDrive.gv script ?

     
  • rzo

    rzo - 2021-10-16
    • status: open --> closed-works-for-me
     
  • rzo

    rzo - 2021-10-16

    no reply -> closing. feel free to reopen.

     

Log in to post a comment.