【问题标题】:Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]配置问题:找不到 XML 模式命名空间的 Spring NamespaceHandler [http://www.springframework.org/schema/context]
【发布时间】:2019-05-07 17:01:27
【问题描述】:

配置问题:找不到 XML 模式命名空间的 Spring NamespaceHandler [http://www.springframework.org/schema/context] 违规资源:ServletContext资源[/WEB-INF/context.xml]

我该如何解决这些问题?

这是我的 context.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
  http://www.springframework.org/schema/context
  http://www.springframework.org/schema/context/spring-context-3.0.xsd">

  <context:component-scan base-package="id.sisi.forca.test.app.ForcaServerAplication" />

</beans>

【问题讨论】:

  • 您找到解决问题的方法了吗?

标签: java spring spring-boot


【解决方案1】:

这是在创建 maven 打包 jar-with-dependencies 并执行 jar 时发生的吗?

maven-assembly-plugin 中打包 jar 时遇到相同的命名空间问题

通过将 maven 插件更改为 maven-shade-plugin 解决命名空间问题。从下面的帖子中得到了答案: [Stackoverflow]unable-to-locate-spring-namespacehandler-error

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-21
    • 2013-11-01
    • 2011-11-03
    • 2014-04-19
    • 2015-12-05
    • 1970-01-01
    相关资源
    最近更新 更多