<camel:camelContext id="myCamelContext">
<camel:routeBuilder ref="route"/>
</camel:camelContext>
我尝试在 Intellij IDEA 中解析上面的 bean(“解析自定义 bean”),但出现以下错误:
Cannot find custom handler for namespace 'http://camel.apache.org/schema/spring'
尽管测试成功运行,但 IDE 还会针对我的测试代码中任何相应的 @Autowired
注释显示错误。该应用程序在运行时运行,我将 camel-spring 作为 maven 依赖项。它只在 IDE 中有问题。
最佳答案
camel-spring maven 依赖项处于“运行时”范围。虽然从技术上讲这是正确的,但这使得 Intellij 在编码时无法使用它。将 maven 范围更改为“编译”使 Intellij 能够使用 camel spring bean 处理程序来解释 bean。
关于spring - Intellij IDEA 解析自定义 bean - 找不到命名空间的自定义处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22234195/