[6006] in java-interest

home help back first fref pref prev next nref lref last post

URLConnection.getContent()

daemon@ATHENA.MIT.EDU (John D. Kane)
Tue Mar 12 06:56:22 1996

From: "John D. Kane" <john@insightnews.com>
To: "'java-interest@java.sun.com'" <java-interest@java.sun.com>,
        "'jug@solect.com'" <jug@solect.com>
Date: Mon, 22 Jan 96 18:12:00 PST


Whenever I use getContent() to get an object from the server, I get the 
following 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 RemoteRetrieval.get(RemoteRetrieval.java:109)
     at texteg.run(texteg.java:52)
     at java.lang.Thread.run(Thread.java:289)

The RemoteRetrieval.get() and texteg.run() are my own custom classes. The 
RemoteRetrieval class encapsulates all the steps from creating the URL to 
getting the object, just to make life easier because I will probably be 
getting a lot of things back from the server this way.

This exception message occurs only in Netscape, and not when using the 
appletviewer. Usually, Netscape will give security exceptions which the 
appletviewer won't; that I understand -- the above exception, I don't. It 
occurs after I've created the URL, verified it, made a connection to it, and 
then try to retrieve it. It seems to know it's a text file (which it is), 
but I don't understand that stuff about "sun/net/www/content/text/plain", 
"getContentHandler", etc.

I had this exception once before, but the text file was retrieved anyway, 
everytime! Now the file isn't being retrieved at all.

Are these classes a bit buggy, or am I missing the boat on some other issue?

John
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post