0

创建新的 Mule 连接器后,我无法在 IntelliJ 12.1.4 中运行默认的 mule 连接器测试

首先,我使用以下方法创建一个新的 mule 连接器:

mvn archetype:generate
-DarchetypeGroupId=org.mule.tools.devkit
-DarchetypeArtifactId=mule-devkit-archetype-generic
-DarchetypeVersion=3.4.0
-DarchetypeRepository=http://repository.mulesoft.org/releases/
-DgroupId=org.testPackage
-DartifactId=myArtifactId
-Dversion=1.0.0-SNAPSHOT
-DmuleVersion=3.4.0
-DmuleModuleName=myModuleName
-Dpackage=org.testPackage
-DarchetypeRepository=http://repository.mulesoft.org/releases

然后我运行“mvn clean install”,成功:

= Testing: testFlow
...
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.098 sec - in org.testPackage.myModuleNameModuleTest

我将项目导入 IntelliJ(“File/Import Project...”),然后成功重建项目(“Build/Rebuild Project...”)。

如果我在 IntelliJ 中运行 testFlow()(“右键单击 myModuleNameModuleTest,然后选择“运行 testFlow”),我会收到以下错误:

= Testing: testFlow
[09-08 14:09:03] WARN  XmlBeanDefinitionReader [main]: Ignored XML validation warning
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.mulesoft.org/schema/mule/mymodulename/1.0.0-SNAPSHOT/mule-mymodulename.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>.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:96)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:380)

org.mule.api.config.ConfigurationException: Line 13 in XML document from URL [file:/Users/sporcina/git_repos/test/myArtifactId/target/test-classes/mule-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'mymodulename:config'. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/core":description, "http://www.springframework.org/schema/beans":beans, "http://www.springframework.org/schema/beans":bean, "http://www.springframework.org/schema/context":property-placeholder, "http://www.springframework.org/schema/beans":ref, "http://www.mulesoft.org/schema/mule/core":global-property, "http://www.mulesoft.org/schema/mule/core":configuration, "http://www.mulesoft.org/schema/mule/core":notifications, "http://www.mulesoft.org/schema/mule/core":abstract-extension, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-extension, "http://www.mulesoft.org/schema/mule/core":abstract-agent, "http://www.mulesoft.org/schema/mule/core":abstract-security-manager, "http://www.mulesoft.org/schema/mule/core":abstract-transaction-manager, "http://www.mulesoft.org/schema/mule/core":abstract-connector, "http://www.mulesoft.org/schema/mule/core":abstract-global-endpoint, "http://www.mulesoft.org/schema/mule/core":abstract-exception-strategy, "http://www.mulesoft.org/schema/mule/core":abstract-flow-construct, "http://www.mulesoft.org/schema/mule/core":flow, "http://www.mulesoft.org/schema/mule/core":sub-flow, "http://www.mulesoft.org/schema/mule/core":abstract-model, "http://www.mulesoft.org/schema/mule/core":abstract-interceptor-stack, "http://www.mulesoft.org/schema/mule/core":abstract-filter, "http://www.mulesoft.org/schema/mule/core":abstract-transformer, "http://www.mulesoft.org/schema/mule/core":processor-chain, "http://www.mulesoft.org/schema/mule/core":custom-processor, "http://www.mulesoft.org/schema/mule/core":invoke, "http://www.mulesoft.org/schema/mule/core":abstract-global-intercepting-message-processor, "http://www.mulesoft.org/schema/mule/core":custom-queue-store, "http://www.mulesoft.org/schema/mule/core":abstract-processing-strategy}' is expected. (org.mule.api.lifecycle.InitialisationException)

知道是什么原因造成的以及如何解决吗?

4

1 回答 1

2

确保 DevKit 生成的工件(代码、模式等)位于target/generated-sources/mule项目的类路径路径中。

于 2013-09-09T04:34:54.923 回答