spring - Spring Boot 获取 java.util.zip.ZipException:设置的代码长度无效
问题描述
我正在使用 Spring boot 2.1.1.RELEASE 和 castor 1.2。它开始正常,按预期工作了几个小时,然后突然开始出现以下错误 -
o.c.c.u.Configuration : Failed to load configuration from classpath: /org/castor/core/castor.core.properties
java.util.zip.ZipException: invalid code lengths set
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)
at org.springframework.boot.loader.jar.ZipInflaterInputStream.read(ZipInflaterInputStream.java:52)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at java.util.Properties$LineReader.readLine(Properties.java:435)
at java.util.Properties.load0(Properties.java:353)
at java.util.Properties.load(Properties.java:341)
at org.castor.core.util.Configuration.loadFromClassPath(Configuration.java:187)
at org.castor.core.util.Configuration.loadDefaultProperties(Configuration.java:136)
at org.castor.core.CoreConfiguration.<init>(CoreConfiguration.java:49)
at org.castor.xml.XMLConfiguration.newInstance(XMLConfiguration.java:58)
at org.castor.xml.AbstractInternalContext.<init>(AbstractInternalContext.java:121)
at org.castor.xml.BackwardCompatibilityContext.<init>(BackwardCompatibilityContext.java:45)
at org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:206)
jar 存在于 BOOT-INF\lib\castor-1.2.jar\
我们是否需要将 /org/castor/core/castor.core.properties 放在类路径中的某个位置来解决此问题?请建议
解决方案
通常应该有一个默认的属性文件。正如手册在https://castor-data-binding.github.io/castor/reference-guide/reference/xml/xml-properties.html上所说,您可以在类路径中提供该文件。
推荐阅读
- android - AndroidJUnitRunner - 它是否以任何特定顺序运行测试用例?
- java - 带有undertow的静态资源,来自fatjar
- javascript - 分配给范围的链接函数在控制器构造函数中不可访问
- javascript - 使用 Extjs 存储的基本身份验证
- ios - 此版本不支持集合视图单元格内容视图。至少使用 Xcode 11.0 打开此文档
- python - 确保函数的输入参数是 int/str 的 Pythonic 方式?
- r - 由于 NA 值导致向量自回归错误
- java - SonarQube 服务器日志显示超出 GC 开销限制并且 TERM 被困正在关闭
- sql - 复杂查询的问题
- go - go binary-only error cannot find package fmt (using -importcfg) cannot open file : open : no such file or directory