-
Notifications
You must be signed in to change notification settings - Fork 32
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
Java Visualizer not working #6
Comments
Hi, I'm copying from your email: When I click on Visualize Execution button, it says please wait..processing your code and does not processes anything. I can not see frames on the left side of the screen. |
Hi David, Thanks for the quick reply. Yes, the output inside {} is blank as compared Could you please guide me so that I can go ahead? Thanks, On Sun, Sep 27, 2015 at 12:29 AM, Dave Pritchard notifications@github.com
|
Hi David, After turning on debugging in firefox and following above steps I am facing Thanks, On Sun, Sep 27, 2015 at 11:52 AM, Dave Pritchard notifications@github.com
|
Hi, I forgot to send network tab response. Thanks, On Sun, Sep 27, 2015 at 12:17 PM, Nilesh Takale nileshtakale@gmail.com
|
I don't see any errors copied in. Start with the Javascript console errors. |
Hi, There is syntax error, check my second attachments. Thanks, On Sun, Sep 27, 2015 at 12:54 PM, Dave Pritchard notifications@github.com
|
There's nothing there. I am not sure you can email attachments in GitHub Issue threads. Try responding on the webpage #6 and attaching your info there directly. |
I have sent email attachments to your gmail id. Please check. On Sun, Sep 27, 2015 at 12:58 PM, Dave Pritchard notifications@github.com
|
Please keep your replies on GitHub instead of email if you don't mind. So I see you have a syntax error on line 1 of config.js.php. If you click on that error, you should be able to see what the error is (like, what are the contents of that file). Can you check that? Also, try refreshing the page and observing the network tab. Right now it only captured the "visualize" action but not the original page load. |
Hi, When I click on Visualize execution facing below error, [13:13:01.203] Use of getPreventDefault() is deprecated. Use In network tab it goes to the URL http://192.168.147.10/example-code/ , On Sun, Sep 27, 2015 at 1:03 PM, Dave Pritchard notifications@github.com
|
Hi David, I guess there are few css and javascript errors. I can see in network tab Config.js.php processes jv-config.json, if it fails then it says You will I am facing below script errors, [13:25:16.540] Error in parsing value for 'filter'. Declaration dropped. @ http://192.168.147.10/OnlinePythonTutor/v3/css/jquery.qtip.css:570[13:26:51.965] SyntaxError: syntax error @ Thanks, On Sun, Sep 27, 2015 at 1:19 PM, Nilesh Takale nileshtakale@gmail.com
|
Hi, Please let me know what I need to do. Is there issue at my end? Thanks, |
It looks like you don't have php installed, or your webserver's php module is not activated. |
Ok. I am sorry but I am not aware of installing php on webserver. In my www folder I only have html module. Could you please provide any reference so that I can move ahead? |
I guess your command-line visualizer is working, but it is not working with your jail. Did you try "Try with safeexec (from java_jail) ... " from the README? Did you follow all the installation steps, particularly (2) and (4)? Did you install and build safeexec? |
I did not do "Try with safeexec (from java_jail). But now I did it with /usr/java_visualizer/safeexec-master/safeexec --chroot_dir . --exec_dir / --share_newnet --nproc 50 --mem 3000000 --nfile 30 --env_vars CLASSPATH=/cp/:/cp/javax.json-1.0.jar:/java/lib/tools.jar --exec /java/bin/java traceprinter.InMemory < /usr/java_visualizer/java_jail-master/cp/traceprinter/test-input.txt getting below error, error 13 (Permission denied): execve error Command exited with non-zero status (1) what to do for this permission error? |
Did you follow steps 2 copying in all of the libraries into subfolders of the jail? I believe that can cause this error. Did you follow every other step in the instructions? |
Yes, I followed all the steps. I copied necessary library files in lib64,etc and proc. I did not do anything for /lib and /usr/lib though. My java_jail has 6 folders named java,cp,dev,etc,lib64 and proc. |
What about the more basic hello world example in the safeexec README? |
Yes, it does gets executed. I did check that, while installing safeexec. /usr/java_visualizer/safeexec-master/safeexec --chroot_dir . --exec_dir / --share_newnet --nproc 50 --mem 3000000 --nfile 30 --env_vars CLASSPATH=/cp/:/cp/javax.json-1.0.jar:/java/lib/tools.jar --exec /usr/java_visualizer/java_jail-master/java/bin/java traceprinter.InMemory < /usr/java_visualizer/java_jail-master/cp/traceprinter/test-input.txt Error occurred during initialization of VM |
Try increasing --mem |
this is weird.. /usr/java_visualizer/safeexec-master/safeexec --chroot_dir . --exec_dir / --share_newnet --nproc 50 --mem 30000000 --nfile 30 --env_vars CLASSPATH=/cp/:/cp/javax.json-1.0.jar:/java/lib/tools.jar --exec /usr/java_visualizer/java_jail-master/java/bin/java traceprinter.InMemory < /usr/java_visualizer/java_jail-master/cp/traceprinter/test-input.txt Error: Could not find or load main class traceprinter.InMemory |
Is your pwd the jail? (I assume so since chroot_dir is . ) Double-check that the file java_jail/cp/traceprinter/InMemory.class exists and is readable by anyone |
I'm at / and yes the class exists and readable by anyone. |
Can you show me the output of "sudo find / | grep libpthread" |
You need it in the exact same subfolder of jail as it appears in the root. So instead of java_jail-master/lib64, put it in java_jail-master/lib/x86_64-linux-gnu |
After copying all files from /jai/lib64 to /jail/lib, I executed below command and it gave me output. /usr/java_visualizer/safeexec-master/safeexec --chroot_dir /usr/java_visualizer/java_jail-master --exec_dir / --share_newnet --nproc 50 --mem 30000000 --nfile 30 --env_vars CLASSPATH=./cp/:./cp/javax.json-1.0.jar:./java/lib/tools.jar --exec /java/bin/java traceprinter.InMemory < /usr/java_visualizer/java_jail-master/cp/traceprinter/test-input.txt now what next? |
If that output looks more or less correct, try using the web interface again. |
Yeah, I tried but as you said "configuring the glue to the webserver" is what we need to do |
So what happens when you try to use the visualizer webpage now? |
Go into java_safe_maketrace.php, uncomment the line "// echo $jv_cmd; // for debugging" and try again. |
I do not know if I am correct or not but why it is looking at below location? :/cp/visualizer-stdlib traceprinter.InMemory. Class file is not at that location. |
Not sure what you are asking me. Is "class file is not at that location" an error message? It should be there. And this worked, no? /usr/java_visualizer/safeexec-master/safeexec --chroot_dir /usr/java_visualizer/java_jail-master --exec_dir / --share_newnet --nproc 50 --mem 30000000 --nfile 30 --env_vars CLASSPATH=./cp/:./cp/javax.json-1.0.jar:./java/lib/tools.jar --exec /java/bin/java traceprinter.InMemory < /usr/java_visualizer/java_jail-master/cp/traceprinter/test-input.txt In that error message there is the command-line string. Try running it at the command-line manually. |
Yes, I did get output from above command. Command from error message /usr/java_visualizer/safeexec-master/safeexec --chroot_dir /usr/java_visualizer/java_jail-master/ --clock 15 --cpu 10 --mem 4000000 --exec_dir / --env_vars '' --nproc 50 --nfile 50 --share_newnet --exec /usr/java_visualizer/java_jail-master/java/bin/java -Xmx512M -cp /cp/:/cp/javax.json-1.0.jar:/java/lib/tools.jar:/cp/visualizer-stdlib traceprinter.InMemory error 2 (No such file or directory): execve error Command exited with non-zero status (1) |
I don't think you are correctly understanding what the command line is doing. It's telling java there are 4 classpath elements. The traceprinter.InMemory need not be in the 4th one. The problem I DO see is that the generated command is wrong. Where it says "--exec /usr/java_visualizer/java_jail-master/java/bin/java" it should just say "--exec /java/bin/java" because that's the correct path once you've been chrooted. Did you make further changes to the config.json file or did you make alterations to java_safe_ram_maketrace.php? |
Command from error message and its message, /usr/java_visualizer/safeexec-master/safeexec --chroot_dir /usr/java_visualizer/java_jail-master/ --clock 15 --cpu 10 --mem 4000000 --exec_dir / --env_vars '' --nproc 50 --nfile 50 --share_newnet --exec /java/bin/java -Xmx512M -cp /cp/:/cp/javax.json-1.0.jar:/java/lib/tools.jar:/cp/visualizer-stdlib traceprinter.InMemory Time Limit Exceeded |
Try increasing the memory limit specified in the json file to 30000000. |
Same error, Server error. Report a bug to daveagp@gmail.com (click 'Generate URL' and include it). Debug info (also copied to console): |
Re-comment out the debugging line in java_safe_maketrace.php |
Excellent! Have fun! |
Thanks a lot! |
Sorry to bother you again but after fresh installation on AWS I am getting below error, pytutor_ajax_timeout_millis is not defined. The variable is there in config.js.php. Could you please help? Thanks. |
Please start a new issue thread, not this one. Did you remember to copy jv-config.example.json to jv-config.json as specified in the README? |
Hey...we got it resolved..we updated the PHP version and it worked. Thanks. |
Hi, When I try this command from java_jail: Output is: Output is: Both are run from inside the java_jail |
Please use a new issue. There, tell me what happens when you increase the --mem argument. |
Hi,
I followed all the steps on my RHEL 7 64 bit OS to install Java Visualizer, but still it is not working.
safeexec is working properly.
In Java jail when I execute below command ,
./java/bin/java -cp .:cp:cp/javax.json-1.0.jar:java/lib/tools.jar traceprinter.InMemory < cp/traceprinter/test-input.txt
it gives me below output.
{"code":"public class Test { public static void main(String[] args) { int x = 3; x += x; } }","stdin":"","trace":[{"stdout":"","event":"call","line":1,"stack_to_render":[{"func_name":"main:1","encoded_locals":{},"ordered_varnames":[],"parent_frame_id_list":[],"is_highlighted":true,"is_zombie":false,"is_parent":false,"unique_hash":"1","frame_id":1}],"globals":{},"ordered_globals":[],"func_name":"main","heap":{}},{"stdout":"","event":"step_line","line":1,"stack_to_render":[{"func_name":"main:1","encoded_locals":{},"ordered_varnames":[],"parent_frame_id_list":[],"is_highlighted":true,"is_zombie":false,"is_parent":false,"unique_hash":"2","frame_id":2}],"globals":{},"ordered_globals":[],"func_name":"main","heap":{}},{"stdout":"","event":"step_line","line":1,"stack_to_render":[{"func_name":"main:1","encoded_locals":{"x":3},"ordered_varnames":["x"],"parent_frame_id_list":[],"is_highlighted":true,"is_zombie":false,"is_parent":false,"unique_hash":"4","frame_id":4}],"globals":{},"ordered_globals":[],"func_name":"main","heap":{}},{"stdout":"","event":"step_line","line":1,"stack_to_render":[{"func_name":"main:1","encoded_locals":{"x":6},"ordered_varnames":["x"],"parent_frame_id_list":[],"is_highlighted":true,"is_zombie":false,"is_parent":false,"unique_hash":"8","frame_id":8}],"globals":{},"ordered_globals":[],"func_name":"main","heap":{}},{"stdout":"","event":"return","line":1,"stack_to_render":[{"func_name":"main:1","encoded_locals":{"x":6,"return":["VOID"]},"ordered_varnames":["x","return"],"parent_frame_id_list":[],"is_highlighted":true,"is_zombie":false,"is_parent":false,"unique_hash":"9","frame_id":9}],"globals":{},"ordered_globals":[],"func_name":"main","heap":{}}],"userlog":"Debugger VM maxMemory: 3513M\n"}
everything is blank inside {}.
I also tried accessing Java Visualizer by http://localhost/java_visualize. but its not working.
Please help.
Thanks.
The text was updated successfully, but these errors were encountered: