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

For the love of God....Guru needed?!

0 views
Skip to first unread message

Scott Parillo

unread,
Apr 2, 2002, 9:52:43 PM4/2/02
to
I'm going to cut to the chase....I cannot resolve this problem, and I'm
basically nearly ready to throw the towel in!

I've finished developing a Java product that works well when NOT running as
an Applet....However, the moment I put the code on a WebServer (in this
case, Apache 1.3), the vast majority of the time (and I might add, it
virtually never happens on my development machine...rather, everybody
elses?) the code that executes on the other end will get the following
Exception:

java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.getEntry(Unknown Source)

From that point forward, things just don't work right....Now, I have tried
to track this issue down from several fronts, and virtually every time, I'm
left scratching my head....

I will tell you that my Java JAR archive is about 2.2 MB....When this
application runs as a stand-alone app., it runs fine...it's only when
running as an Applet...Also, this JAR is digitally signed (in case you're
wondering).

In addition, I'm using JDK 1.4 for compiling, as well as executing the
code...

I found a couple of similar posts @ Google, but never saw a resolution....Is
this an issue with the Web-Server? Is this an issue with general Applet
programming? What the hell am I missing?

If anybody has any possible clue about what might be going on, please
respond....I would love to get to the bottom of this issue....

Regards,
Scott

Chris Smith

unread,
Apr 2, 2002, 10:28:15 PM4/2/02
to
Scott Parillo wrote ...

> I've finished developing a Java product that works well when NOT running as
> an Applet....However, the moment I put the code on a WebServer (in this
> case, Apache 1.3), the vast majority of the time (and I might add, it
> virtually never happens on my development machine...rather, everybody
> elses?) the code that executes on the other end will get the following
> Exception:
>
> java.lang.IllegalStateException: zip file closed
> at java.util.zip.ZipFile.getEntry(Unknown Source)

Is that it? No more stack trace? It would be helpful to know if you are
using the java.util.zip classes yourself, or if this is an exception
being reported by the implementation of the Java Plug-In. I suspect it's
the latter.

> I will tell you that my Java JAR archive is about 2.2 MB....When this
> application runs as a stand-alone app., it runs fine...it's only when
> running as an Applet...Also, this JAR is digitally signed (in case you're
> wondering).

My guess: the applet is very large, and the user ends up timing out a
connection trying to download it. The Plug-In doesn't know how to
respond, so you get the exception shown. You don't see the problem on
your development machine because you've got a fast network (maybe even
loopback, depending on your testing strategy) connection to the web
server. When there's latency and an unreliable connection involved, the
problem appears.

One very easy way to try to solve this is to segregate your code a bit,
breaking it down into smaller bits. Specify the list of all archives in
the ARCHIVE attribute of an APPLET tag. This would result in shorter
fetches of data from the JAR files. Since all JAR files are searched for
classes or resources, you ought to be okay with correctness of the code.

That, of course, is just an idea. Think of it what you will.

Chris Smith

Roedy Green

unread,
Apr 2, 2002, 11:44:35 PM4/2/02
to
On Wed, 03 Apr 2002 02:52:43 GMT, "Scott Parillo"
<scott.c...@tek.com> wrote or quoted :

>I've finished developing a Java product that works well when NOT running as
>an Applet....However, the moment I put the code on a WebServer (in this
>case, Apache 1.3), the vast majority of the time (and I might add, it
>virtually never happens on my development machine...rather, everybody
>elses?) the code that executes on the other end will get the following
>Exception:

I take it there is no zip file involved, just an ordinary signed jar.

Have you tried running as an Applet, loaded locally. (just trying to
narrow down the problem).

Can you run a miniature applet signed the same way?

Maybe it is time to look at Java Web Start. It has fewer headaches
than Applet.

Are you doing anything with the jar other than loading classes?

Server problems are sometimes improper extension x MIME tables. See
MIME in the Java glossary.

Sometimes FTP upload without the binary option in the culprit.


The java glossary is at
http://www.mindprod.com/jgloss.html
or http://209.139.205.39

--
eagerly seeking telecommuting programming work.
canadian mind products, roedy green

Typedef Enum

unread,
Apr 3, 2002, 2:03:42 AM4/3/02
to
To add a little more info to this....

1. No, there's a lot more to the stack trace...but I believe it has
everything to do with the GZIP error...Once that happens, it all goes to
hell. There will be classes that the VM cannot find, and the vast majority
of the stack trace is pretty much meaningless from that point forward.

2. As you mentioned, I believe that (for whatever reason) the process of
decompressing the JAR is getting cut short...and that's pretty much it...

3. As of right now, I have _everything_ in one JAR file...That is to say,
one big 2.2 MB archive...Perhaps I will try to break it up...This would
actually be much better, as I wouldn't have to go through the hassles of
building the code in the manner that I do....

4. Running this application as a stand-alone application...it works like a
charm every time....It ONLY happens when running as a pure Applet.

5. I'm not doing anything funky with the archive....

Any more pointers/suggestions/possibilities would be greatly appreciated...

Regards,
Scott


"Roedy Green" <ro...@mindprod.com> wrote in message
news:jp1laucgbpp3a36qp...@4ax.com...

Jon Skeet

unread,
Apr 3, 2002, 2:27:52 AM4/3/02
to
Typedef Enum <typede...@verizon.net> wrote:
> To add a little more info to this....
>
> 1. No, there's a lot more to the stack trace...but I believe it has
> everything to do with the GZIP error...Once that happens, it all goes to
> hell. There will be classes that the VM cannot find, and the vast majority
> of the stack trace is pretty much meaningless from that point forward.
>
> 2. As you mentioned, I believe that (for whatever reason) the process of
> decompressing the JAR is getting cut short...and that's pretty much it...
>
> 3. As of right now, I have _everything_ in one JAR file...That is to say,
> one big 2.2 MB archive...Perhaps I will try to break it up...This would
> actually be much better, as I wouldn't have to go through the hassles of
> building the code in the manner that I do....
>
> 4. Running this application as a stand-alone application...it works like a
> charm every time....It ONLY happens when running as a pure Applet.
>
> 5. I'm not doing anything funky with the archive....
>
> Any more pointers/suggestions/possibilities would be greatly appreciated...

Have a look in the webserver log, and see whether the client actually
managed to download the whole jar file.

--
Jon Skeet - <sk...@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Simon

unread,
Apr 3, 2002, 8:05:52 AM4/3/02
to

I suffered this illegal state stuff for a while. In my case it turned
out to be classpaths ... isn't it always?
In your case, you claim to have just one jar file so this shouldn't
happen. But it does.
I'd go through the class path again (I know you've done that - do it
again) and make sure you aren't confusing yourself.

And whn all else fails, get an intelligent being and explain the problem
to them. (I call this the "tailor's dummy approach" - they don't have to
say anything .... just wait for you to say "Oh shit" ...)

0 new messages