2013-01-09 37 views
0

我正在使用Groovy編寫一個Spring Integration項目並編寫一個示例轉換器。下面給出的是從Spring配置文件樣本 -使用int-groovy解析異常:腳本標記

<int:transformer input-channel="channel8" output-channel="channel9"> 
    <int-groovy:script> 
     <![CDATA[ 
     if (!payload.equals('hello')) { 
      throw new RuntimeException('invalid payload') 
     } 
     payload 
     ]]> 

    </int-groovy:script>  

</int:transformer> 

我已經導入以下命名空間,也沒有在Eclipse編輯器的XML Spring配置文件顯示錯誤。

的xmlns:INT-常規= 「http://www.springframework.org/schema/integration/groovy」

然而上運行我的程序,我看到下面的錯誤 -

Caused by: org.xml.sax.SAXParseException; lineNumber: 60; columnNumber: 24; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'int-groovy:script'. 
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) 
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) 
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorRep‌​orter.java:437) 

我不知道我在這裏錯過了什麼。任何對此的幫助表示讚賞。

+0

缺少「彈簧集成,Groovy的x.x.x.RELEASE.jar」文件打印在深度堆棧跟蹤:通過引起 – user496934

+0

:org.xml.sax.SAXParseException; lineNumber:60; columnNumber:24; cvc-complex-type.2.4.c:匹配的通配符是嚴格的,但是對於元素'int-groovy:script'沒有聲明。 \t在com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) \t在com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper。 Java的:134) \t在com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437) \t在 – user496934

+0

你加INT-時髦的schemaLocation呢? –

回答