0

问题:

当我想从 Anypoint Studio 中运行项目时,我遇到了问题。这个项目最初是在 Eclipse Juno 中使用 Mule IDE 插件设置的。

在 Eclipse Juno 中,我能够在本地安装的 Mule 服务器上运行 mule-config.xml。

现在我已经升级到最新的 Anypoint Studio(5.3.1;我有独立的和带有 Eclipse Mars 的插件)。我成功地在 Anypoint 环境中导入项目并使用 Maven 构建它。

在这两个(独立和插件)中,我都无法运行该项目。当我尝试通过“运行配置”运行时,我收到一个错误,它抱怨资源不可用。但我不明白这个错误,因为/XmlProxyValidationFilter它抱怨的资源是我的项目中的一个自定义过滤器,src/main/java它位于我的构建路径上(全部包括在内,不包括在内)。

自定义过滤器的定义:

<custom-filter name="xmlValidatieRequestFilter" class="nl.xxx.icc.mule.XmlProxyValidationFilter">
    <spring:property name="xsdRepositoryBean" ref="iccXsdRepositoryBean" />
</custom-filter>

从流中调用自定义过滤器:

<flow name="xmlproxy.validator">
    <!-- some other stuff -->
    <filter ref="xmlValidatieRequestFilter" />
</flow>

此流程根据 xsdRepositoryBean 中的相应 XSD 验证正在传递的 XML 消息。

我试过的:

  1. 在运行配置中,我选择了我的项目Mule domains/projects(期望它被添加到类路径中)和 Mule Server 3.4.0 CE 中Target Server Runtime(与成功的 Maven 构建相同的运行时)。
  2. 在运行配置中,尝试将缺少的资源添加到类路径选项卡上的用户条目中。
  3. 我在这个问题中找到了一个尝试的建议,但我不确定如何执行此操作,因为我使用 Eclipse 中集成的 Maven。因此,我尝试将我的项目转换为Maven project(我认为这是 Anypoint 插件特有的功能),但这并不能解决问题。
  4. 试图为可能的解决方案找到类似的问题,但只有上述问题很接近。

问题:

有什么想法为什么我在尝试运行流程时收到有关缺少资源的错误,而该资源位于我的项目文件夹中,并且我可以在没有 Maven 问题的情况下构建项目?

错误日志:

eclipse.buildId=4.5.1.M20150904-0015
java.version=1.8.0_31
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

org.mule.tooling.core
Error
Wed Oct 21 08:00:33 CEST 2015
Unable to package application ZIP file

java.lang.reflect.InvocationTargetException
    at org.mule.tooling.core.packageManager.ExportPackageManager.export(ExportPackageManager.java:87)
    at org.mule.tooling.runtime.launch.DefaultDeploymentStrategy.packageZipFile(DefaultDeploymentStrategy.java:55)
    at org.mule.tooling.runtime.launch.DefaultDeploymentStrategy.deployToEmbeddedInstance(DefaultDeploymentStrategy.java:26)
    at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.deployProjects(MuleRuntimeLaunchDelegate.java:486)
    at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.performLegacyDeployment(MuleRuntimeLaunchDelegate.java:344)
    at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.launch(MuleRuntimeLaunchDelegate.java:238)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/XmlProxyValidationFilter' does not exist.
    at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:334)
    at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:208)
    at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:140)
    at org.eclipse.core.internal.resources.Project.hasNature(Project.java:521)
    at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyArtifacts(MuleApplicationDeployment.java:621)
    at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyReferencedProjectsArtifactsRecursively(MuleApplicationDeployment.java:615)
    at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyReferencedProjectsArtifacts(MuleApplicationDeployment.java:608)
    at org.mule.tooling.core.packageManager.MuleApplicationExportDelegate.export(MuleApplicationExportDelegate.java:41)
    at org.mule.tooling.core.packageManager.ExportPackageManager.doExport(ExportPackageManager.java:93)
    at org.mule.tooling.core.packageManager.ExportPackageManager.export(ExportPackageManager.java:85)
    ... 10 more
Root exception:
org.eclipse.core.internal.resources.ResourceException: Resource '/XmlProxyValidationFilter' does not exist.
    at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:334)
    at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:208)
    at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:140)
    at org.eclipse.core.internal.resources.Project.hasNature(Project.java:521)
    at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyArtifacts(MuleApplicationDeployment.java:621)
    at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyReferencedProjectsArtifactsRecursively(MuleApplicationDeployment.java:615)
    at org.mule.tooling.core.deployer.MuleApplicationDeployment.copyReferencedProjectsArtifacts(MuleApplicationDeployment.java:608)
    at org.mule.tooling.core.packageManager.MuleApplicationExportDelegate.export(MuleApplicationExportDelegate.java:41)
    at org.mule.tooling.core.packageManager.ExportPackageManager.doExport(ExportPackageManager.java:93)
    at org.mule.tooling.core.packageManager.ExportPackageManager.export(ExportPackageManager.java:85)
    at org.mule.tooling.runtime.launch.DefaultDeploymentStrategy.packageZipFile(DefaultDeploymentStrategy.java:55)
    at org.mule.tooling.runtime.launch.DefaultDeploymentStrategy.deployToEmbeddedInstance(DefaultDeploymentStrategy.java:26)
    at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.deployProjects(MuleRuntimeLaunchDelegate.java:486)
    at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.performLegacyDeployment(MuleRuntimeLaunchDelegate.java:344)
    at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.launch(MuleRuntimeLaunchDelegate.java:238)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
4

1 回答 1

0

@Jeroen Akershoek ... I have faced same issue. So please put your resource in src/main/resource directory and use class path loader in your filter jar.

于 2016-04-03T11:07:42.933 回答