javascript - Java Applet not working -


a client noticed 1 of our java applets wasn't working anymore. however, not able tell problem is.

specs

the webapp tiparlo. used record , organize spoken language , used @ schools train language , store evaluation later. app consists of html interface, managed javascript. sound playing , recording done via in-house developed java applet. can see on test-page, applet in working state.

in tiparlo however, applet (further called soundrecorder) doesn't have preloaded sound file. since tiparlo consists of multiple sound files, javascript tells soundrecorder file play. instance, if want foo.ogg played, javascript tells soundrecorder play http://url/path/foo.ogg.

this worked years not anymore.

bugtracking

the problem does work under conditions. instance, works on our local dev-machines, , on our public test-env. ceased work our clients.

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 running on same server

  • the java applet, js code, html parser , source code shared resources. hence, both examples running exact same code

  • the relevant files problem are: soundrecorder.js , jrecord.jar. play command in soundrecorder.js:line 112

what know far

  • browsers react differently non-working example. safari/mac plays right. safari/win freezes on play. firefox 4 doesn't play @ all. firefox 3.5/mac right again. firefox3.5/win doesn't play @ all. ie9 has same problem. same goes chrome. opera crashes outright , needs restarted. haven't yet found browser on linux works on non-working example. clarify: working example works browsers on platforms, except safari/win (meh). update: depends on java version. java 6.20, non-working example works on browsers. java 6.24, working example works.

  • we tried using alternative server-url our non-working example (webx.sx.olefa.com), similar working example. attempt failed.

  • we tried using relative paths soundrecorder (e.g. /path/foo.ogg).

  • we tried updating java latest version.

  • we tried accessing applet differently.

  • we had similar problem 6 months ago, caused java update. tried non-working example on vm older java-version. works. however, suspect java alone not culprit here since same java-version/browser works on working example.

  • soundrecorder refuses play files loaded dynamically via js. if loads file on init, there no bug.

  • the applet loaded. can make visible giving width/height. suspect there problem in java/js intercommunication (js telling java play communication faulty?). can't confirm of yet.

generally speaking, can't find out why exact same code running under exact same conditions works on 1 site, doesn't on other.

solution

the solution part of comment. problem , solution can found here. ryan pointing in right direction.

i'm using ff4 on windows (java 1.6.0_24) , able see applet @ http://www.ecoles-dudelange.lu/cgi-bin/apps/tiparlo?projectid=1594&mode=viewer.

however, when clicked on big blue play icon @ bottom of page smilies in pane above button seem glow - 'mexican wave' style. impressive :)

i did peek java applet console , noticed following errors once button clicked:

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 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 proxy=direct network: connecting http://85.119.157.43:80/ proxy=direct  java.security.accesscontrolexception: access denied (java.net.socketpermission 85.119.157.43 resolve)     @ java.security.accesscontrolcontext.checkpermission(unknown source)     @ java.security.accesscontroller.checkpermission(unknown source)     @ java.lang.securitymanager.checkpermission(unknown source)     @ java.lang.securitymanager.checkconnect(unknown source)     @ sun.plugin2.applet.applet2securitymanager.checkconnect(unknown source)     @ sun.net.www.http.httpclient.new(unknown source)     @ sun.net.www.http.httpclient.new(unknown source)     @ sun.net.www.protocol.http.httpurlconnection.getnewhttpclient(unknown source)     @ sun.net.www.protocol.http.httpurlconnection.plainconnect(unknown source)     @ sun.net.www.protocol.http.httpurlconnection.connect(unknown source)     @ sun.net.www.protocol.http.httpurlconnection.getinputstream(unknown source)     @ java.net.url.openstream(unknown source)     @ lu.educdesign.audio.gui.jrecordapplet.load(unknown source) 

...

the url http://85.119.157.43/crossdomain.xml loads html page redirects http://confixx.s2.olefa.com prompting username/password.

maybe there's explanation this, seems me, prima facie, problem


Comments