首页 > 解决方案 > cvc-complex-type.3.2.2:属性“exceptionType”不允许出现在元素“throwException”中

问题描述

我试图在骆驼上抛出异常。我的版本是 2.2.170.redhat-000013。当我在 Spring DSL 中使用以下代码时

<throwException id="_throwException1" exceptionType="org.mycompany.MyException" message="Test Exception"/>

Multiple annotations found at this line:
- cvc-complex-type.4: Attribute 'ref' must appear on element 'throwException'.
- cvc-complex-type.3.2.2: Attribute 'exceptionType' is not allowed to appear in element 
 'throwException'.
- cvc-complex-type.3.2.2: Attribute 'message' is not allowed to appear in element 
 'throwException'.

我项目中的架构位置如下

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:camel="http://camel.apache.org/schema/spring" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans  http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd" >

throwException 语法应该按照文档工作,请帮助找出错误。

标签: apache-camel

解决方案


推荐阅读