Mule
  1. Mule
  2. MULE-6173

Transformer weighting algorithm fails to determine transformer with higher priority

    Details

    • User impact:
      High
    • Log Output:
      Hide
      Root Exception stack trace:
      org.mule.api.registry.ResolverException: There are two transformers that are an exact match for input: "class org.apache.xerces.dom.DocumentImpl", output: "class java.lang.String". Transformers are: "FileToString(class org.mule.transport.file.transformers.FileToString)" and "_DomDocumentToString(class org.mule.module.xml.transformer.DomDocumentToXml)"
      at org.mule.registry.TypeBasedTransformerResolver.getNearestTransformerMatch(TypeBasedTransformerResolver.java:162)
      at org.mule.registry.TypeBasedTransformerResolver.resolve(TypeBasedTransformerResolver.java:88)
      at org.mule.registry.MuleRegistryHelper.resolveTransformer(MuleRegistryHelper.java:266)
          + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
      Show
      Root Exception stack trace: org.mule.api.registry.ResolverException: There are two transformers that are an exact match for input: "class org.apache.xerces.dom.DocumentImpl", output: "class java.lang.String". Transformers are: "FileToString(class org.mule.transport.file.transformers.FileToString)" and "_DomDocumentToString(class org.mule.module.xml.transformer.DomDocumentToXml)" at org.mule.registry.TypeBasedTransformerResolver.getNearestTransformerMatch(TypeBasedTransformerResolver.java:162) at org.mule.registry.TypeBasedTransformerResolver.resolve(TypeBasedTransformerResolver.java:88) at org.mule.registry.MuleRegistryHelper.resolveTransformer(MuleRegistryHelper.java:266)     + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
    • Similar Issues:
      MULE-7335Transformer resolution in TypeBasedTransformerResolver fails depending on which order transformers are found
      MULE-6833GZip transformer failing
      MULE-3178Auto-transforms doesn't always select the correct transformer when Object.class is a source type
      MULE-7411SXC filter router fails due to uninitialised transformer
      MULE-5382XSL Transformation fails with xsl:result-document on repeated transformations
      MULE-1999Outbound endpoints use the default inbound transformer
      MULE-4117Unable to override some message properties because outbound scope does not have priority over inbound scope.
      MULE-441"transformers" property is ignored for an outgoing endpoint
      MULE-5984As a developer I want to be able to lookup for transformers that resolve non direct transformations
      MULE-750AbstractTransformer doesn't check for null before trying to determine class of result
    • Sprint:
      Studio Sprint 1

      Description

      The transformer weighting algorithm does not resolve the correct transformer in some situations.
      Apparently, when a transformer's source data type implements an interface.

      Example: when the attached config there are to transformers that match the transformation from DocumentImpl to String: FileToString and DomDocumentToXml.

      These are the types matched by each transformer:

      FileToString : DocumentImpl > CoreDocumentImpl > ParentNode > ChildNode > NodeImpl > Serializable
      DomDocumentToXml : DocumentImpl > CoreDocumentImpl > Document

      DomDocumentToXml matches a type that is near in the class hierarchy, however the algorithm determines that FileToString has higher priority weight.

      1. two-transformers-config.xml
        1 kB
        Pablo Kraan
      2. TwoTransformersTestCase.java
        2 kB
        Pablo Kraan

        Activity

        Show
        Pablo Kraan added a comment - Fix 3.1.x http://fisheye.codehaus.org/changelog/mule/?cs=24677 http://fisheye.codehaus.org/changelog/mule/?cs=24679 Fix 3.2.x http://fisheye.codehaus.org/changelog/mule/?cs=24680 Fix 3.3.x http://fisheye.codehaus.org/changelog/mule/?cs=24685 Fix 3.x http://fisheye.codehaus.org/changelog/mule/?cs=24689

          People

          • Assignee:
            Pablo Kraan
            Reporter:
            Pablo Kraan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development

                Agile