• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

Problem with JSObject.getWindow using NS6

The following line in my Applet's init method is causing the applet to lock up when using Netscape 6.2.1.  

  JSObject js = JSObject.getWindow(this);

When the applet is loading it just stops at this line, there are no error messages in the Java Console, it just stops loading at that line. This problem is very inconsistent, sometimes it works OK and other times it locks up. I can't figure out what's causing the problem. This works just fine in Netscape 4.x and in IE 5.x Can someone tell me how to fix this.

Thanks,

dv
0
vanfleet
Asked:
vanfleet
  • 5
  • 5
  • 3
  • +2
1 Solution
 
OviCommented:
Is because of Netscape 6. From what I remember in netscape6 the sun and netscape alliance has renounced to the liveconnect technology. I guess your JSObject class get's loaded from local windows Java classes located in c:\Windows\Java. If you unzip the archives there you will find in one of them the JSObject class(netscape package). The solution ... hmm, you could try to make a separate archive containing JSObject and JSException classes, respecting their package of course, and load'it along with your applet, or just put them in the directory of your applet so they will be loaded from the applet "classpath". Hope this helps.
0
 
vanfleetAuthor Commented:
I found the following in the Netscape 6.2.1 release notes at:

http://home.netscape.com/eng/mozilla/ns62/relnotes/62.html

It says:

Periodic hangs may occur when loading certain Java applets. These hangs are independent of the Netscape 6.2.2 product, and occur in JRE 1.3.1_02. Sun is working to rectify the issue.

...

LiveConnect does work with Netscape 6.2 . There remain some LiveConnect problems with the combination of Netscape 6.2 . and JDK/JRE 1.3.X. Fixes for a number of remaining LiveConnect problems are being incorporated into JDK 1.4 and will be available when that release of JDK/JRE is available later this year.

My problem may be with the version of JRE that I'm using??

Stay tuned...
0
 
OviCommented:
If they say that will be incorporated into JDK1.4 then use this JRE. A new problem will arise here if you do so in the sense that the "old" browsers will not work without plug-in, since the new .class format which results after a compilation with JDK1.4 is not recognized by that browsers. In other words Netscape 4.7 or IE 5.0 will not be abble to run your applet with their default installed JRE, and you will be forced to use the plug-in for JDK1.4.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
vanfleetAuthor Commented:
This just keeps getting better!!!! This is becoming a real pain! All I want to do is get my applets running in Netscape 6!

Are you saying that if I compile my applets with JDK1.4 then it will not be compatible in the other browsers unless they have the plug in? These applets already work in the other browsers!

I did install JDK 1.4 and when I tried compiling my applets I got the following error:

compile:
    [javac] Compiling 2 source files to D:\src\v19castnav_split\build_main
    [javac] D:\src\v19castnav_split\main\Nav.java:77: cannot access netscape.javascript.JSObject
    [javac] bad class file: C:\j2sdk1.4.0\jre\lib\jaws.jar(netscape/javascript/JSObject.class)
    [javac] class file has wrong version 48.0, should be 47.0
    [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
    [javac]   JSObject win;
    [javac]   ^
    [javac] 1 error

BUILD FAILED

I put C:\j2sdk1.4.0\jre\lib\jaws.jar in my class path and have the following import line in me applet code:

  import netscape.javascript.*;

Is this correct? What am I doing wrong?
0
 
objectsCommented:
Actually the release notes mentioned above are a bit unclear whether the liveconnect problem occurs with the builtin JVM or just the plugin. ie. you may not need to run the plugin.

And regardless, you don't need to compile your applet with 1.4 for it to be able to run on the 1.4 plugin. You can simply compile it with 1.1, and inform NS6.2 users that they will need the 1.4 plugin to run it (if this is the case).
0
 
OviCommented:
The error that you have received there is from the class version of your compiled files in the jaws.jar archive.

I suggest you to follow the objects suggestion, and compile your sources under an earlier version of JDK, but force the usage of the Java Plugin version 1.4 (convert the html(s) file(s) which runs your applet with the HTMLConverter from your installed JDK1.4 - you will find'it in the bin directory of your instalation path among with javac and java). After that try again the applets by loading the converted html file in Netscape 6.
0
 
vanfleetAuthor Commented:
Thanks, for your comments.

I compiled the applets using JDK1.3.1_02, then I ran them in Netscape 6.2.1 using version 1.4 of the Java plugin. Still no luck!!! The applet still stalled at the line that calls JSObject.getWindow(this).

I didn't use the HTMLConverter to convert my <applet> tags to <object> and <embed> tags because I've tried this before and had a lot of problems with it. Also, I don't want to force my users to use the plugin if I don't have to.

I'm about ready to give up on Netscape 6. Any other suggestions?

dv



 
0
 
objectsCommented:
> I don't want to force my users to use the
> plugin if I don't have to.

If you don't want to force the user to use the plugin then you should compile your applet for Java 1.1 as this is all most browsers support (w/out the plugin).

0
 
objectsCommented:
Have you tries running the applet under NS w/out the plugin?  The problem may only be with the plugin.

We're currently having trouble with Liveconnect and NS4 and am investigating NS/plugin/liveconnect issues, and will let you know what we find.
0
 
vanfleetAuthor Commented:
This applet has been running for several years on NS 4.5 -> 4.7x and IE 5.0 -> 5.5. My problems started when I tried to get it to run in NS6.

So, your saying that if I want to force the applet to run without the plugin I should compile with Java 1.1? Does this include NS6 which is installed with Java 1.3.1? Doesn't NS6 come with the plugin?

I tired to run this applet without installing any plugin's, I didn't install the plugin's until after I started having problems.

I would appreciate it if you would let me know what you find out about these issues.

Thanks,

dv
0
 
objectsCommented:
> This applet has been running for several years on NS
> 4.5 -> 4.7x and IE 5.0 -> 5.5. My problems started
> when I tried to get it to run in NS6.

Do you just do Java -> Javascript, or do you also do Javascript -> Java?
We're currently having problems with Javascript -> Java on NS4.

> So, your saying that if I want to force the applet to
> run without the plugin I should compile with Java
> 1.1?

I don't think you can force the applet to run in a specific VM.
What I'm saying is that if you want your applet to be able to run on a browser without the plugin installed then you'll need to compile for 1.1.

> Does this include NS6 which is installed with Java 1.3.1?
> Doesn't NS6 come with the plugin?

Not sure what the state of NS6 is. I stopped using it due to the flakiness of the early versions. If you uninstall the plugin does it have it's own VM?

0
 
vanfleetAuthor Commented:
> Do you just do Java -> Javascript, or do you also do Javascript -> Java?
> We're currently having problems with Javascript -> Java on NS4.

I do both Java -> JavaScript and JavaScript -> Java. What problems are you having?

> Not sure what the state of NS6 is. I stopped using it due to the flakiness of the early > versions. If you uninstall the plugin does it have it's own VM?

Just like you, I looked at one of the early versions about a year ago, and discovered that it was missing functionality. I'm just now taking a second look. I'm surprised that it's still having problems after all this time.

dv
0
 
objectsCommented:
> What problems are you having?

I haven't seen it first hand, but one of our developers has recently reported that his JS is failing to call an applet method that works fine on IE. I have yet to confirm the problem.
0
 
Venci75Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
PAQ'd and pts refunded
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venci75
EE Cleanup Volunteer
0
 
NetminderCommented:
Per recommendation, points refunded and question closed.

Netminder
EE Admin
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 5
  • 5
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now