PDA

View Full Version : Java Applets in Netscape 7


helibeli
01-29-2003, 04:52 AM
I have an HTML page containing a Java Applet which works perfectly well on Windows (IE5+ and NS6+) and IE5 on MAC OSX. However I need it to work with Netscape and are having problems. My applet code is as follows:

<APPLET CODEBASE="./" CODE="searchApplet.class" name="searchapp" id="searchapp" width="120" height="22" align="middle" MayScript>
<PARAM NAME="indexurl" VALUE="searchindex.txt">
<PARAM NAME="callback" VALUE="FromApplet">
<PARAM NAME="searchforphrase" VALUE="false">
<PARAM NAME="maxreturned" VALUE="100">
<PARAM NAME="rowhtml" VALUE="<tr><td bgcolor='#DFDFE9'><IMG SRC='../../media/spacer.gif' CLASS='gridImg' ALIGN='MIDDLE'><a href=javascript:openPage('ONS.URL'); CLASS='searchresults'>ONS.DESCRIPTION</a></td></tr>">
<PARAM NAME="textboxfont" VALUE="Arial-normal-12">
<PARAM NAME="textboxbackground" VALUE="#e0e0e0">
<PARAM NAME="textboxforeground" VALUE="#000000">
</APPLET>

Checking the Java Console gives the following message:

java.lang.NullPointerException\
at com.apple.mrj.internal.awt.basepeers.SimpleContainerPeer.initiateDispose(SimpleContainerPeer.java:194)\
at com.apple.mrj.internal.awt.basepeers.VComponentPeer.initiateDispose(VComponentPeer.java:107)\
at com.apple.mrj.internal.awt.basepeers.SimpleContainerPeer.initiateDispose(SimpleContainerPeer.java:191)\
at com.apple.mrj.internal.awt.basepeers.VComponentPeer.initiateDispose(VComponentPeer.java:107)\
at com.apple.mrj.internal.awt.basepeers.SimpleContainerPeer.initiateDispose(SimpleContainerPeer.java:191)\
at com.apple.mrj.internal.awt.basepeers.VComponentPeer.initiateDispose(VComponentPeer.java:107)\
at com.apple.mrj.internal.awt.frames.SimpleFramePeer.initiateDispose(SimpleFramePeer.java:478)\
at com.apple.mrj.internal.awt.frames.SimpleFramePeer.dispose(SimpleFramePeer.java:465)\
at com.apple.mrj.internal.awt.framehosts.CarbonControlFrameHost$JavaControl.controlCleanUp(CarbonControlFrameHost.java:699) \
at com.apple.buckyball.app.CustomControl$CustomControlProc.ControlDef(CustomControl.java:411)\
Exception during disposal:\
java.lang.reflect.InvocationTargetException: java.lang.NullPointerException\
at com.apple.mrj.internal.awt.basepeers.EventHandlingComponentPeer.setVisible(EventHandlingComponentPeer.java:130)\
at com.apple.mrj.internal.awt.publicpeers.OrphanagePeer.setVisible(OrphanagePeer.java:81)\
at com.apple.mrj.internal.awt.publicpeers.OrphanagePeer.hide(OrphanagePeer.java:272)\
at java.awt.Component.removeNotify(Component.java:4091)\
at java.awt.TextComponent.removeNotify(TextComponent.java:168)\
at java.awt.Container.removeNotify(Container.java:1593)\
at java.awt.Container.removeNotify(Container.java:1593)\
at java.awt.Container.removeNotify(Container.java:1593)\
at java.awt.Frame.removeNotify(Frame.java:576)\
at java.awt.Window$1$DisposeAction.run(Window.java:474)\
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:142)\
at java.awt.EventQueue.dispatchEvent(EventQueue.java:332)\
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:126)\
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:93)\
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)\
at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)\


I have been thrown in at the deep end having never used Macs or Netscape and haven't used Java in about 2 years.
As far as I can tell the following Java related Plug-ins are installed:
OJI Plugin for Mac OSX;v1.0 (MRJPluginCarbon)
Java Plug-in(Java 1.3.1 Plug-in)
Java Plug-in Enabler(Java 1.3.1 Plugin (CFM))

The class has been compile to JDK1.4

ANY IDEAS ??????

bjb
02-28-2003, 04:20 AM
Is the win test running under the old jview or the plugin ?

If the former, please test it with a real Java2 OS.
Old Jview (the MS flaky Java implementation), is known to accept non-valid Java or Java2 code... this led to the famous : hey it works under windows but not under XXX !

This will help you to track if this is either a trouble from your applet using stuff it should not, or if this is a bad behaviour from the MRJ !

If Win w/ Javaplugin fail, then your applet is bugged ... if it succed, then MRJ is bugged ;)

This problem seem to happen during a container.remove(component) (cf. the removeNotify dispatch for heavywieght peers). ...

I wish Win could have Java2 setup everywhere, as OSX did !
We would have no AWT headaches anymore ;-) Tnx to Swings ...