SpencerPark / IJava

A Jupyter kernel for executing Java code.
MIT License
1.1k stars 217 forks source link

IJava will not run any Java code. #27

Closed johncbowers closed 6 years ago

johncbowers commented 6 years ago

This error is occurring locally on machines which we installed IJava on and on a fresh binder installation created directly from the SpencerPark/ijava-binder base.

History:

  1. We have installed IJava on a number of linux Mint machines through apt-get and it was running fine last week. We have not consciously made an update to the machines in the intervening week, but currently suspect the error is due to an automated minor-point upgrade of Java.
  2. Because I thought the problem was with our configuration, I decided to use Binder and am getting exactly the same error in Binder.

Steps to reproduce.

  1. Create a new github repository. (Mine is at https://github.com/johncbowers/CS149_F18 if you just want to use mine.)
  2. Clone the https://github.com/SpencerPark/ijava-binder repository and copy all files to the new repository.
  3. Push changes.
  4. Open mybinder.org in a browser and enter your new github repo in the url field (again, you can use mine above).
  5. Create a new Java notebook.
  6. Enter
    int x = 5;
    System.out.println(x);

    in the input field and hit SHIFT+ENTER.

In Binder, I have had two results from these actions. The first time, I got the following stack trace:


java.lang.IllegalStateException: No result with key: 0 at io.github.spencerpark.ijava.execution.IJavaExecutionControl.takeResult(IJavaExecutionControl.java:80) at io.github.spencerpark.ijava.execution.CodeEvaluator.evalSingle(CodeEvaluator.java:78) at io.github.spencerpark.ijava.execution.CodeEvaluator.eval(CodeEvaluator.java:122) at io.github.spencerpark.ijava.JavaKernel.evalRaw(JavaKernel.java:251) at io.github.spencerpark.ijava.JavaKernel.eval(JavaKernel.java:256) at io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:307) at io.github.spencerpark.jupyter.channels.ShellChannel.lambda$bind$16(ShellChannel.java:54) at java.base/java.lang.Thread.run(Thread.java:844) at io.github.spencerpark.jupyter.channels.Loop.run(Loop.java:44)

The second time, binder hanged and eventually turned into a completely white webpage (some black text temporarily flashed on the screen that appeared to be an error, but its gone). Actually now I can't hit it at all.

On our Mint machines, we are simply launching jupyter notebook, entering the same Java code as above, and receiving the same stack trace.

johncbowers commented 6 years ago

Widely varying errors on the binder. Attached is a screenshot.

binder-error
marlohaering commented 6 years ago

Same issues appearing for me.

SpencerPark commented 6 years ago

@johncbowers thank you for the very detailed report. I still don't know how I never managed to run into these problems in my own testing given how common it is that they appear.

The "No result with key" error looks like a duplicate of #24 which was fixed on master but still not in a release. The "Incomplete input" gibberish looks like a duplicate of #23 which is also fixed but not in a release yet.

As it appears this is for a class (which I believe many users of this project are using it for teaching) and the school year is beginning, if I can't find a fix for the 3rd error I'm looking into today, I'll just release these fixes so you will have something stable and working in time.

SpencerPark commented 6 years ago

I've released 1.1.2 which includes fixes for these. The binder repo is update accordingly (just version number bumps in the Dockerfile). If you would like, try your samples to confirm and please close this if it is working as expected. Binder

Thanks!