2015-10-21 87 views
0

問題:無法在Anypoint Studio中運行Mule項目; ResourceException

當我想從運行Anypoint Studio中,我遇到問題的項目。這個項目最初是在Eclipse Juno中用Mule IDE插件設置的。

在Eclipse Juno中,我能夠在本地安裝Mule Server上運行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> 

這種流動驗證XML消息,其通過針對其相應的XSD位於xsdRepositoryBean中。

我曾嘗試:

  1. 在運行配置我選擇了我的項目在Mule domains/projects(希望它被添加到類路徑)和Mule服務器3.4.0 CE爲Target Server Runtime(同運行時和成功的Maven構建一樣)。
  2. 在運行配置嘗試將缺少的資源添加到類路徑選項卡上的用戶條目。
  3. 我發現了一個在this問題中嘗試的建議,但我不確定如何執行此操作,因爲我使用集成在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) 
+0

Mule找不到這個'/ XmlProxyValidationFilter'資源?它看起來像一個奇怪的名字:它從哪裏來的? –

+0

@David Dossot,謝謝你的回覆。 '/ XmlProxyValidationFilter'是我們在項目中使用的自定義過濾器。 –

+0

我從來沒有在Mule應用中看到過這樣的名字。你可以在你定義和引用的位置共享你的配置文件嗎?當然,沒有透露任何私人信息。 –

回答

0

@Jeroen Akershoek ......我面臨同樣的問題。所以請把你的資源放在src/main/resource目錄下,並在你的過濾器jar中使用class path loader。

相關問題