Solved

Problem with JSObject.getWindow using NS6

Posted on 2002-03-25
15
358 Views
Last Modified: 2011-09-20
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
Comment
Question by:vanfleet
  • 5
  • 5
  • 3
  • +2
15 Comments
 
LVL 9

Expert Comment

by:Ovi
Comment Utility
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
 

Author Comment

by:vanfleet
Comment Utility
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
 
LVL 9

Expert Comment

by:Ovi
Comment Utility
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
 

Author Comment

by:vanfleet
Comment Utility
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
 
LVL 92

Expert Comment

by:objects
Comment Utility
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
 
LVL 9

Expert Comment

by:Ovi
Comment Utility
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
 

Author Comment

by:vanfleet
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 92

Expert Comment

by:objects
Comment Utility
> 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
 
LVL 92

Expert Comment

by:objects
Comment Utility
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
 

Author Comment

by:vanfleet
Comment Utility
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
 
LVL 92

Expert Comment

by:objects
Comment Utility
> 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
 

Author Comment

by:vanfleet
Comment Utility
> 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
 
LVL 92

Expert Comment

by:objects
Comment Utility
> 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
 
LVL 9

Expert Comment

by:Venci75
Comment Utility
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
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
Comment Utility
Per recommendation, points refunded and question closed.

Netminder
EE Admin
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to implement Singleton Design Pattern in Java.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now