Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Java in Netscape problem

0 views
Skip to first unread message

Tristan Tarrant

unread,
Apr 16, 1997, 3:00:00 AM4/16/97
to

Hi everyone, I am quite new to Java coding, so please tell me about
blatantly silly mistakes in the following.

I am using Netscape 3.01 and JDK 1.0.2.

The following code, when loaded within an applet in Netscape, causes the
message:
java.lang.ClassNotFoundException: sun/net/www/content/text/plain
at java.net.URLConnection.getContentHandler(URLConnection.java:393)
at java.net.URLConnection.getContent(URLConnection.java:186)
at java.net.URL.getContent(URL.java:342)
at Categories.<init>(Categories.java:32)
at Profile.init(Profile.java:21)
at netscape.applet.EmbeddedAppletFrame.run(EmbeddedAppletFrame.java:323)
at java.lang.Thread.run(Thread.java:296)
# Applet exception: exception: java.lang.ClassCastException: netscape.net.URLInputStream
java.lang.ClassCastException: netscape.net.URLInputStream
at Categories.<init>(Categories.java:32)
at Profile.init(Profile.java:21)
at netscape.applet.EmbeddedAppletFrame.run(EmbeddedAppletFrame.java:323)
at java.lang.Thread.run(Thread.java:296)

When run under appletviewer, everything is fine...
The code is:

try {
String catstr = applet.getCodeBase().toString()+"Categories.txt";
System.out.println(catstr);
URL caturl = new URL(catstr);
System.out.println("Maybe...");
String cattxt = (String) caturl.getContent();
}
catch (MalformedURLException mue) {}
catch (IOException ioe) {}

What is wrong ? Also, is there a way to tell Netscape to reload all of
my classes, instead of using its cached ones ?

Thanks

Tristan
--
Tristan Tarrant ttar...@etnoteam.it
Lo sai che la tua faccia somiglia a quella di uno che vale 2000 dollari ?
Gia'. Ma tu non somigli a quello che li incassa. Due passi indietro...
Il buono, il brutto e il cattivo

0 new messages