Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 创建新Mule连接器后,无法在IntelliJ中运行验收测试_Java_Maven_Intellij Idea_Mule - Fatal编程技术网

Java 创建新Mule连接器后,无法在IntelliJ中运行验收测试

Java 创建新Mule连接器后,无法在IntelliJ中运行验收测试,java,maven,intellij-idea,mule,Java,Maven,Intellij Idea,Mule,创建新的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://reposi

创建新的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()(“右键单击MyModuleNameMemoduleTest,然后选择“运行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)
=测试:testFlow
[09-08 14:09:03]警告XmlBeanDefinitionReader[main]:忽略了XML验证警告
org.xml.sax.SAXParseException:schema_reference.4:无法读取架构文档'http://www.mulesoft.org/schema/mule/mymodulename/1.0.0-SNAPSHOT/mule-mymodulename.xsd,因为1)找不到文档;2)无法读取文档;3)文档的根元素不存在。
位于com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
位于com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:96)
请访问com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:380)
org.mule.api.config.ConfigurationException:URL[文件:/Users/sporcina/git_repos/test/myArtifactId/target/test classes/mule config.XML]的XML文档中的第13行无效;嵌套异常为org.XML.sax.SAXParseException:cvc复杂类型。2.4.a:发现以元素“mymodulename:config”开头的无效内容。{http://www.mulesoft.org/schema/mule/core:注释http://www.mulesoft.org/schema/mule/core:说明http://www.springframework.org/schema/beans“:豆子,”http://www.springframework.org/schema/beans“:bean,”http://www.springframework.org/schema/context:属性占位符http://www.springframework.org/schema/beans“:ref,”http://www.mulesoft.org/schema/mule/core:全局属性http://www.mulesoft.org/schema/mule/core“:配置,”http://www.mulesoft.org/schema/mule/core:通知http://www.mulesoft.org/schema/mule/core:抽象扩展名http://www.mulesoft.org/schema/mule/core:抽象混合内容扩展http://www.mulesoft.org/schema/mule/core:抽象代理http://www.mulesoft.org/schema/mule/core:抽象安全管理器http://www.mulesoft.org/schema/mule/core:抽象事务管理器http://www.mulesoft.org/schema/mule/core:抽象连接器http://www.mulesoft.org/schema/mule/core:抽象全局终结点http://www.mulesoft.org/schema/mule/core:抽象异常策略http://www.mulesoft.org/schema/mule/core:抽象流构造http://www.mulesoft.org/schema/mule/core“:流,”http://www.mulesoft.org/schema/mule/core“:子流,”http://www.mulesoft.org/schema/mule/core“:抽象模型,”http://www.mulesoft.org/schema/mule/core:抽象拦截器堆栈http://www.mulesoft.org/schema/mule/core:抽象筛选器http://www.mulesoft.org/schema/mule/core“:抽象变压器,”http://www.mulesoft.org/schema/mule/core:处理器链http://www.mulesoft.org/schema/mule/core:自定义处理器http://www.mulesoft.org/schema/mule/core“:调用,"http://www.mulesoft.org/schema/mule/core:抽象全局侦听消息处理器http://www.mulesoft.org/schema/mule/core:自定义队列存储http://www.mulesoft.org/schema/mule/core“:应为抽象处理策略}”。(org.mule.api.lifecycle.InitialisationException)

知道是什么原因导致了这种情况以及如何修复它吗?

确保DevKit生成的工件(代码、模式等)位于项目的类路径路径上。

是的。模块设置显示路径“target/generated sources/mule”被定义为源文件夹。