【发布时间】:2015-07-02 14:18:33
【问题描述】:
我有一个 Mule 项目,它通过 Mule Apikit 使用 REST API。 当我从 Eclipse 将项目作为“Mule 应用程序”运行时,没有任何问题。
当我将项目作为“带有 Maven 的 Mule 应用程序”运行时,应用程序会构建,但在 mule 服务器启动时,我看到与解析 apikit 架构和稍后在我的流程中的命名空间有关的错误。 (当我将应用程序加载到独立的 Mule 服务器时,我看到了同样的情况。
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.mulesoft.org/schema/mule/apikit/current/mule-apikit.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
我的 .pom 文件中有两个与 apikit 相关的条目。
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-apikit</artifactId>
<version>1.6.1</version>
</dependency>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-app-maven-plugin</artifactId>
<version>${mule.tools.version}</version>
<extensions>true</extensions>
<configuration>
<copyToAppsDirectory>true</copyToAppsDirectory>
<inclusions>
<inclusion>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-apikit</artifactId>
</inclusion>
</inclusions>
</configuration>
</plugin>
【问题讨论】:
-
mule-module-apikit-1.6.1.jar是否正确打包在应用程序 zip 中,/lib下? -
不,我已经尝试明确设置依赖关系的范围(编译和运行时都不包括它)。我还可以确认它在我的本地 .m2 目录中,因此查找 jar 没有问题。