Results 1 to 3 of 3
- 10-25-2012, 04:09 PM #1Member
- Join Date
- Oct 2012
- Rep Power
Serving an applet embedded in html
I'm new here, so hi all :-)
I'm using Moodle (this is not really relevant... I think) to embed and serve an applet to my students.
This is the code I have:
<param name="context_id" value="5"/>
<param name="user_id" value="2"/>
<param name="ejsapp_id" value="5"/>
<param name="language" value="en"/>
<param name="username" value="Admin User"/>
<param name="password" value="8560f4ae284f4930b22567fd7945f2b5"/>
<param name="moodle_upload_file" value="http://localhost/mod/ejsapp/upload_file.php"/>
Now, Moodle stores files in a data folder (outside the apache root folder) and those files are served using the pluginfile.php script, which is provided by the Moodle software.
I think there is nothing wrong with my code because it works and by that I mean the applet loads and it is shown embedded in the webpage BUT it can take even 4 or 5 minutes to do so!
Depending on the applet, it can actually only take a few seconds, which is the time it usually takes to load most embedded applets around there.
Even more, if I write http://localhost/pluginfile.php/25/m...allingBall.jar in my browser's url bar, I instantly get the option to download the file and this is done quickly.
Everytime the webpage with the previous code is loaded, pluginfile.php is called. Regardless the applet being used, pluginfile.php always receive something like:
Which is ok.
Now, while for some applets the previous call to pluginfile.php is done only once (this are the cases in which the applet loads in jus a few seconds, and this is the way it should work), for others pluginfile.php can be called 10 or 15 times, receiving something like:
This are just random examples. Anyway, the thing is all those are files inside of some of the .jar files. I don't know how or why this happens but it seems to me that Moodle File API open the .jar files and sometimes (only for some applets) it decides that it needs to serve those files inside the .jar aswell as the .jar itself. When this happens, it seem those files can't be accessed (so they cant be served) and Moodle keeps trying. As I said, sometimes 15 calls to pluginfile.php (always receiving the same parameters) are done.
When looking at the apache logs, I can see messages like these ones:
[Wed Oct 17 20:14:25 2012] [error] [client 127.0.0.1] File does not exist: C:/Moodle/server/moodle/mod/ejsapp/DefaultState.out
[Wed Oct 17 20:14:25 2012] [error] [client 127.0.0.1] Default exception handler: Sorry, the requested file could not be found Debug: \r\nError code: filenotfound\n* line 467 of \\lib\\setuplib.php: moodle_exception thrown\n* line 1917 of \\lib\\filelib.php: call to print_error()\n* line 4221 of \\lib\\filelib.php: call to send_file_not_found()\n* line 38 of \\pluginfile.php: call to file_pluginfile()\n
Thats from the error.log file.
127.0.0.1 - - [17/Oct/2012:20:14:25 +0200] "HEAD /mod/ejsapp/DefaultState.out HTTP/1.1" 404 - "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.7.0_07"
127.0.0.1 - - [17/Oct/2012:20:14:25 +0200] "HEAD /pluginfile.php/21/mod_ejsapp/jarfile/1/org/opensourcephysics/tools/DefaultState.out HTTP/1.1" 404 - "-" "Mozilla/4.0 (Windows XP 5.1) Java/1.7.0_07"
The last one is from the access.log file.
Well, I think thats all. I hope someone has an idea of what might be going on here.
Im sorry for the huge message with the tons of lines of code but I am totally lost and I really need help.
Last edited by ldelatorre; 10-25-2012 at 04:35 PM.
- 10-25-2012, 05:07 PM #2
- 10-25-2012, 05:10 PM #3
Re: Serving an applet embedded in html
https://moodle.org/mod/forum/discuss.php?d=214080 -- several responses
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- By deepakthomas in forum New To JavaReplies: 15Last Post: 10-08-2012, 11:23 AM
- By veggieCoder in forum New To JavaReplies: 10Last Post: 01-12-2012, 07:20 PM
- By Reskaillev in forum New To JavaReplies: 12Last Post: 07-25-2011, 03:25 PM
- By charmi in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 06-17-2011, 11:22 AM
- By kammce in forum NetworkingReplies: 7Last Post: 01-01-2011, 02:57 AM