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

Connecting to socket

0 views
Skip to first unread message

Miha V

unread,
Jan 17, 2003, 5:20:05 AM1/17/03
to
Hi all,

I am an infrequent Java coder, so this is more of a newbie category
question. (And I did spend hours searching the Internet for an answer
that would at least point me in the right direction)

I have a simple applet. All it does (should do) is connect to a
specific (non-standard - 20xyz) port on a machine at was downloaded
from and read the string from it using java.net.Socket and
InputStream.

It works in every browser except Notescape 7.
If the page is retrieved over SSL, I get the following error:

Exception: java.lang.ClassNotFoundException: ReadText.class
...and a lot of stack trace in the console.

If I retrieve the page unencrypted, it works like a charm.

I think it is a security problem, but could not find any information
about it, that would make much sense. I did find the
java.net.SocketPermission class, and I think it may be a solution to
my problem, but no explanation that would make any sense to me or
examples of its use.

What I'm looking for are not theoretical articles about why sandbox
was invented, why security is "a good thing", and so on, I'd like a
recipe, on how to open a damn connection. :-)

TIA,

Oh, yes, here is the stack trace in case anyone needs it:

load: class StartLab.class not found.
java.lang.ClassNotFoundException: StartLab.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLException: error while writing to socket
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
at java.io.OutputStream.write(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA6275)
at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA6275)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.setNewClient(DashoA6275)
at sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.superConnect(Unknown
Source)
at sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.access$100(Unknown
Source)
at sun.net.www.protocol.https.PluginDelegateHttpsURLConnection$2.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.connect(Unknown
Source)
at sun.net.www.protocol.https.PluginDelegateHttpsURLConnection.getInputStream(Unknown
Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(DashoA6275)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 11 more

Michael Amling

unread,
Jan 17, 2003, 8:56:22 AM1/17/03
to
Miha V wrote:
> I have a simple applet. All it does (should do) is connect to a
> specific (non-standard - 20xyz) port on a machine at was downloaded
> from and read the string from it using java.net.Socket and
> InputStream.
>
> It works in every browser except Notescape 7.

Is that the same as Netscape 7?

> If the page is retrieved over SSL, I get the following error:

Is the problem that your applet doesn't run, in which case how you
write it and what it would do if it ever ran are irrelevant? If so, it
can't be a bug in your code. Is the <applet codebase= an absolute URL or
a relative URL?

--Mike Amling

Miha V

unread,
Jan 20, 2003, 7:39:29 AM1/20/03
to
Michael Amling <nos...@nospam.com> wrote in message news:<3E280B86...@nospam.com>...

> Miha V wrote:
> > It works in every browser except Notescape 7.
> Is that the same as Netscape 7?

Yes :-)

> > If the page is retrieved over SSL, I get the following error:
>
> Is the problem that your applet doesn't run, in which case how you
> write it and what it would do if it ever ran are irrelevant? If so, it
> can't be a bug in your code. Is the <applet codebase= an absolute URL or
> a relative URL?

It is a relative URL.

I think I solved it. When loading a Java applet, Netscape 7 isn't too
happy talking to a server with ahome grown SSL certificate; even
though it has been accepted and the browser is able to retreive pages
without a problem....

Tnx, for your help.

Mike5

0 new messages