【问题标题】:Mule groovy component entry point resolution failureMule groovy 组件入口点解析失败
【发布时间】:2011-10-22 08:35:57
【问题描述】:

我有一个非常简单的 Mule (3.x) 流程:

<spring:bean name="messageHandler" class="mypackage.MessageHandler"/>

<flow name="main">
    <vm:inbound-endpoint path="in" exchange-pattern="request-response"/>
    <component>         
        <spring-object bean="messageHandler"/>
    </component>
    <vm:outbound-endpoint path="out"/>
</flow>    

messageHandler 是一个简单的 Groovy 类:

class MessageHandler {
   String handleMessage(String xml) {   
      return xml + " Received";
   } 
}

当我执行测试时,我得到:

org.mule.model.resolvers.EntryPointNotFoundException:找不到组件的入口点,以下解析器尝试但失败:[ ... ReflectionEntryPointResolver:找不到入口点:“mypackage.MessageHandler”,参数:“ {class java.lang.String}" ... ]

但是当我使用 Java 类时它可以工作!! (也适用于 groovy 类的 Callable 接口)。

我正在使用 gmaven 插件进行 groovy 编译:

 <plugin>
      <groupId>org.codehaus.gmaven</groupId>
      <artifactId>gmaven-plugin</artifactId>
      <extensions>true</extensions>
      <inherited>true</inherited>
      <executions>
         <execution>
              <goals>
                  <goal>generateStubs</goal>
                  <goal>compile</goal>
                  <goal>generateTestStubs</goal>
                  <goal>testCompile</goal>
               </goals>
          </execution>
      </executions>
   </plugin>

这可能是什么问题?

【问题讨论】:

  • 我假设 MessageHandler 在一个包中,只是当您粘贴到这个问题时缺少那行?
  • 这很奇怪,因为您的 Groovy 类具有正确的签名。值得在 org.mule.model.resolvers.ReflectionEntryPointResolver.invoke() 中放置一个断点,看看为什么没有选择 handle 方法。在我们弄清楚问题之前,您可以使用mulesoft.org/documentation/display/MULE3USER/… 专门针对handleMessage(无反射)。
  • 是的,当然它在包装中。
  • 我试过:'' 但没有帮助
  • 如果您将 Maven 项目发布到某处并指定您正在使用的确切 Mule 版本,我可以更深入地研究这个问题。

标签: groovy mule entry-point


【解决方案1】:

尝试在组件之前的流中添加 logger 元素,以查看组件中的内容。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-05
    • 2023-02-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多