Uploaded image for project: 'Sqoop (READ-ONLY)'
  1. Sqoop (READ-ONLY)
  2. SQOOP-183

CompilationManager fails to rename auto generated files

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.3.0
    • Component/s: codegen
    • Labels:
    • Environment:
      64bit Ubuntu 10.10 Linux, Java build 1.6.0_24-b07, mysql 5.1.49-1ubuntu8.1

      Description

      After running command below:
      sqoop codegen --connect jdbc:mysql://localhost/sqoop_test --username root --password xxxxx --table foo -outdir foobar
      Sqoop outputs like this:
      11/04/10 16:17:37 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
      11/04/10 16:17:37 INFO tool.CodeGenTool: Beginning code generation
      11/04/10 16:17:37 INFO manager.MySQLManager: Executing SQL statement: SELECT t.* FROM `foo` AS t LIMIT 1
      11/04/10 16:17:38 INFO manager.MySQLManager: Executing SQL statement: SELECT t.* FROM `foo` AS t LIMIT 1
      11/04/10 16:17:38 INFO orm.CompilationManager: HADOOP_HOME is /home/angus/src/hadoop
      Note: /tmp/sqoop-angus/compile/c57bf5a7ba52d0e86dc9809fbb6417d1/foo.java uses or overrides a deprecated API.
      Note: Recompile with -Xlint:deprecation for details.
      11/04/10 16:17:40 ERROR orm.CompilationManager: Could not rename /tmp/sqoop-angus/compile/c57bf5a7ba52d0e86dc9809fbb6417d1/foo.java to /home/angus/foobar/foo.java
      11/04/10 16:17:40 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-angus/compile/c57bf5a7ba52d0e86dc9809fbb6417d1/foo.jar

      It shows that CompilationManager fails to rename foo.java. Then I changed permission of the "foobar" directory to 777, but with no luck. And the failure might be caused by the call to File.renameTo. After replacing the call with FileUtils.moveFile in commons-io, it works. (LocalFileSytem.rename in Hadoop works as well).

        Attachments

          Activity

            People

            • Assignee:
              angushe Angus He
              Reporter:
              angushe Angus He
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: