Apache Camel Spring configuration error - Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]

后端 未结 2 943
花落未央
花落未央 2021-01-17 09:20

I\'ve posted an excerpt from my spring.xml file and the stack trace I\'m getting.




        
相关标签:
2条回答
  • 2021-01-17 09:27

    If building a JAR with maven assembly plugin then try the shade plugin :)

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <configuration>
            <filters>
                <filter>
                    <artifact>*:*</artifact>
                    <excludes>
                        <exclude>META-INF/*.SF</exclude>
                        <exclude>META-INF/*.DSA</exclude>
                        <exclude>META-INF/*.RSA</exclude>
                    </excludes>
                </filter>
            </filters>
        </configuration>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>shade</goal>
                </goals>
                <configuration>
                    <transformers>
                        <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>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <mainClass>com.mypackage.mainclass</mainClass>
                        </transformer>
                    </transformers>
                </configuration>
            </execution>
        </executions>
    </plugin>
    
    0 讨论(0)
  • 2021-01-17 09:51

    I was missing camel-spring.jar. I added it and everything worked.

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