Java ZipException:运行应用程序时无效距离太远错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16594307/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-16 12:20:41  来源:igfitidea点击:

ZipException: invalid distance too far back error when running app

javagwtresteasy

提问by quarks

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:

我有一个 GWT 应用程序,它使用 Resteasy 作为后端 api/服务,该项目工作正常,但是当我将项目移动到另一台机器并运行它时,我在执行 GWT 运行时收到此错误:

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?
  • 是 GWT jars 还是 Resteasy?ZipException 是什么意思?这是否意味着损坏的依赖关系?

采纳答案by Christian Bongiorno

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).

我将在这里断言你有一个类兼容性错误或损坏的 jar(查看调用堆栈,它正在尝试从 jar 文件加载类)。

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.

验证您在两个系统上的 Java 版本是否完全相同,然后将整个项目从工作主机复制到非工作主机。您可能有一个损坏的 Jar。

Basically ensure everything is identical and try again

基本上确保一切都相同,然后再试一次

回答by quarks

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 clonethe project there. Then issue mvn clean install and mvn gwt:run then everything works fine.

基本上我的项目托管在 Bitbucket 中。所以我所做的是创建一个文件夹作为新的工作区文件夹。然后,git clone项目就在那里。然后发出 mvn clean install 和 mvn gwt:run 然后一切正常。

回答by Ashim

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

有时您的防火墙会中断 ftp 连接,因此请尝试在您使用的防火墙上保留 java 7 的例外。在Windows 7 中,它是:

netsh advfirewall set global statefulftp disable 

Do it by running command prompt as an administrator.

通过以管理员身份运行命令提示符来完成。

回答by Renato Camargos

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".

我不知道您的问题是否相同,但是,我遇到了同样的错误,并发现它与 Firefox 版本 > 10.0.0 有关。出于某种原因,Firefox 会转换任何“!” 字符转换成“%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.

在我的场景中,由于这个事实,我的应用程序在渲染图像时触发了这个错误。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

如果这种情况与您的问题相符,请查看这篇文章: javax.faces.FacesException: Error decode resource data while loading JSF page