我正在使用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放在类路径中的某个位置以解决此问题?请建议
答案 0 :(得分:0)
通常应该有一个默认属性文件。正如手册在https://castor-data-binding.github.io/castor/reference-guide/reference/xml/xml-properties.html上所述,您可以在类路径中提供该文件。