gpt4 book ai didi

java - 创建新的 Mule 连接器后无法在 IntelliJ 中运行验收测试

转载 作者:行者123 更新时间:2023-12-02 06:45:27 24 4
gpt4 key购买 nike

创建新的 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(“文件/导入项目...”),然后成功重建项目(“构建/重建项目...”)。

如果我在 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)

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

最佳答案

确保由 DevKit 生成的 Artifact (代码、架构等)(位于 target/generated-sources/mule 中)位于项目的类路径路径上。

关于java - 创建新的 Mule 连接器后无法在 IntelliJ 中运行验收测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18688294/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com