【问题标题】:mule Config for app not found找不到应用程序的骡子配置
【发布时间】:2014-08-03 07:23:56
【问题描述】:

我有 mule flow,试图部署它,它说“找不到应用程序的配置”

我在 src/main/app 下创建了一个虚拟 mule-config.xml,如下所示。我的流程是:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" version="EE-3.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/jersey http://www.mulesoft.org/schema/mule/jersey/current/mule-jersey.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">
    <flow name="webservicesFlow1" doc:name="webservicesFlow1">
        <http:inbound-endpoint exchange-pattern="request-response" host="slmule2.corp.local" port="8088" path="rest" doc:name="HTTP"/>
        <jersey:resources doc:name="REST">
            <component class="com.rest.sample.RestComponent"/>
        </jersey:resources>
    </flow>
</mule>

mule-deploy.properties

redeployment.enabled=true
encoding=UTF-8
domain=default
config.resources=webservices.xml

mule-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.0/mule.xsd">

    <!-- empty config to avoid the hot deployment classloader choking on a missing config file -->

</mule>

错误信息:

    ERROR 2014-06-12 12:58:06,575 [Mule.app.deployer.monitor.1.thread.1] org.mule.module.launcher.MuleDeploymentService: 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Failed to deploy app + + 
'webservices-1.0.0-SNAPSHOT-v20140612-12+57', + + see below + 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
org.mule.module.launcher.InstallException: Config for app 'historydata-1.0.0-SNAPSHOT-
v20140612-12+57' not found: /apps/mulesoft/mule-enterprise-standalone-3.4.2/apps
/webservices-1.0.0-SNAPSHOT-v20140612-12+57/webservices.xml at 
org.mule.module.launcher.application.DefaultMuleApplication.install(DefaultMuleApplication.j
ava:107) at 
org.mule.module.launcher.application.ApplicationWrapper.install(ApplicationWrapper.java:79) 
at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:42) at 
org.mule.module.launcher.MuleDeploymentService.guardedDeploy(MuleDeploymentService.java:454)
 at 
org.mule.module.launcher.MuleDeploymentService.deployApplication(MuleDeploymentService.java:
191) at 
org.mule.module.launcher.MuleDeploymentService.deployExplodedApp(MuleDeploymentService.java:
708) at 
org.mule.module.launcher.MuleDeploymentService.deployExplodedApps(MuleDeploymentService.java
:661) at 
org.mule.module.launcher.MuleDeploymentService.access$400(MuleDeploymentService.java:57) at 
org.mule.module.launcher.MuleDeploymentService$AppDirWatcher.run(MuleDeploymentService.java:
808) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at 
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThr
eadPoolExecutor.java:178) at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPool
Executor.java:293) at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at 
java.lang.Thread.run(Thread.java:744) INFO 2014-06-12 12:58:07,859 [2132436410@qtp-
1158879031-6] org.mule.module.launcher.MuleDeploymentService: ================== Request to 
Undeploy Application: ambrosehistorydata-1.0.0-SNAPSHOT-v20140612-12+57 INFO 2014-06-12 
12:58:07,860 [2132436410@qtp-1158879031-6] 
org.mule.module.launcher.application.DefaultMuleApplication: App 'webservices-1.0.0-
SNAPSHOT-v20140612-12+57' never started, nothing to dispose of INFO 2014-0

我正在使用 mule studio 3.5.0 和 mule-ee 3.4。

【问题讨论】:

  • 导致部署失败的 namehistory.xml 文件是什么?
  • 应用程序中有另一个 xml 文件。

标签: mule esb mule-studio


【解决方案1】:

我遇到了同样的问题。 当你构建你的 zip 时,你应该压缩文件,而不是目录...... 丹

【讨论】:

  • 欢迎来到 SO。你有和OP一样的问题吗?您能否详细说明压缩目录如何导致相同的问题(相同的错误)?
  • 我们如何在部署后制作自动 .zip 文件。
  • 这个答案根本没有帮助,它必须被删除,因为它没有说明如何解决问题,它被谷歌引用为第一个答案,但它不应该被明确投票赞成在这里。
  • 如果您在目录 {MULE_HOME}/apps. Daniel 指定如果在此上下文中发生错误,解决方案是从 {MULE_HOME}/apps/{APP_NAME} 创建 Zip 文件。也就是说,包含的 zip 中的文件不包含 APP_NAME 目录。
【解决方案2】:

在您的 Mule 配置文件 (src/main/app/app-config-file.xml) 中,您可以指定要加载的属性文件。

<context:property-placeholder location="${environment.name}.properties" />

这是属性位置的描述:

属性:位置

要解析占位符的属性文件的位置, 作为 Spring 资源位置:URL、“类路径:”伪 URL,或 相对文件路径。可以指定多个位置,分开 用逗号。如果既没有指定 location 也没有指定 properties-ref, 占位符将根据系统属性进行解析。

${environment.name} 必须是系统环境变量。您需要确保部署应用程序的系统包含该变量。如果您使用的是 Maven(全新安装 -Denvironment.name=test),我认为您也可以在 Maven 构建中指定它。你可以试试。

要在本地测试,请右键单击您的项目,选择运行方式,选择运行配置,单击环境选项卡,添加变量“environment.name”和值“local”(不带引号)并确保您的本地.properties 文件存在于添加到构建路径的位置。例如,它可以是 src/main/app 或资源文件夹中。

【讨论】:

    【解决方案3】:

    我也有同样的问题。 我相信我的解决方案更简单。 我没有以某种方式导出项目,然后尝试通过浏览器上传压缩文件来部署它,而是通过 Anypoint Studio 本身进行部署。

    1. 右键单击项目
    2. Anypoint 平台
    3. 部署到云端
    4. 使用您的凭据登录(如果尚未登录)
    5. 选择适当的应用程序和运行时环境,然后点击部署。

    【讨论】:

      【解决方案4】:

      有时 javaw.exe 似乎并没有放弃正在运行的项目,并且似乎锁定了对配置文件的访问。杀死 javaw.exe 并重新运行项目再次修复它。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-07-13
        • 2023-03-27
        • 1970-01-01
        • 2019-01-30
        相关资源
        最近更新 更多