Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / October 2006

Tip: Looking for answers? Try searching our database.

Understanding this error list

Thread view: 
bH - 26 Oct 2006 19:07 GMT
Hi All,

I have this program in an iBook, Mac OS 9.2.2 with Java 1.0.2.
While it compiles with no error, it refuses to run based on the errors
noted below.

Help would be appreciated.

bH

import java.applet.*;
import java.awt.*;
import java.net.*;

public class URLShoTextBtn_06a extends Applet {
 TextField  textFld = new TextField(30);

 Button GetTextBtn = new Button("Get Text");
 Panel upperPanel = new Panel();

 public void init() {
   setLayout(new BorderLayout(5,5));
   upperPanel.setBackground(Color.blue);
   add("North", upperPanel);
   upperPanel.add(textFld );
   upperPanel.add(GetTextBtn);

 }
 // event method applies to java version  1.0.2 iBook and a one button
only
   public boolean action(Event evt, Object arg) {
     if (evt.target instanceof Button){
       try {
       getAppletContext().showDocument(new URL(textFld.getText()));
     }
     catch (Exception e) {;}
     }
     return(true);
   }
 }

10/26/2006 @ 11:15:5
An exception occurred:
java.lang.ClassNotFoundException:

URLShoTextBtn_06a.class
at
com.apple.mrj.JManager.JMAppletClassLoader_IMPL.loadClass(JMAppletClassLoaderOld.java)

at
com.apple.mrj.JManager.JMAppletClassLoader_IMPL.loadClass(JMAppletClassLoaderOld.java)
at
com.apple.mrj.JManager.JMAppletClassLoader_ROOT.loadClass(JMAppletClassLoaderOld.java)
at
com.apple.mrj.JManager.JMAppletViewer_OLD.doLoadCode(JMAppletViewerOld.java)
at
com.apple.mrj.JManager.JMAppletViewer_OLD.setState(JMAppletViewerOld.java)
at
com.apple.mrj.JManager.JMViewerEvent.post(JMAppletViewerOld.java)
at
com.apple.mrj.JManager.AVDispatcherThread.run(JMAppletViewerOld.java)
Hasan  Tariq - 26 Oct 2006 19:49 GMT
Whats is the command you are giving to run this program (java -claspath
.....)

Hasan Tariq
http://www.iqvis.com

> Hi All,
>
[quoted text clipped - 57 lines]
> at
> com.apple.mrj.JManager.AVDispatcherThread.run(JMAppletViewerOld.java)
Andrew Thompson - 26 Oct 2006 20:24 GMT
...
> I have this program in an iBook, Mac OS 9.2.2 with Java 1.0.2.

What Hasan said, but also..

Why are you using such an *old* Java?
I note that even the applet viewer mentioned in the
stacktrace says 'JMAppletViewerOld' - do you have
a 'JMAppletViewerNew' on that system?

..And 1.0.2 - wow!  I have never manged to find either
documentation on, or an rt.jar for, a '1.0' java ..how
big is the 'rt.jar' (or Mac equivalent)?

Oh, before I forget, the reason I noticed the Java
version was because of that very deprecated code
you posted.  That is not a good book to be copying
from, as you will need to 'unlearn' a lot of what you
seem to be picking up.

&....

>         try {
>         getAppletContext().showDocument(new URL(textFld.getText()));
>       }
>       catch (Exception e) {;}

Never 'swallow' exceptions*.

      catch (Exception e) {
         e.printStackTrace();
      }

* unless you can justify in a comment, why this
exception absolutely does not matter.

Andrew T.
Steve W. Jackson - 26 Oct 2006 22:36 GMT
> ...
> > I have this program in an iBook, Mac OS 9.2.2 with Java 1.0.2.
[quoted text clipped - 33 lines]
>
> Andrew T.

What Hasan said and you seconded isn't really valid for Mac OS 9.2.2
since it's an OS that has no kind of command line interface at all.

Also, any Mac running Mac OS 9.2.2 is most probably *not* running Java
1.0.2.  The Macintosh Runtime for Java that was included with the last
versions of the Mac OS prior to the advent of OS X should be at least
1.1.x.  The highest available version supported is 1.1.8.  With some
trickery, it was possible to get Swing 1.1.1 via a swingall.jar file,
but it was decidedly *not* pretty.

Just to be sure, the OP should get MRJ 2.2.5, which is available at
<http://docs.info.apple.com/article.html?artnum=75097>.  (MRJ 2.2.6 is
at <http://docs.info.apple.com/article.html?artnum=120209>, but it's not
needed unless it's to support HTTPS and Oracle 11i.)  That page on 2.2.5
gives information on installation and other matters.

Better still would be to leave Mac OS 9.2.2 in the dust, since it's now
officially dead, and move on to OS X and modern Java.

= Steve =
Signature

Steve W. Jackson
Montgomery, Alabama

bH - 27 Oct 2006 04:15 GMT
> > ...
> > > I have this program in an iBook, Mac OS 9.2.2 with Java 1.0.2.
[quoted text clipped - 57 lines]
> Steve W. Jackson
> Montgomery, Alabama

Hi All,
I will make this iBook a door stop. I will further recommend that my
local library burn java books older than 3 years for heating the
building during the winter months ahead. And I will further recommend
that if a CD is included with the outdated Java book, that it should
be run over by the bookmobile.

Thanks to all of you.

bH

P.S. I have a Win2K with NT that I use to do my Java programming. I use
jdk1.5.0_05 and
was taking time to investigate a bit of "retro" with theJava and the
iBook.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.