Support Questions

Find answers, ask questions, and share your expertise

Unable to run/execute PrintSampleStreamTopology using storm

avatar

Hi

I am trying to set run the PrintSampleStream topology and hence, I downloaded the latest storm-starter topology from http://apache.mesi.com.ar/storm/apache-storm-1.0.2/

and tried to run the PrintSampleStreamTopology, using the command

mvn compile exec:java -Dstorm.topology=org.apache.storm.starter.PrintSampleStream

but on running it, I got the error,

[WARNING]

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)

at java.lang.Thread.run(Thread.java:748)

Caused by: java.lang.ArrayIndexOutOfBoundsException: 0

at org.apache.storm.starter.PrintSampleStream.main(PrintSampleStream.java:33)

... 6 more

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 15.754 s

[INFO] Finished at: 2017-05-16T16:00:06-04:00

[INFO] Final Memory: 36M/746M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project storm-starter: An exception occured while executing the Java class. null: InvocationTargetException: 0 -> [Help 1]

[ERROR]

and then, I thought this could be because of missing command line parameters, and therefore when i run the same command but providing command line arguments (my twitter keys) like,

mvn compile exec:java -Dstorm.topology=org.apache.storm.starter.PrintSampleStream "key" "key" "key" "key" "monday"

then i get the following error:

[INFO] ------------------------------------------------------------------------

[ERROR] Unknown lifecycle phase "3iUoGsyEocTZQo0Ay5XH4MHSQ". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

[ERROR]

Please could somebody help? I am running these commands from /apache-storm-1.0.2/examples/storm-starter directory.

Regards

Naveen Keshava

1 ACCEPTED SOLUTION

avatar
Expert Contributor

@Naveen Keshava why are you trying to run it using Maven? The issue is the code requires command line however maven is treating those arguments as goals. Please compile and run independently, even if you are trying to run it locally.

View solution in original post

3 REPLIES 3

avatar

Guys it will be great if you could help me here ! thanks in advance, @Sriharsha Chintalapani @Constantin Stanca @Ambud Sharma

avatar
Expert Contributor

@Naveen Keshava why are you trying to run it using Maven? The issue is the code requires command line however maven is treating those arguments as goals. Please compile and run independently, even if you are trying to run it locally.

avatar

Thanks @Ambud Sharma I was able to solve the problem by building locally.