【问题标题】:mule custom transformer works in studio, but not deployed to standalone servermule 自定义转换器在工作室中工作,但未部署到独立服务器
【发布时间】:2013-04-01 21:22:22
【问题描述】:

我有一个自定义转换器的流程。这个流程在我在 Mule Studio 下运行时有效,但在 mule 独立服务器运行时失败。错误消息是“No class for element custom-transfomer(name=Update Table)”

<flow name="updates" doc:name="updates">

    <jms:inbound-endpoint connector-ref="JMSConnector"
        doc:name="JMS" topic="updates" />
    <collection-splitter doc:name="Collection Splitter" />
    <custom-transformer class="com.domain.UpdateTable"
        doc:name="Update Table">
        <spring:property name="table" ref="table" />
    </custom-transformer>

</flow>

我也找到了similar question in the old mule forum,但是没有答案;

【问题讨论】:

  • 您的应用程序类路径中的com.domain.UpdateTable 类是否已部署到Muls Standalone?
  • 该类位于MuleStudio 导出的.ZIP 文件中,位于classes 文件夹下。它最终在 $MULE_HOME/apps/myapp/classes/com/domain/UpdateTable.class 中。我假设 Mule 将这些作为热部署的一部分 - 除非在执行导出之前需要在 MuleStudio 中完成一些项目配置?
  • 写/我之前的评论。我在同一个包中有另一个类 - 表本身 - 我将其实例化为 spring bean(不使用工厂),并将其作为属性传递给自定义转换器。我希望如果 Spring 找到该类,UpdateTable 也应该可用。
  • 很难说它为什么会失败,因为理论上,根据您提供的信息,它应该可以工作。你能显示完整的堆栈跟踪吗?
  • 我们最终确定这是一个类中的静态初始化错误——这导致了 NoClassDefFoundError 导致 mule 转换为“No class for element”——通过捕获堆栈跟踪并将其打印到控制台。我们进一步将其缩小到bug in xml-apis-1.3.04.jar。解决方案是将 jar 从 mule/lib/endorsed 移动到 mule/lib/user。

标签: mule mule-studio


【解决方案1】:

此错误是由 java.lang.NoClassDefFoundError 引起的,Mule 捕获并转换为“No Class for element”消息。这是good description of NoClassDefFoundError。在我的情况下,错误是由静态初始化程序引发的异常引起的。

【讨论】:

    猜你喜欢
    • 2012-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-21
    相关资源
    最近更新 更多