at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
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)
All I can see is that its goin wrong in reading the path. But I cant figure out where. I have my cab file in a dir named cabtest and the same directory has the applet's html file.
Caused by: java.io.FileNotFoundException: C:\cabtest\Printer\class.class (The system cannot find the path specified)
since there are no references to class.class in your HTML. Are you attempting to load class.class? The word "class" is a reserved word in Java, so one cannot name a class "class".
Originally posted by Joe Ess: I am intrigued by the nested exception:
since there are no references to class.class in your HTML. Are you attempting to load class.class? The word "class" is a reserved word in Java, so one cannot name a class "class".
I am not tryin to load a file whose name is class.class. My class files name is Printer.class. I am very sure of the issuw being not finding the path. Coz somewhere its not getting set right. But I cant figure out where.
I have a feeling that the VM thinks you've specified a class "class" in the Printer package, hence the path getting resolved to C:\cabtest\Printer\class.class
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
You might also want to leave out the " codebase="." " part. codebase should be an archive, not a directory (and the dot notation is not cross-platform anyway). But Joe's suggestion is likely closer to the mark. [ July 12, 2005: Message edited by: Ulf Dittmer ]
Originally posted by Ulf Dittmer: codebase should be an archive, not a directory (and the dot notation is not cross-platform anyway).
CODEBASE is used to indicate a directory. ARCHIVE is used to indicate an archive. Have a look at the Java Tutorial on Using the APPLET tag As for dot, in Windows and *nix a single dot means the current directory. Is there a platform where it does not?
harmeet bawa
Greenhorn
Joined: Sep 12, 2004
Posts: 22
posted
0
Originally posted by Ulf Dittmer: You might also want to leave out the " codebase="." " part. codebase should be an archive, not a directory (and the dot notation is not cross-platform anyway). But Joe's suggestion is likely closer to the mark.
[ July 12, 2005: Message edited by: Ulf Dittmer ]
I did remove the codebase frm there. I thought it might be an issue with using Suns JVM. SO I switched to Microsofts JVM. Well I dont get the class.class not found now. now it cant find the actual class file Printer. Thats what IE says.
Originally posted by harmeet bawa: I thought it might be an issue with using Suns JVM. SO I switched to Microsofts JVM.
There is that. Is there a reason you are using a CAB? Microsoft's VM is stuck at the JDK 1.1.4 API, so it's pretty primitive.
harmeet bawa
Greenhorn
Joined: Sep 12, 2004
Posts: 22
posted
0
Well I didnt know abt Microsofts JVM being stuck with jdk 1.1.4. Anyways heres the thing. I already have a jar file which my applet uses. That runs ok. But I had this thought that I can have the applet run a bit faster if I package it as a cab. So I am tryin to test that. Thats why I am tryin to use the cab format. Well heres another question. Does a cab file really reduce the applet loading time as compared to a jar file?
harmeet bawa
Greenhorn
Joined: Sep 12, 2004
Posts: 22
posted
0
Well I didnt know abt Microsofts JVM being stuck with jdk 1.1.4. Anyways heres the thing. I already have a jar file which my applet uses. That runs ok. But I had this thought that I can have the applet run a bit faster if I package it as a cab. So I am tryin to test that. Thats why I am tryin to use the cab format. Well heres another question. Does a cab file really reduce the applet loading time as compared to a jar file?
Originally posted by harmeet bawa: Does a cab file really reduce the applet loading time as compared to a jar file?
I've never heard such a thing. Are you comparing applet download speed or applet startup time? Once upon a time (~1998), JAR files that were used in the classpath could not be compressed. Maybe CAB's could be compressed and that's the reason for a discrepency in applet download speed in the past. Any "modern" VM (i.e. since Java 1.2) handles compressed JAR's, so it's certainly not an issue any more. Given that MS's VM is ancient and likely doesn't have classes your applet depends on (i.e. Swing, Collections and the like), I'd stick to JAR's and the latest Sun VM.
harmeet bawa
Greenhorn
Joined: Sep 12, 2004
Posts: 22
posted
0
Thank you Joe. I read an article sayin, if we are using IE, then we can shorten the applet download time using cab files rather than using JAR's. That was the reason I was researching in this direction. Whatever the thing might be, I am still not able to run my applet with a cab file.
Originally posted by harmeet bawa: I am still not able to run my applet with a cab file.
I tried run an applet in IE myself and I remembered that class files compiled for java 1.5 won't run in MS's ancient VM. You have to tell the compiler to create a class file that will be compatable using the -source and -target directives: