ODE
  1. ODE
  2. ODE-103

ServiceMixMapper mulfunction in ServiceMix 3.1 clustering mode (fow type = jms)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-incubating
    • Fix Version/s: 1.0-incubating
    • Component/s: JBI Integration
    • Labels:
      None
    • Environment:
      WIndowsXP Pro, ServiceMix 3.1

      Description

      1. Set "ode-jbi.messageMapper=org.apache.ode.jbi.msgmap.ServiceMixMapper" in "ode-jbi.properties" of ODE
      2. Set flowName="jms" in <sm:container> of servicemix.xml file, then startup ServiceMix 3.1 in clustering mode.
      3. send a request to BPEL service
      ODE will throw an exception when it receives a response of SP from NMR. The Normalized Message content sent to ServiceMixMapper.toODE() is a StringSource, while the default TransformerFactory set by following lines is Xalan 2.7 in my machine
      ---------------------------------------------------------------------------------------------------
      protected BaseXmlMapper()

      { _transformerFactory = TransformerFactory.newInstance(); }

      ---------------------------------------------------------------------------------------------------
      Xalan throws NAMESPACE_ERR while doing identity transformation with StringSource.

      I replaced the above lines with
      ---------------------------------------------------------------------------------------------------
      protected BaseXmlMapper()

      { _transformerFactory = new net.sf.saxon.TransformerFactoryImpl(); }

      ---------------------------------------------------------------------------------------------------
      to explicitly instantiate a Saxon TransformerFactory, then solved the problem

        Activity

        Hide
        Guillaume Nodet added a comment -

        Could you please provide the full stack trace of the exception so that we can determine the exact cause of this problem ?

        Show
        Guillaume Nodet added a comment - Could you please provide the full stack trace of the exception so that we can determine the exact cause of this problem ?
        Hide
        Xuli added a comment -

        Following are information printed on the console while error occurs:
        ------------------------------------------------------------------------------------------------------------------------------
        error:"NAMESPACE_ERR: An attempt is made to create or change an object in a way
        which is incorrect with regard to namespaces."
        ERROR - OdeConsumer - Error translating message.
        org.apache.ode.jbi.msgmap.MessageTranslationException: Transformer error!
        at org.apache.ode.jbi.msgmap.BaseXmlMapper.parse(BaseXmlMapper.java:83)
        at org.apache.ode.jbi.msgmap.ServiceMixMapper.toODE(ServiceMixMapper.jav
        a:166)
        at org.apache.ode.jbi.OdeConsumer$4.call(OdeConsumer.java:256)
        at org.apache.ode.jbi.OdeConsumer$4.call(OdeConsumer.java:217)
        at org.apache.ode.bpel.scheduler.quartz.QuartzSchedulerImpl.execTransact
        ion(QuartzSchedulerImpl.java:275)
        at org.apache.ode.jbi.OdeConsumer.outResponse(OdeConsumer.java:215)
        at org.apache.ode.jbi.OdeConsumer.onJbiMessageExchange(OdeConsumer.java:
        166)
        at org.apache.ode.jbi.JbiMessageExchangeEventRouter.onJbiMessageExchange
        (JbiMessageExchangeEventRouter.java:40)
        at org.apache.ode.jbi.Receiver$1.run(Receiver.java:190)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:41
        7)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
        utor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
        .java:675)
        at java.lang.Thread.run(Thread.java:595)
        Caused by: javax.xml.transform.TransformerException: org.w3c.dom.DOMException: N
        AMESPACE_ERR: An attempt is made to create or change an object in a way which is
        incorrect with regard to namespaces.
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
        m(TransformerImpl.java:651)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
        m(TransformerImpl.java:281)
        at org.apache.ode.jbi.msgmap.BaseXmlMapper.parse(BaseXmlMapper.java:77)
        ... 14 more
        Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create
        or change an object in a way which is incorrect with regard to namespaces.
        at org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source)
        at org.apache.xerces.dom.AttrNSImpl.<init>(Unknown Source)
        at org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS(Unknown Sour
        ce)
        at org.apache.xerces.dom.ElementImpl.setAttributeNS(Unknown Source)
        at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.startElement(SAX
        2DOM.java:134)
        at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.closeStart
        Tag(ToXMLSAXHandler.java:205)
        at com.sun.org.apache.xml.internal.serializer.ToSAXHandler.flushPending(
        ToSAXHandler.java:291)
        at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.startPrefi
        xMapping(ToXMLSAXHandler.java:349)
        at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.startPrefi
        xMapping(ToXMLSAXHandler.java:319)
        at org.apache.xerces.parsers.AbstractSAXParser.startNamespaceMapping(Unk
        nown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Sour
        ce)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unkn
        own Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
        Dispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
        known Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
        mIdentity(TransformerImpl.java:560)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
        m(TransformerImpl.java:642)
        ... 16 more
        --------------------------------------------------------------------------------------------------------------------------------------

        Show
        Xuli added a comment - Following are information printed on the console while error occurs: ------------------------------------------------------------------------------------------------------------------------------ error:"NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces." ERROR - OdeConsumer - Error translating message. org.apache.ode.jbi.msgmap.MessageTranslationException: Transformer error! at org.apache.ode.jbi.msgmap.BaseXmlMapper.parse(BaseXmlMapper.java:83) at org.apache.ode.jbi.msgmap.ServiceMixMapper.toODE(ServiceMixMapper.jav a:166) at org.apache.ode.jbi.OdeConsumer$4.call(OdeConsumer.java:256) at org.apache.ode.jbi.OdeConsumer$4.call(OdeConsumer.java:217) at org.apache.ode.bpel.scheduler.quartz.QuartzSchedulerImpl.execTransact ion(QuartzSchedulerImpl.java:275) at org.apache.ode.jbi.OdeConsumer.outResponse(OdeConsumer.java:215) at org.apache.ode.jbi.OdeConsumer.onJbiMessageExchange(OdeConsumer.java: 166) at org.apache.ode.jbi.JbiMessageExchangeEventRouter.onJbiMessageExchange (JbiMessageExchangeEventRouter.java:40) at org.apache.ode.jbi.Receiver$1.run(Receiver.java:190) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:41 7) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec utor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:675) at java.lang.Thread.run(Thread.java:595) Caused by: javax.xml.transform.TransformerException: org.w3c.dom.DOMException: N AMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor m(TransformerImpl.java:651) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor m(TransformerImpl.java:281) at org.apache.ode.jbi.msgmap.BaseXmlMapper.parse(BaseXmlMapper.java:77) ... 14 more Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. at org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source) at org.apache.xerces.dom.AttrNSImpl.<init>(Unknown Source) at org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS(Unknown Sour ce) at org.apache.xerces.dom.ElementImpl.setAttributeNS(Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.startElement(SAX 2DOM.java:134) at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.closeStart Tag(ToXMLSAXHandler.java:205) at com.sun.org.apache.xml.internal.serializer.ToSAXHandler.flushPending( ToSAXHandler.java:291) at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.startPrefi xMapping(ToXMLSAXHandler.java:349) at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.startPrefi xMapping(ToXMLSAXHandler.java:319) at org.apache.xerces.parsers.AbstractSAXParser.startNamespaceMapping(Unk nown Source) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Sour ce) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unkn own Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent Dispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor mIdentity(TransformerImpl.java:560) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor m(TransformerImpl.java:642) ... 16 more --------------------------------------------------------------------------------------------------------------------------------------
        Hide
        Guillaume Nodet added a comment -

        Do you have the associated servicemix log at debug level,
        I'd like to see the xml that fail parsing ...
        I don't really see why Xalan factory would fail, while saxon would succeed ?
        Or is this problem related to https://issues.apache.org/jira/browse/XALANJ-2361 ?

        Show
        Guillaume Nodet added a comment - Do you have the associated servicemix log at debug level, I'd like to see the xml that fail parsing ... I don't really see why Xalan factory would fail, while saxon would succeed ? Or is this problem related to https://issues.apache.org/jira/browse/XALANJ-2361 ?
        Hide
        Xuli added a comment -

        Sorry it's not a xml file, actually the content sent to Xalan is runtime NormalizedMessage
        The content of NormalizedMessage sent to ServiceMixMapper.toODE() is StaxSource while "flowName=seda" in ServiceMix, it's ok to Xalan. But when you change ServiceMIx's JBI container to "flowName=jms", then the content of NormalizedMessage sent to
        ServiceMixMapper.toODE() will be StringSource, then Xalan complains of it.

        Show
        Xuli added a comment - Sorry it's not a xml file, actually the content sent to Xalan is runtime NormalizedMessage The content of NormalizedMessage sent to ServiceMixMapper.toODE() is StaxSource while "flowName=seda" in ServiceMix, it's ok to Xalan. But when you change ServiceMIx's JBI container to "flowName=jms", then the content of NormalizedMessage sent to ServiceMixMapper.toODE() will be StringSource, then Xalan complains of it.
        Hide
        Guillaume Nodet added a comment -

        I do understand you, but if this is an xml parsing problem, this is not related
        to Ode. Could you provide the xml and make sure the problem is not related
        to the issue mentionned above ?

        Show
        Guillaume Nodet added a comment - I do understand you, but if this is an xml parsing problem, this is not related to Ode. Could you provide the xml and make sure the problem is not related to the issue mentionned above ?
        Hide
        Alex Boisvert added a comment -

        I've committed change to BaseXmlMapper (and DOMUtils) in r521409 to avoid using a transformer for the Source -> DOM conversion. Can you retry your use-case to see if it works now?

        Show
        Alex Boisvert added a comment - I've committed change to BaseXmlMapper (and DOMUtils) in r521409 to avoid using a transformer for the Source -> DOM conversion. Can you retry your use-case to see if it works now?
        Hide
        Xuli added a comment -

        I tested my use case with the latest version, the committed change is working fine, Thanks a lot!

        Show
        Xuli added a comment - I tested my use case with the latest version, the committed change is working fine, Thanks a lot!
        Hide
        Alex Boisvert added a comment -

        Marking as resolved per comment above.

        Show
        Alex Boisvert added a comment - Marking as resolved per comment above.

          People

          • Assignee:
            Alex Boisvert
            Reporter:
            Xuli
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development