IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Java Service to Generate a File on Windows Network

    Posted Wed November 22, 2006 04:13 PM

    Hi

    I am using the following Java code in the a Java service to create a file on a windows shared drive. But the file is not getting created. Can you tell me what might be the problem.

    try {
    BufferedWriter out = new BufferedWriter(new FileWriter(\\machine1/Folder1/m.txt));
    out.write(“Hello”);
    out.close();
    } catch (IOException e) {
    }


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Java Service to Generate a File on Windows Network

    Posted Wed November 22, 2006 05:05 PM

    Change your code to this and it will show you what the specific error is. Ignore the URL wrappers–I couldn’t seem to get the forum software to not convert the filename string to an URL.

    try {
    BufferedWriter out = new BufferedWriter(new FileWriter(“\\machine1/Folder1/m.txt”));
    out.write(“Hello”);
    out.close();
    } catch (IOException e) {
    throw new ServiceException(e);
    }


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 3.  RE: Java Service to Generate a File on Windows Network

    Posted Wed November 22, 2006 05:17 PM

    I am getting the following error

    com.wm.app.b2b.server.ServiceException: java.io.FileNotFoundException: \machine1\Folder1\m.csv (Access is denied)

    but i have given complete access to this folder.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 4.  RE: Java Service to Generate a File on Windows Network

    Posted Wed November 22, 2006 05:43 PM

    I believe the user who starts the Integration Server needs access to that network folder.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 5.  RE: Java Service to Generate a File on Windows Network

    Posted Mon November 27, 2006 10:12 AM

    Believe that as you are using "", this might be treated as an escape, try giving forward slash / or append the "" with another "".

    like \\machine_name\Folder_name\File_name, this will be treated as \machine_name\folder_name\file_name.

    Is the machine accessible from the IS??

    HTH
    Malhar


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 6.  RE: Java Service to Generate a File on Windows Network

    Posted Mon November 27, 2006 04:14 PM

    It would appear that the account used to access the sharepoint in fact does not have access. How is IS being run? At the command-line or as a service? If as a service, what account is being used? That account needs to have access to the share.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 7.  RE: Java Service to Generate a File on Windows Network

    Posted Mon November 27, 2006 04:16 PM

    Given the error message, it would seem that the pathname is specified with the correct number of backslashes–if the backslashes were not escaped, the pathname in the error message would not have any backslashes.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods