Solved

Problem with JSObject.getWindow using NS6

Posted on 2002-03-25
15
394 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 3
  • +2
15 Comments
 
LVL 9

Expert Comment

by:Ovi
ID: 6895943
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
ID: 6896807
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
ID: 6896978
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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

Author Comment

by:vanfleet
ID: 6897085
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
ID: 6897527
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
ID: 6898507
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
ID: 6900455
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
 
LVL 92

Expert Comment

by:objects
ID: 6900495
> 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
ID: 6900500
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
ID: 6900571
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
ID: 6900609
> 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
ID: 6900642
> 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
ID: 6900682
> 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
ID: 7892542
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
ID: 7962336
Per recommendation, points refunded and question closed.

Netminder
EE Admin
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

717 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