ZipException: invalid distance too far back error

2020-02-07 02:46发布

I have a GWT application which uses Resteasy as backend api/service, the project works properly, but when I moved the project to a different machine and run it I get this error when doing a GWT run:

Caused by: java.util.zip.ZipException: invalid distance too far back
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)
    at java.util.zip.ZipInputStream.read(ZipInputStream.java:193)
    at java.util.jar.JarInputStream.read(JarInputStream.java:207)
    at org.scannotation.archiveiterator.InputStreamWrapper.read(InputStreamWrapper.java:36)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
    at java.io.DataInputStream.readInt(DataInputStream.java:387)
    at javassist.bytecode.ClassFile.read(ClassFile.java:731)
    at javassist.bytecode.ClassFile.<init>(ClassFile.java:108)
    at org.scannotation.AnnotationDB.scanClass(AnnotationDB.java:343)
    at org.scannotation.AnnotationDB.scanArchives(AnnotationDB.java:326)
    at org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap.createDeployment(ConfigurationBootstrap.java:163)
    ... 24 more

What could be the problem?

  • Is the the GWT jars or Resteasy? What does ZipException mean? Does it mean corrupted dependency?

4条回答
Ridiculous、
2楼-- · 2020-02-07 03:19

Basically my project is hosted in Bitbucket. So what I did is create a folder that will serve as the new workspace folder. Then, git clone the project there. Then issue mvn clean install and mvn gwt:run then everything works fine.

查看更多
家丑人穷心不美
3楼-- · 2020-02-07 03:32

I don't know if your problem is the same but, I've faced the same error and find out that it was related with Firefox version > 10.0. For some reason, Firefox converts any "!" character into something like "%21".

In my cenario, my application was triggering this error while rendering a image due to this fact. The same was NOT happening on Chrome.

That situation can be handled by implementing a Filter to treat the request.

If this case matchs your problem, take a look on this post: javax.faces.FacesException: Error decode resource data while loading JSF page

查看更多
beautiful°
4楼-- · 2020-02-07 03:34

Sometimes your firewall breaks the ftp connection, so try to keep an exception for java 7 on the firewall you are using. In Windows 7 it is:

netsh advfirewall set global statefulftp disable 

Do it by running command prompt as an administrator.

查看更多
Melony?
5楼-- · 2020-02-07 03:40

I am going to go out on a limb here and say you have a class compatibility error or corrupted Jars (look at the call stack, it's trying to load classes from jar files).

Verify that you have the exact same Java version on both systems and then COPY the entire project from the working host to the non-working host. You may have a corrupted Jar.

Basically ensure everything is identical and try again

查看更多
登录 后发表回答