gpt4 book ai didi

Mule 3 - 从 .properties 文件加载

转载 作者:行者123 更新时间:2023-12-02 06:14:01 25 4
gpt4 key购买 nike

我正在使用 Mule 3 通过 JDBC 查询数据库,并且我想根据 .properties 文件的输入修改查询。我的 xml 中有这个...

<context:property-placeholder location="C:\path\to\file\settings.properties" />

出现以下异常...

Exception in thread "main" org.mule.module.launcher.DeploymentInitException: SAXParseException: The prefix "context" for element "context:property-placeholder" is not bound.

我需要包含一些特殊的 .xsd 文件吗?

最佳答案

将 xmlns 命名空间前缀和架构位置添加到您的 Mule 配置 mule 元素标记中。

前缀:

xmlns:context="http://www.springframework.org/schema/context"

架构位置:

http://www.springframework.org/schema/context  http://www.springframework.org/schema/context/spring-context-3.0.xsd

它应该如下所示。

例如:

<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:context="http://www.springframework.org/schema/context"

xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.3/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.3/mule-http.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
">


<context:property-placeholder location="C:/path/to/file/settings.properties" />


........... Other stuff



</mule>

关于Mule 3 - 从 .properties 文件加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17304203/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com