Results 1 to 3 of 3
  1. #1
    ldelatorre is offline Member
    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0

    Default 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:

    <applet code="FallingBall_pkg.FallingBallApplet.class"
    codebase="http://localhost/pluginfile.php/25/mod_ejsapp/jarfile/5/"
    archive="ejs_FallingBall.jar"

    name="ejs_FallingBall"
    id="ejs_FallingBall"
    width="800"
    height="600">
    <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"/>
    </applet>

    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:

    /21/mod_ejsapp/jarfile/1/ejs_Gyroscope.jar

    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:

    /21/mod_ejsapp/jarfile/1/org/opensourcephysics/tools/DefaultState.out

    or

    /21/mod_ejsapp/jarfile/2/servo_pkg/images/Servo.jpg

    or

    /21/mod_ejsapp/jarfile/3/org/opensourcephysics/resources/Resources.properties

    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.

    Thanks.
    Last edited by ldelatorre; 10-25-2012 at 04:35 PM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Serving an applet embedded in html

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Serving an applet embedded in html

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 15
    Last Post: 10-08-2012, 11:23 AM
  2. Interaction with embedded java applet
    By veggieCoder in forum New To Java
    Replies: 10
    Last Post: 01-12-2012, 07:20 PM
  3. Replies: 12
    Last Post: 07-25-2011, 03:25 PM
  4. Embedded applet in jsp its not working.
    By charmi in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 06-17-2011, 11:22 AM
  5. Serving up a Webpage
    By kammce in forum Networking
    Replies: 7
    Last Post: 01-01-2011, 02:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •