Mule jdbc连接器xml解析

发布于 2024-12-14 06:46:52 字数 4690 浏览 0 评论 0原文

我在向 Mule 项目添加 JDBC 端点时遇到问题,但由于一些 XML 解析问题,我在初始化过程中遇到了问题。 添加 JDBC 端点后问题就开始了。

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

Mule 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>

I'm having problems to add a JDBC endpoint to my Mule project but I'm having problems during the initialization due to some XML parsing problems.
The problems started after I've added the JDBC endpoints.

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.

I've been following this guide http://www.mulesoft.org/documentation/display/MULE2USER/JDBC+Transport#JDBCTransport-ConfigurationReference

The Mule JDBC namespace have been added to my xml definition.

Any idea?

Check a piece of my configuration file:

<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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

厌倦 2024-12-21 06:46:52

由于您没有显示您的配置,因此很难为您提供帮助。

从异常情况来看,我的印象是该问题与 JDBC 无关。看来您尝试在只能声明全局端点(不是入站,不是出站)的地方定义入站端点。全局端点在服务外、服务内的入/出站中声明。

如果我的诊断有误,请分享您的配置。

Since you're not showing your configuration, it's hard to help you.

From the exception, my impression is that the issue has nothing to do with JDBC. It seems you try to define an inbound-endpoint in a place where only global endpoints (not inbound, not outbound) can be declared. Global endpoints are declared out of services, in/out-bound ones inside services.

If I'm wrong in my diagnostic, please share your config.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文