Spring Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace, Offending resource: class path

后端 未结 2 871
Happy的楠姐
Happy的楠姐 2021-01-16 23:52

I am stuck at an issue which I am unable to resolve. I have spring batch application powered with Quartz scheduler and Gradle. Everything is working fine locally. But when I

相关标签:
2条回答
  • 2021-01-17 00:24

    I bumped on this article. Hope this make some sense for you.

    https://robert-reiz.com/2011/11/14/832/

    It says you should have transformer configuration

    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
      <resource>META-INF/spring.handlers</resource>
    </transformer>
    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
      <resource>META-INF/spring.schemas</resource>
    </transformer>
    
    0 讨论(0)
  • 2021-01-17 00:43

    As posted, your URLs are wrong. They are missing a /. The correct header should be:

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

    Your configuration above was missing the / between context and spring-context-4.3.xsd.

    0 讨论(0)
提交回复
热议问题