4 Replies Latest reply on Jul 17, 2018 4:05 AM by Paul Nicolson

    Error when using Extract API 2.0 in Java

    Bence Tamas

      Hi,

       

      I downloaded and extracted the Tableau Exract API 2.0, as described in.https://onlinehelp.tableau.com/v10.5/api/extract_api/en-us/help.htm#Extract/extract_api_installing.htm%3FTocPath%3D____ . When I try to run the sample Java code, I get the following error:

       

      $ant run -Dargs="--build --filename 'test2.hyper'"
      Buildfile: <path-to-api>/samples/build.xml
      
      
      compile:
      
      
      setRunProps:
      
      
      run:
           [java] Error
           [java] A fatal error occurred while creating the extract:
           [java] extract path must have .hyper extension
           [java] Printing stack trace now:
           [java] com.tableausoftware.TableauException: extract path must have .hyper extension
           [java] at com.tableausoftware.hyperextract.Extract.<init>(Unknown Source)
           [java] at com.tableausoftware.demos.TableauSDKSample.createOrOpenExtract(Unknown Source)
           [java] at com.tableausoftware.demos.TableauSDKSample.main(Unknown Source)
           [java] Exiting now.
           [java] Java Result: 255
      
      
      BUILD SUCCESSFUL
      Total time: 0 seconds
      

       

       

      This seems to me an encoding issue, the filename is not interpreted correctly. Similar issue occurs, when I try to create a TableDefinition from Java code, if I add two columns named 'col1' and 'col2',  I get:

      com.tableausoftware.TableauException: duplicate column name

      However if I use 'col1' and 'col 2' as column names, everything goes fine with that call. Anybody has some ideavironmen, what is the exact problem? How can I solve it?

       

      My environment:

      Ubuntu 16.04

      openjdk version "1.8.0_162"

       

       

       

       

      Thanks for the answer!

      Bence Tamas