The client noticed that one of our java applets no longer works. However, we cannot say what the problem is.
the functions
Webapp tiparlo . It is used for recording and organizing spoken language and is mainly used in schools for language teaching and storage for assessment later. The application consists of an HTML interface that is controlled by JavaScript. Sound playback and recording are carried out through the built-in Java applet . As you can see on the test page, the applet itself is in working condition.
However, in tiparlo, the applet (hereinafter referred to as soundrecorder) does not have a pre-loaded sound file. Because tiparlo consists of several sound files, JavaScript tells soundrecorder which file to play. For example, if you want foo.ogg to play, javascript tells soundrecorder to play http: //url/path/foo.ogg .
This has been working for several years, but no more.
Error Accounting
The problem is that it works under certain conditions. For example, it runs on our local dev machines and on our public test env. It just stopped working for our customers.
Working example: http://test.s2.olefa.com/cgi-bin/apps/tiparlo?projectid=3&mode=viewer
Non-working example: http://www.ecoles-dudelange.lu/cgi-bin/apps/tiparlo?projectid=1594&mode=viewer
Some useful facts:
both examples work on the same server
java applet, js code, html parser and source code are shared resources. Therefore, both examples work with the same code.
The relevant files include the following: soundrecorder.js and jrecord.jar. The play command is in the soundrecorder.js file: line 112
What do we know so far
Browsers react differently to a non-working example. Safari / Mac plays everything right. Safari / Win, however, freezes the game. Firefox 4 doesn't play anything. Firefox 3.5 / Mac does everything right again. However, Firefox3.5 / Win does not play anything at all. IE9 has the same problem. The same goes for Chrome. The opera is disabled directly and must be restarted. We have not yet found a browser on Linux that works with a non-working example. To clarify: a working example works with all browsers on all platforms except Safari / Win (meh). UPDATE: Depends on java version. With java 6.20 all non-working example works in all browsers. With java 6.24, only a working example works.
We tried to use an alternate url server for our non-working example (webX.sX.olefa.com), which looks like a working example. This attempt failed.
We tried to use relative paths for soundrecorder (e.g. / path / foo.ogg).
We tried updating Java to the latest version.
We tried to access applets in different ways.
We had a similar problem 6 months ago, which was caused by a java update. We tried a non-working example in a virtual machine with an older java version. It is working. However, we suspect that only java is not the culprit, since the same java-version / browser works in a working example.
Soundrecorder only refuses to play files that are dynamically loaded via JS. If it uploads the file to init, there is no error.
The applet itself loads. You can make it visible by specifying its width / height. I suspect there is a problem in java / js communication (js tells java what to play, but the connection is broken?). However, I cannot confirm this yet.
Generally speaking, we cannot find out why the same code working under the same conditions works on one site, but not on another.
Decision
The solution is part of the comment. The problem and solution can be found here. Thanks to Ryan for pointing us in the right direction.
source share