
springboot项目在使用压缩软件替换lib下的依赖包后,启动报错,报错内容如下:
原因:
替换或者导入jar包时,jar包被自动压缩,springboot规定嵌套的jar包不能在被压缩的情况下存储。
解决(本文以升级ojdbc包为例):
使用jar命令解压jar包,在压缩包外重新替换jar包,在进行压缩。
步骤1:解压jar包 jar -xvf *.jar
步骤2:替换jar包
步骤3:重新压缩jar
报这类错误经常的原因是没有导入对应的jar包。如果你不确定,可以找下相关的jar包中是否有对应的xsd文件。
如果上面确认有xsd文件,确定你spring xmlns引入的版本在jar包中有。否则更正版本。
3.运行时报错如下
schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/tx/spring-tx-2.5.xsd', because 1) could not find the document2) the document could not be read3) the root element of the document is not <xsd:schema>.
Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 34 in XML document from class path resource [applicationContext.xml] is invalidnested
exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:advice'.
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:advice'.
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)