I hope someone can assist me with a problem.
I have a applet that uses a helper class to open a text file and read the contents. The helper class uses the code below to open and read. I
have used this method to avoid any security restrictions:
[CODE]
try{
URL url = new URL(getDocumentBase(),"info.txt");
BufferedReader input = new BufferedReader(new InputStreamReader(url.openStream()));
[\CODE]
The classes and text file are stored in a jar.
The following is used to open the jar:
[CODE]
<APPLET code="aa.class" archive="test.jar" width="450" height="300">
[\CODE]
I get the following at the Java Console when on line. ).
[CODE]
java.io.IOException: <null> at netscape.net.URLConnection.connect(Compiled Code)
at netscape.net.URLConnection.getInputStream(Compiled Code)
* at netscape.applet.AppletClassLoader.grabArchiveFile(Compiled Code)
at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
at netscape.applet.AppletClassLoader.<init>(Compiled Code)
at netscape.applet.AppletClassLoader.getClassLoader(Compiled Code)
at netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled Code)
at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)
# Unable to load archive http://www.geocities.com/ajetsn/aa.jar: java.io.IOException: <null>
# Applet exception: class aa could not be loaded
{\CODE]
I can only test online using getDocumentBase as I need a URL (ie I can't test with appletViewer
I wonder if anyone could give me a few pointers as to what the problem is. Everything compiles OK. Why can it be unable to load archive? I load the jars by FTP in binary format.
Thanks in advance
I have a applet that uses a helper class to open a text file and read the contents. The helper class uses the code below to open and read. I
have used this method to avoid any security restrictions:
[CODE]
try{
URL url = new URL(getDocumentBase(),"info.txt");
BufferedReader input = new BufferedReader(new InputStreamReader(url.openStream()));
[\CODE]
The classes and text file are stored in a jar.
The following is used to open the jar:
[CODE]
<APPLET code="aa.class" archive="test.jar" width="450" height="300">
[\CODE]
I get the following at the Java Console when on line. ).
[CODE]
java.io.IOException: <null> at netscape.net.URLConnection.connect(Compiled Code)
at netscape.net.URLConnection.getInputStream(Compiled Code)
* at netscape.applet.AppletClassLoader.grabArchiveFile(Compiled Code)
at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
at netscape.applet.AppletClassLoader.<init>(Compiled Code)
at netscape.applet.AppletClassLoader.getClassLoader(Compiled Code)
at netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled Code)
at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)
# Unable to load archive http://www.geocities.com/ajetsn/aa.jar: java.io.IOException: <null>
# Applet exception: class aa could not be loaded
{\CODE]
I can only test online using getDocumentBase as I need a URL (ie I can't test with appletViewer
I wonder if anyone could give me a few pointers as to what the problem is. Everything compiles OK. Why can it be unable to load archive? I load the jars by FTP in binary format.
Thanks in advance