Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-20973

failed to submit flink-on-yarn job on Windows due to error of classPath

    XMLWordPrintableJSON

Details

    Description

      description: When I submitted flink-on-yarn job on Windows (Operating system of yarn cluster is Linux), I got error message: 

      Error: Could not find or load main class org.apache.flink.yarn.entrypoint.YarnJobClusterEntrypoint

      cause: Windows has different classPath delimiter with Linux as in Windows is " ; ", but in Linux is " : ".  the main cause is that classPath was built on Windows, but was splitted on Linux. 

      solution : replace value of  File.pathSeparator with ApplicationConstants.CLASS_PATH_SEPARATOR in class of org.apache.flink.yarn.YarnClusterDescriptor and org.apache.flink.yarn.Utils.

       

      sourceCode is displayed below:

      private ApplicationReport startAppMaster(......) throws Exception {
       ......
       // classpath assembler
       StringBuilder classPathBuilder = new StringBuilder();
       if (userJarInclusion == YarnConfigOptions.UserJarInclusion.FIRST) {
       for (String userClassPath : userClassPaths)
      { classPathBuilder.append(userClassPath).append(File.pathSeparator); }
      }
       for (String classPath : systemClassPaths)
      { classPathBuilder.append(classPath).append(File.pathSeparator); }
      ......
       // Setup CLASSPATH and environment variables for ApplicationMaster
       final Map<String, String> appMasterEnv = new HashMap<>();
       // set user specified app master environment variables
       appMasterEnv.putAll(
       BootstrapTools.getEnvironmentVariables(ResourceManagerOptions.CONTAINERIZED_MASTER_ENV_PREFIX, configuration));
       // set Flink app class path
       appMasterEnv.put(YarnConfigKeys.ENV_FLINK_CLASSPATH, classPathBuilder.toString());
       ......
       }

       

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Lv Yanquan kunnni
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: