Java Applet not working

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.

+4
source share
1 answer

I use FF4 on windows (Java 1.6.0_24) and was able to see the applet at http://www.ecoles-dudelange.lu/cgi-bin/apps/tiparlo?projectid=1594&mode=viewer .

However, when I clicked on the big blue game icon at the bottom of the page, all the emoticons in the panel above the button seem to glow - the โ€œMexican waveโ€ style. Impressive:)

I looked into the java applet console and noticed the following errors after clicking a button:

 network: Cache entry not found [url: http://www.ecoles-dudelange.lu/resources/audio/_tiparlo_1594/ismael_20110405_11-17-47_3129344.ogg, version: null] network: Connecting http://www.ecoles-dudelange.lu/resources/audio/_tiparlo_1594/ismael_20110405_11-17-47_3129344.ogg with proxy=DIRECT network: Cache entry not found [url: http://85.119.157.43/crossdomain.xml, version: null] network: Connecting http://85.119.157.43/crossdomain.xml with proxy=DIRECT network: Connecting http://85.119.157.43:80/ with proxy=DIRECT java.security.AccessControlException: access denied (java.net.SocketPermission 85.119.157.43 resolve) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkConnect(Unknown Source) at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at java.net.URL.openStream(Unknown Source) at lu.educdesign.audio.gui.JRecordApplet.load(Unknown Source) 

...

The URL http://85.119.157.43/crossdomain.xml loads an html page that redirects a username / password request to http://confixx.s2.olefa.com .

There may be a good explanation for this, but it seems to me, prima facie, that this could be a problem

+4
source

All Articles