Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

RunCommand Error

gumbatman
8 - Asteroid

Hello,

 

I am having an issue with the RunCommand tool running Java (at least that is what I think it is).


Running the Sentiment Tool (from the Comparing Sentiment Analysis Algorithms article) I keep encountering this error: 

    "Error: Run Command (5): The external program "java" returned an error code: 2"

 

Thinking it was an issue with Java how is setup, I tried to run Java in a Command Window - that works. I was even able to run the StandfordCoreNLP Sentiment tool from a Command Window. I am also able to run Java from any directory, so I don't think it is a Path issue.

 

To test the RunCommand, I made a very simple workflow. Here's the Configuration for the RunCommand tool. This also is returning the same error as above.

 JavaExample.jpg

I tried java, java.exe and  C:\Program Files\Java\jre1.8.0_181\bin\java.exe. None of those seemed to make a difference.

 

What is it that I am doing wrong?

 

Thank you for the help.

11 REPLIES 11
jdunkerley79
ACE Emeritus
ACE Emeritus

You will need to configure the run command closer to how it was in the original post. Look at this comment https://community.alteryx.com/t5/Data-Science-Blog/Comparing-Sentiment-Analysis-Algorithms/bc-p/3879...

 

You need to write out a CSV not a YXDB as Java will not be able to read Alteryx native format. 

 

The Java command is just the first part of the command. You need all the arguments to tell it to load the class and then perform the analysis.

 

Take a look at this bit of the Stanford site as well: https://stanfordnlp.github.io/CoreNLP/cmdline.html

It talks over how to set up calling on the command line.

 

Given the prevalence of REST APIs for sentiment analysis you might find that an easier solution (e.g. https://azure.microsoft.com/en-gb/services/cognitive-services/text-analytics/).

 

gumbatman
8 - Asteroid

jdunkerley79,

 

I appreciate the quick response. I do have the RunCommand configured like the original post (I didn't post that), but I was getting an error. So I tried to see if I could get just Java to run at all, with no arguments and no analysis.

 

I am able to run the analysis from a Command Line, but just not in Alteryx. 

 

Would you have an example of a simple test I can try to see if Java works using the RuCommand tool? 

 

Thank you!

jdunkerley79
ACE Emeritus
ACE Emeritus

Try the attached.

 

2018-10-12_16-38-01.png

 

--version is the easiest argument to check Java works

gumbatman
8 - Asteroid

Again, I really appreciate the help. Unfortunately that is not working for me. I am getting this error:

JavaError.jpg

If I enter type: java -version into a Command Window, that works. I did also put an input.csv file in my %temp% directory, just in case that is an issue.

jdunkerley79
ACE Emeritus
ACE Emeritus

Sorry not to solve straight away but sure we can find a solition.

 

Try this one.

 

It wraps the Java command in a cmd shell. If it works it should stay open and display the Java version:

2018-10-12_18-23-42.jpg

 

Type exit and the workflow should complete.

 

%temp% is a special Alteryx variable.

 

If this approach works then we can make Alteryx spit out a batch script file and then run that.

 

jdunkerley79
ACE Emeritus
ACE Emeritus
 
gumbatman
8 - Asteroid

That worked!

 

However, when I opened the Workflow, I received a message saying:

This workflow was created by a more recent version of Alteryx, and may contain tools or functionality not present in this version. Alteryx  does not support using an earlier version of Alteryx to open a workflow created with a newer version. For best results, download the latest version of Alteryx .

 

I am on version 2018.2.5.48994.

 

So, what's the next step? (I wish I could insert a very excited emoji!)

jdunkerley79
ACE Emeritus
ACE Emeritus

Hi @gumbatman,

 

Sorry for delay in replying.

 

The next step is to amend the input macro to wrap in a cmd command. I'll stick a prototype together tonight and down version it to 2018.2.

 

Hopefully that will work for you.

 

J

 

 

gumbatman
8 - Asteroid

No worries. I wouldn't have had a chance to check this over the weekend. Plus, you've been amazingly helpful already. Whenever you have a moment to put together a prototype, that would be great. 

Thank you so much.

Labels