Closed Bug 376065 Opened 17 years ago Closed 17 years ago

LiveConnect Java<->JavaScript totally unreliable since 2.0

Categories

(Core Graveyard :: Java: Live Connect, defect)

1.8 Branch
x86
Windows XP
defect
Not set
major

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: warp-bugzilla, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

LiveConnect went totally unreliable in the last releases. Method calls between Java Applets and Javascript will 5% of the time randomly vanish in nirvana - for both directions and for software which flawlessly worked in 1.5 and which works in at MSIE6, MSIE7, Opera 9 and Safari.


Reproducible: Sometimes

Steps to Reproduce:
1.
2.
3.
Assignee: nobody → live-connect
Component: General → Java: Live Connect
Product: Firefox → Core
QA Contact: general → pschwartau
Version: unspecified → 1.8 Branch
Sorry, I was too upset yesterday as this issue already cost us a couple of thousand Euros, not to mention the _massive_ reputation damage this gave us. Our company massively popularized Firefox in Germany and we caused thousands of users to download it, in the 1.0 days already, and now this :-(

The Java version in use is 1.5.0_11. The problem ONLY occurs on Windows.

It's possible to detect the situation from JavaScript. Write an applet with public methods which return "true". Call it from your JavaScript like this:

var flag= false;
try {
    flag= document.appletname.method();
} catch( e ) { ... }
if( !flag ) {
    window.alert("Problem occurred.");
}

No exception will be thrown usually as far as we can see, by the way. It will simply fail.

We now use setInterval() and buffers to resend the method calls to the applets and also we now only return our data from the applet methods instead of calling JavaScript directly all the time (the other direction bugs, too, as I mentioned, and seems to be even more unreliable).

Another strange phenomenon which we observed now is, that the cursor on all _other_ websites which are open in Firefox except our own is jumpy and will occasionally jump back 1 or 2 characters while typing. I don't know, whether this is directly caused by the same issue as the LiveConnect problems, or by the setInterval workarounds (other browsers don't have it either, though)

You can test all this by going to http://www.spin.de/ by the way with Java installed, then enter a dummy login name in the upper left part of the page and enter a chatroom. Whenever you enter something into the chat or receive something from the chat, LiveConnect is used. We already have code installed (the above mentioned setInterval with buffers) which tries to circumvent the
lost method calls problem, though, but if you use some kind of Firefox which has debug output for LiveConnect calls you'll surely see it.
Some users report that the "jumpy cursor" problem goes away after an upgrade to Java 1.6. We did not test yet whether the LiveConnect reliability improves, too.
The "jumpy cursor" issue is related to bug 256763.

I tried the website on
1. Windows XP with Firefox 2.0.0.x and Java 1.6.0
2. Solaris with Firefox 2.0.0.x and Java 1.5.0_11
there seems to be nothing abnormal.

Markus, could you be more specific on the error message from the debug output?
1. Where does the message output to? The Java Console? The terminal that startup Firefox? Or somewhere else?
2. What does the message looks like? If you could post a message snippet here, that will be great.

BTW, any chance that you could try Java 1.6.0 on your machine?
As I said above, we changed our site to work-around the problem by calling the applet every 100ms from JavaScript and repeating the calls if necessary. There is no message - this was merely a suggestion/question whether it's possible to include/activate some sort of debug code in Firefox which will display information about LiveConnect calls: This was maybe badly phrased: I do not know whether it's possible to see these kind of things in Firefox yet but I assumed you have some kind of developer switch where you would be able to see LiveConnect calls.

I'll try to prepare a test page specificially for that problem the next weeks as we do not want to wreck our live site and will then also re-check with Java 1.6, but there's nothing special about our site or our systems (after all, the problem has been reported by hundreds of our users): Take any ordinary Windows XP installation, Firefox 2 and Java 1.5. Try to make repeated calls from Java applets to JavaScript and the calls will fail after a random time between 5 minutes and 30 minutes. Try to make repeated calls from JavaScript to Java and about 5% of them will fail, too, after a while.
Apparently the situation is more complex than I originally thought. In an absolutely reduced test case on a simple, static HTML page, the problem won't appear. There is a trigger for the problem on our site which I don't know yet and which is at the moment hard to reduce as our sites involves multiple dynamically added/removed IFRAMEs, some of them hidden and several thousand lines of other JavaScript code. Something in there causes the LiveConnect communication to become unreliable.

As the other issue (jumpy cursor) is already in Sun's database and is fixed in 1.6, I'll close this bug as invalid until I really find out what the trigger for the problem is.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.