Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

FAILURE: Error writing to database: IllegalArgume

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

  • FAILURE: Error writing to database: IllegalArgume

    I am trying to do some testing with Mirth mapping fields from an HL7 file to a MySQL database and receiving this error.

    FAILURE: Error writing to database:
    IllegalArgumentException
    Write statement should be an insert / update / delete sql statement

    here is the SQL statement i have defined in my destination tab:

    use MGHdata;
    insert into MGHpatients (finger_id, ssn, FirstName, LastName) Values {
    ${finger_id},${ssn},${FirstName},${LastName}}



    I have tried everything that i can thin of and have not been able to resolve this issue and help would be greatly appreciated.

    Thanks.

  • #2
    Re:FAILURE: Error writing to database: IllegalArgume

    As I understand, the database name is specified as part of the db connection string URL. Try removing the use MGHdata;

    Hope it helps!

    Comment


    • #3
      Re:FAILURE: Error writing to database: IllegalArgume

      That seemed to be the problem but when I put the database name in the connection string I receive this error now.


      [2008-11-10 15:32:24,375] ERROR (org.mule.impl.DefaultComponentExceptionStrategy:9 5): Caught exception in Exception Strategy for: e38a93a7-6c00-4ef3-9cf1-f6f67275b7fd: java.lang.IllegalArgumentException: Write statement should be an insert / update / delete sql statement
      java.lang.IllegalArgumentException: Write statement should be an insert / update / delete sql statement
      at com.webreach.mirth.connectors.jdbc.JdbcMessageDisp atcher.doDispatch(JdbcMessageDispatcher.java:120)
      at com.webreach.mirth.connectors.jdbc.JdbcMessageDisp atcher.doSend(JdbcMessageDispatcher.java:157)
      at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:166)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
      at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
      at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:89)
      at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
      at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
      at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
      at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
      at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
      at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
      at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:161)
      at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:128)
      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.vm.VMMessageReceiver .getMessages(VMMessageReceiver.java:157)
      at org.mule.providers.TransactedPollingMessageReceive r.poll(TransactedPollingMessageReceiver.java:108)
      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(Unknown Source)

      Comment


      • #4
        Re:FAILURE: Error writing to database: IllegalArgume

        The problem is because the first word in the sql sentence is not an insert nor update nor delete: try with the next template:

        Code:
        insert into MGHpatients (finger_id, ssn, FirstName, LastName) Values {
        
        ${finger_id},${ssn},${FirstName},${LastName}}

        Comment


        • #5
          Re:FAILURE: Error writing to database: IllegalArgume

          Sorry i didn't specify, I changed the database string so the database name was in the connection string. My SQL statement looks like this:


          insert into MGHpatients (finger_id, ssn, FirstName, LastName) Values {
          ${finger_id},${ssn},${FirstName},${LastName}}

          And i am still receiving the above error. I have attached my exported channel.

          test.xml (9344 bytes)

          Comment


          • #6
            Re:FAILURE: Error writing to database: IllegalArgume

            Hi all,

            I'm not mySql expert but did you tried to change {} characters in INSERT sentence?, this:

            insert into MGHpatients (finger_id, ssn, FirstName, LastName) Values (
            ${finger_id},${ssn},${FirstName},${LastName})

            instead of:


            insert into MGHpatients (finger_id, ssn, FirstName, LastName) Values {

            ${finger_id},${ssn},${FirstName},${LastName}}

            HTH,

            Ricard Bernat

            Comment

            Working...
            X