Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null Pointer Exception while executing the scala pragrams #1

Open
thugliffe opened this issue Dec 16, 2015 · 7 comments
Open

Null Pointer Exception while executing the scala pragrams #1

thugliffe opened this issue Dec 16, 2015 · 7 comments

Comments

@thugliffe
Copy link

I get a null pointer exception while executing the sample code from the examples folder. The error is as :

Exception in thread "main" java.lang.NullPointerException
    at org.apache.flink.runtime.minicluster.FlinkMiniCluster.startWebServer(FlinkMiniCluster.scala:295)
    at org.apache.flink.runtime.minicluster.FlinkMiniCluster.start(FlinkMiniCluster.scala:268)
    at org.apache.flink.runtime.minicluster.FlinkMiniCluster.start(FlinkMiniCluster.scala:226)
    at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.execute(LocalStreamEnvironment.java:101)
    at com.dataartisans.flink_demo.examples.TotalArrivalCount$.main(TotalArrivalCount.scala:96)
    at com.dataartisans.flink_demo.examples.TotalArrivalCount.main(TotalArrivalCount.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

Process finished with exit code 130

Am I missing something ??

@fhueske
Copy link
Contributor

fhueske commented Dec 16, 2015

Thanks for reporting this issue.
The examples assume that the project root folder is set as working directory when the programs are executed (the ./data/dummyLogFile.txt as specified in DemoStreamEnvironment must be found).
You can set the working directory in Intellij's "Run/Debug Configurations".

Please let me know if that works for you.

@thugliffe
Copy link
Author

I did what you said but it is still giving me the same null pointer exception. The val webServer is resolving to null.

@fhueske
Copy link
Contributor

fhueske commented Dec 16, 2015

So, the path <workingDir>/data/dummyLogFile.txt points to this file?

@thugliffe
Copy link
Author

yes.

@StephanEwen
Copy link

.You can also disable the local web frontend in this class:
https://github.com/dataArtisans/flink-streaming-demo/blob/master/src/main/scala/com/dataartisans/flink_demo/utils/DemoStreamEnvironment.scala

The current master does not have that issue any more, so you could also set
the Flink dependency of the example to 1.0-SNAPSHOT.

On Wed, Dec 16, 2015 at 3:42 PM, Biru C. Sainju notifications@github.com
wrote:

yes.


Reply to this email directly or view it on GitHub
#1 (comment)
.

@thugliffe
Copy link
Author

I found the cause for the exception. It was due to the default port 8081 being used by some other service. I changed the default port number in the file DemoStreamEnvironment.scala by adding the following code segment and it worked like a charm.

config.setInteger(ConfigConstants.JOB_MANAGER_WEB_PORT_KEY,9999)

Thanks for your help.

@HungUnicorn
Copy link

Had the same issue and the above solution solved the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants