开发者社区> 问答> 正文

阿里云OpenAPI 这个是依赖冲突了吗?

阿里云OpenAPI 这个是依赖冲突了吗?但是我看我们sdk里也没有logback的传递依赖。集成【implementation 'com.aliyun:dyvmsapi20170525:2.1.4'】这个依赖之后,报错:
Logging system failed to initialize using configuration from 'classpath:log/logback-spring-dev.xml'
java.lang.IllegalStateException: Could not initialize Logback logging from classpath:log/logback-spring-dev.xml
完整的报错。

Logging system failed to initialize using configuration from 'classpath:log/logback-spring-dev.xml'
java.lang.IllegalStateException: Could not initialize Logback logging from classpath:log/logback-spring-dev.xml
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:168)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:66)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:57)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:332)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:298)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:246)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:223)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:301)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
at com.hope.tender.TenderApplication.main(TenderApplication.java:31)
Caused by: ch.qos.logback.core.joran.spi.JoranException: Parser configuration error occurred
at ch.qos.logback.core.joran.event.SaxEventRecorder.buildSaxParser(SaxEventRecorder.java:89)
at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:57)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:151)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.configureByResourceUrl(LogbackLoggingSystem.java:188)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:165)
... 22 more
Caused by: org.xml.sax.SAXNotRecognizedException: unrecognized feature http://xml.org/sax/features/external-general-entities
at org.gjt.xpp.sax2.Driver.setFeature(Driver.java:178)
at org.gjt.xpp.jaxp11.SAXParserImpl.setFeatures(SAXParserImpl.java:149)
at org.gjt.xpp.jaxp11.SAXParserImpl.(SAXParserImpl.java:132)
at org.gjt.xpp.jaxp11.SAXParserFactoryImpl.newSAXParserImpl(SAXParserFactoryImpl.java:114)
at org.gjt.xpp.jaxp11.SAXParserFactoryImpl.setFeature(SAXParserFactoryImpl.java:142)
at ch.qos.logback.core.joran.event.SaxEventRecorder.buildSaxParser(SaxEventRecorder.java:82)
... 28 more

展开
收起
三分钟热度的鱼 2023-10-10 14:57:41 77 0
2 条回答
写回答
取消 提交回答
  • 试一次这样引入
    com.aliyun
    dyvmsapi20170525


    org.dom4j
    dom4j


    2.1.4
    此回答整理自钉群“OpenAPI 开发者门户 - 值班服务群2群”

    2023-10-10 16:10:06
    赞同 展开评论 打赏
  • 从你的错误日志来看,这个问题是由于Logback的配置文件"logback-spring-dev.xml"无法被加载导致的。可能是这个配置文件的位置不正确,或者是Logback的库版本和你项目的其他库版本不兼容。

    首先,你可以检查一下你的项目中的配置文件的位置是否正确。通常,Logback的配置文件应该放在"classpath:/log"目录下。

    其次,你可以尝试更换Logback的库版本,看看是否可以解决问题。你可以尝试将"implementation 'com.aliyun:dyvmsapi20170525:2.1.4'"这个依赖替换为其他版本的Logback库。

    最后,你可以将Logback的日志级别设置为"DEBUG",然后重新启动你的项目,看看Logback是否有什么其他的提示信息。

    2023-10-10 16:00:39
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
阿里云云原生 Serverless 技术实践营西安站材料合集 立即下载
阿里云产品十一月刊来啦! 立即下载
最大化阿里云OpenAPI能力的方法和实践 立即下载