Installation

java_init.js

java_init.js

by Dick Lane -
Number of replies: 3
About 5300 of 29500 lines in my current /var/log/apache2/error.log report "File does not exits" for webwork2/htdocs/js/java_init.js (and 11881 lines out of 42316 in error.log.1).

What is the current advice about coping with this error?  E.g., should either of the following options be used?

A 2011-Oct-14 blog posting said
    There are no issues reported so far related to this missing file, besides apache complains it in the error_log. To suppress this error message, run the command:
    touch WEBWORK_ROOT/htdocs/js/java_init.js

OTOH, the subversion repository for WeBWorK has no such file in trunk but there is one in system/branches/ghe3_dev/webwork2/htdocs/js
    Its latest version has contents
/*This is the file where the proper functions are initialized for the problem applets which use them.*/

function initWW(){
if (typeof(initializeWWquestion) == 'function') {
initializeWWquestion();
}
}

addOnLoadEvent(initWW);
In reply to Dick Lane

Re: java_init.js

by David Hunter -
I noticed the same issue. It looks like this file is being called from
WEBWORK_ROOT/lib/WeBWorK/ContentGenerator/Problem.pm
which contains the following:
# This is a file which initializes the proper JAVA applets should they be needed for the current problem.
print CGI::start_script({type=>"tesxt/javascript", src=>"$site_url/js/java_init.js"}), CGI::end_script();

I would guess that the first solution (creating an empty java_init.js) would be harmless, but I'd be interested in a more informed opinion.

-djh
In reply to David Hunter

Re: java_init.js

by Michael Gage -
You can find the file here:


It won't have any effect unless you are using applets.  If you are using applets and one of the newer versions of ww_applet_support.js.  Older versions of ww_applet_support.js contain the initializations in java_init.js but this blocks other java scripts which have been added later and are being used in the newer interfaces. (At the time it was created ww_applet_support.js and the jsMath library were the only javaScripts being used.)

The library of javaScripts is a bit disordered at the moment.  JavaScripts have been steadlily added as needed for development of new interfaces and placed somewhat at random under htdocs/js.  Sometime relatively soon (next 6 months?) the javascript library needs to be organized and reordered and perhaps pruned so that it can me more easily maintained.  At that point you can do a full update.   Meantime you can just copy over the file above, put it in htdocs/js and the WeBWorK installation will stop complaining (I hope).

 -- Mike
In reply to Michael Gage

Re: java_init.js

by Dick Lane -
Thanks, Mike, for your quick reply to my query sent to the Developers' list on 6-Dec-2012.

FWIW: I sent that query only after doing "svn update" with responses "at revision 3181" for the [N/O]PL and "at revision 7146" for both pg and webwork2.  I infer this is a case where the subversion and git repositories are out-of-sync.  (For my immediate use, I will place the file using the path in my original note rather than the one in your message, i.e., I will omit "blob/master/".)

dick