Announcement

Collapse
No announcement yet.

ArrayIndexOutOfBoundsException when reading XML

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ArrayIndexOutOfBoundsException when reading XML

    Hi,

    I'm using mirth 1.7 to parse a pure XML message (not HL7). I've made a filereader channel that writes to a data treatment channel.
    There is no treatment in the filereader, the message should pass through to the actual data treatment message.
    The xml file seems correct but I get following error when reading the message:
    FAILURE: Error evaluating transformer
    SerializerException
    java.lang.ArrayIndexOutOfBoundsException: 1

    What am I doing wrong? What could be the error cause (no javascript in the filereader channel, so the error does not come from my code)?

    Thank you

    Manuel

  • #2
    Re:ArrayIndexOutOfBoundsException when reading XML

    I thought it would be better to put the whole error message:

    ERROR 2008-02-19 15:49:32,430 [91cd2c77-f8f1-4f0f-b777-c5cd287d5201_source_connector._fileEndpoint#610991 678.receiver.1] com.webreach.mirth.model.converters.ER7Serializer: java.lang.ArrayIndexOutOfBoundsException:1
    ERROR 2008-02-19 15:49:32,479 [91cd2c77-f8f1-4f0f-b777-c5cd287d5201_source_connector._fileEndpoint#610991 678.receiver.1] com.webreach.mirth.connectors.file.FileMessageRece iver: Unable to route.org.mule.umo.routing.RoutingException: Failed to transform message before applying the filter. Failed to route event via endpoint: ImmutableMuleEndpoint{connector=com.webreach.mirth [email protected], endpointUri=file:///home/manu/travail/in, transformer=Transformer{name='ByteArrayToString', returnClass=false, returnClass=false, sourceTypes=[class [B, class java.lang.String]}, name='_fileEndpoint#610991678', type='receiver', properties={}, transactionConfig=org.mule.impl.MuleTransactionCon [email protected], filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=true, initialState=started, createConnector=0}. Message payload is of type: java.lang.String
    at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:64)
    at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:79)
    at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:493)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:272)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:231)
    at com.webreach.mirth.connectors.file.FileMessageRece iver.processFile(FileMessageReceiver.java:219)
    at com.webreach.mirth.connectors.file.FileMessageRece iver.poll(FileMessageReceiver.java:138)
    at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:118)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: org.mule.umo.transformer.TransformerException: java.lang.ArrayIndexOutOfBoundsException: 1 (com.webreach.mirth.model.converters.SerializerExc eption)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateScript(JavaScriptTransform er.java:406)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:307)
    at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:61)
    ... 11 more
    Caused by: com.webreach.mirth.model.converters.SerializerExce ption: java.lang.ArrayIndexOutOfBoundsException: 1
    at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:199)
    at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:49)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateScript(JavaScriptTransform er.java:387)
    ... 18 more
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
    at com.webreach.mirth.model.converters.ER7XMLHandler. startElement(ER7XMLHandler.java:111)
    at org.apache.xerces.parsers.AbstractSAXParser.startE lement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.sc anStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown 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.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:194)
    ... 20 more

    Comment


    • #3
      Re:ArrayIndexOutOfBoundsException when reading XML

      The problem seems related to a XML-->ER7 translation. Does the XML is HL7 compliant ?

      Comment


      • #4
        Re:ArrayIndexOutOfBoundsException when reading XML

        Go into the both the source and destination transformer, and make sure that both the Incoming and Outgoing data is set to XML rather than HL7. It sounds like you have the incoming as XML, but the outgoing as HL7. This type of implicit conversion won't work if you aren't using HL7 compatible XML, as alberto stated.
        Jacob Brauer
        Director, Software Development
        NextGen Healthcare

        sigpic

        Comment


        • #5
          Re:ArrayIndexOutOfBoundsException when reading XML

          I managed to avoid the problem, putting in the source connector of my treatment channel a filereader instead of a channelreader. But this is not satisfactory; eventually I will have several message types that I want to be treated by different channels.
          I tried to set the inbound to xml and the outbound to xml, but I could only find the select box to set the inbound message type. Could you please tell me how to set the outbound message type to xml?
          I also wanted to add that the logger.info does not seem to work.


          Thank you

          Post edited by: Bleupomme, at: 02/20/2008 04:16

          Comment

          Working...
          X