添加第三方jar包后无法启动

添加第三方依赖后无法启动

implementation ‘com.github.binarywang:weixin-java-mp:4.1.0’

报错信息如下:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmix_Liquibase' defined in class path resource [io/jmix/autoconfigure/data/JmixLiquibaseAutoConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: javax.xml.parsers.ParserConfigurationException: validation is not supported
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788) ~[spring-beans-5.3.3.jar:5.3.3]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:609) ~[spring-beans-5.3.3.jar:5.3.3]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531) ~[spring-beans-5.3.3.jar:5.3.3]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.3.jar:5.3.3]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.3.jar:5.3.3]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.3.jar:5.3.3]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.3.jar:5.3.3]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.3.jar:5.3.3]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.3.jar:5.3.3]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1159) ~[spring-context-5.3.3.jar:5.3.3]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) ~[spring-context-5.3.3.jar:5.3.3]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:588) ~[spring-context-5.3.3.jar:5.3.3]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) ~[spring-boot-2.4.2.jar:2.4.2]
	at com.ahies.platform.IdaasApplication.main(IdaasApplication.java:16) ~[main/:na]
Caused by: liquibase.exception.ChangeLogParseException: javax.xml.parsers.ParserConfigurationException: validation is not supported
	at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:120) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:15) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:366) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.Liquibase.lambda$update$1(Liquibase.java:229) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.Scope.lambda$child$0(Scope.java:160) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.Scope.child(Scope.java:169) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.Scope.child(Scope.java:159) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.Scope.child(Scope.java:138) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.Liquibase.runInScope(Liquibase.java:2322) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.Liquibase.update(Liquibase.java:216) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.Liquibase.update(Liquibase.java:202) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:322) ~[liquibase-core-4.3.1.jar:na]
	at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:275) ~[liquibase-core-4.3.1.jar:na]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1847) ~[spring-beans-5.3.3.jar:5.3.3]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784) ~[spring-beans-5.3.3.jar:5.3.3]
	... 19 common frames omitted
Caused by: javax.xml.parsers.ParserConfigurationException: validation is not supported
	at org.gjt.xpp.jaxp11.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:100) ~[pull-parser-2.jar:na]
	at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:49) ~[liquibase-core-4.3.1.jar:na]
	... 33 common frames omitted

先看看这个帖子,是否是一样的情况?

不一样,我一直是用 Jmix Application启动的,去掉依赖就能正常启动。

问题解决了,引入了第三方Jar包使用了非默认的XML解析器。

// 指定XML解析器解决引入第三方Jar包后使用了不同的XML解析器报错的问题.
System.setProperty(“javax.xml.parsers.SAXParserFactory”, “com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl”);

SpringApplication.run(Application.class, args);

1赞