2011-11-07 73 views
2

我有問題要將JDBC端點添加到我的Mule項目中,但由於某些XML解析問題,我在初始化過程中遇到問題。 我添加了JDBC端點後開始出現問題。Mule jdbc連接器xml解析

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'jdbc:inbound-endpoint'. One of '{ 
"http://www.mulesource.org/schema/mule/core/2.2":description, 
"http://www.springframework.org/schema/beans":beans, 
"http://www.springframework.org/schema/beans":bean, 
"http://www.springframework.org/schema/context":property-placeholder, 
"http://www.mulesource.org/schema/mule/core/2.2":global-property, 
"http://www.mulesource.org/schema/mule/core/2.2":configuration, 
"http://www.mulesource.org/schema/mule/core/2.2":notifications, 
"http://www.mulesource.org/schema/mule/core/2.2":abstract-extension, 
"http://www.mulesource.org/schema/mule/core/2.2":abstract-security-manager, 
"http://www.mulesource.org/schema/mule/core/2.2":abstract-transaction-manager, 
"http://www.mulesource.org/schema/mule/core/2.2":abstract-connector, 
"http://www.mulesource.org/schema/mule/core/2.2":abstract-global-endpoint, 
"http://www.mulesource.org/schema/mule/core/2.2":abstract-transformer, 
"http://www.mulesource.org/schema/mule/core/2.2":abstract-filter, 
"http://www.mulesource.org/schema/mule/core/2.2":abstract-model, 
"http://www.mulesource.org/schema/mule/core/2.2":abstract-interceptor-stack}' 
is expected. 

我這個指南http://www.mulesoft.org/documentation/display/MULE2USER/JDBC+Transport#JDBCTransport-ConfigurationReference

騾子JDBC命名空間已被添加到我的XML定義了以下。

有什麼想法?

檢查我的一塊配置文件:

<mule 
xmlns="http://www.mulesource.org/schema/mule/core/2.2" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.2" 
xmlns:xm="http://www.mulesource.org/schema/mule/xml/2.2" 
xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.2" 
xmlns:jdbc="http://www.mulesource.org/schema/mule/jdbc/2.2" 
xmlns:file="http://www.mulesource.org/schema/mule/file/2.2" 
xsi:schemaLocation=" 
    http://www.mulesource.org/schema/mule/jdbc/2.2 http://www.mulesource.org/schema/mule/jdbc/2.2/mule-jdbc.xsd 
    http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd 
    http://www.mulesource.org/schema/mule/jms/2.2 http://www.mulesource.org/schema/mule/jms/2.2/mule-jms.xsd 
    http://www.mulesource.org/schema/mule/vm/2.2 http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd 
    http://www.mulesource.org/schema/mule/file/2.2 http://www.mulesource.org/schema/mule/file/2.2/mule-file.xsd 
    http://www.mulesource.org/schema/mule/xml/2.2 http://www.mulesource.org/schema/mule/xml/2.2/mule-xml.xsd"> 

<!-- Endpoints --> 

<jdbc:inbound-endpoint 
    name="jdbcKapitalCommandIn" 
    connector-ref="jdbcConnector" 
    queryKey="queryKapitalProcessControl" 
    pollingFrequency="10000" synchronous="true"> 
</jdbc:inbound-endpoint> 

<jdbc:outbound-endpoint 
    name="jdbcKapitalCommandOut" 
    connector-ref="jdbcConnector" 
    queryKey="updateKapitalProcessControl" 
    synchronous="true"> 
</jdbc:outbound-endpoint> 

<file:endpoint 
    name="kapitalErrorBackup" 
    path="${APPS_HOME}/lbo-esb/files/kapital/error" 
    outputPattern="#[DATE:yyyy-MM-dd_HH-mm-ss]_error.txt"> 
</file:endpoint> 
<file:endpoint 
    name="kapitalInputBackup" 
    path="${APPS_HOME}/lbo-esb/files/kapital/backup" 
    outputPattern="#[DATE:yyyy-MM-dd_HH-mm-ss]_kapital-command.xml"> 
</file:endpoint> 
<file:endpoint 
    name="kapitalInvalidSchemaBackup" 
    path="${APPS_HOME}/lbo-esb/files/kapital/error" 
    outputPattern="#[DATE:yyyy-MM-dd_HH-mm-ss]_inv_schema.xml"> 
</file:endpoint> 

<!-- Kapital --> 
<vm:endpoint 
    name="kapitalTransactionInput" 
    path="kapital.transaction.input"> 
</vm:endpoint> 
<vm:endpoint 
    name="kapitalError" 
    path="kapital.error.input"> 
</vm:endpoint> 


<model 
    name="KapitalServices"> 

    <default-service-exception-strategy> 
     <outbound-endpoint 
      ref="kapitalError"> 
     </outbound-endpoint> 
    </default-service-exception-strategy> 
    <service 
     name="kapitalService"> 
     <inbound> 
      <inbound-endpoint 
       ref="jdbcKapitalCommandIn"> 
      </inbound-endpoint>    
     </inbound> 
     <echo-component /> 
    <!-- more stuff from here --> 
    </service> 
</model> 

<!-- more stuff from here --> 
</mule> 

回答

2

既然你不顯示您的配置,這是很難幫助你。

從例外情況來看,我的印象是這個問題與JDBC無關。看起來你試圖在只能聲明全局端點(不是入站,不是出站)的地方定義一個入站端點。全球終端被宣佈退出服務,出入境服務。

如果我在我的診斷錯誤,請分享您的配置。

+0

我已經添加了一段代碼。謝謝 – Mikhas

+0

我是對的:)你有服務之外的入站端點和出站端點,也就是隻允許端點的地方。比較你的JDBC(錯誤)和文件/ WM(右)全球端點... –

+0

這很酷。我在我的服務路由器上添加了我的端點聲明 – Mikhas