Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Empty query results causing StringIndexOutOfBoundsException (http://www.mirthcorp.com/community/forums/showthread.php?t=7904)

psanders 11-02-2012 07:11 AM

Empty query results causing StringIndexOutOfBoundsException
I getting the error below in the transform step of my channel:

"StringIndexOutOfBoundsException: String index out of range"

is this due to the fact that some elements in the xml string returned from a query are empty?

The source on my channel is a database reader connecting to Oracle. I'm writing an HL7 file to the local drive. I have transform steps on all the xml elements to an HL7 field. But I suspect the error is due to having empty elements. I won't always have data returned in every field.

My question is how to handle that scenario? I still get the file created in my "error" directory, it just doesn't create it in the "out" directory.


narupley 11-02-2012 08:30 AM

This could be due to one of many different things; post your channel so that the people here can help troubleshoot.

psanders 11-02-2012 09:21 AM

1 Attachment(s)
Here is the channel, thx for the review

narupley 11-02-2012 09:46 AM


Originally Posted by psanders (Post 28873)
Here is the channel, thx for the review

Works fine for me; can you post a sample inbound message?

psanders 11-02-2012 01:23 PM

Here is an example of an incomplete result message taken from the raw message tab in the channel messages:

<prov_division>PEDIATRIC NEUROLOGY</prov_division>
<prov_address>1151 E 3900 S</prov_address>
<prov_city>SALT LAKE CITY</prov_city>

Here is a complete message example:

<prov_address>324 10TH AVE STE 224</prov_address>
<prov_city>SALT LAKE CITY</prov_city>

Notice that the xml tags are different on the two fields missing data. That's what I'm guessing the problem to be.

narupley 11-02-2012 02:36 PM

Hm, again that works perfectly fine for me. I wouldn't expect an error to occur because of blank fields. For example, this mapping:


If the "prov_md_email" node in the inbound message is blank, the above mapping will just evaluate to an empty string, and that's what'll get placed in SFT.15.1. So, there's no reason that the transformer should fail, that I can see. There's most likely something else happening on your specific Mirth Connect instance that's causing those errors. Can you post the entire error message?

psanders 11-05-2012 12:55 PM

Thx narupley, I found the problem. Your right the error isn't because of blank fields, I found a logic error in the deployment of two channels that was causing it. Essentially, another channel was also looking for the file extension and grabbing a half empty file.

All times are GMT -8. The time now is 04:25 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation