java.lang.IllegalArgumentException: Illegal group reference

Mirth Project | Nick Rupley | 3 years ago
  1. 0

    For example, if the attachment content contains a "$" character, you'll get the following error: \\ \\ {code}[2013-10-25 10:37:58,200] ERROR (com.mirth.connect.server.util.AttachmentUtil:40): Error reattaching attachments java.lang.IllegalArgumentException: Illegal group reference at java.util.regex.Matcher.appendReplacement(Matcher.java:808) at java.util.regex.Matcher.replaceAll(Matcher.java:906) at java.lang.String.replaceAll(String.java:2162) at com.mirth.connect.server.util.AttachmentUtil.reAttachMessage(AttachmentUtil.java:35) at com.mirth.connect.server.util.DICOMUtil.reAttachMessage(DICOMUtil.java:170) at org.mule.providers.TemplateValueReplacer.loadContextFromMessageObject(TemplateValueReplacer.java:161) at org.mule.providers.TemplateValueReplacer.replaceValues(TemplateValueReplacer.java:85) at org.mule.providers.TemplateValueReplacer.replaceValues(TemplateValueReplacer.java:79) at com.mirth.connect.connectors.vm.VMMessageDispatcher.routeTemplatedMessage(VMMessageDispatcher.java:178) at com.mirth.connect.connectors.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:265) at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:164) at org.mule.impl.MuleSession.sendEvent(MuleSession.java:191) at org.mule.impl.MuleSession.sendEvent(MuleSession.java:130) at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:85) at org.mule.routing.outbound.FilteringMulticastingRouter.route(FilteringMulticastingRouter.java:54) at org.mule.routing.outbound.OutboundMessageRouter$1.doInTransaction(OutboundMessageRouter.java:78) at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:48) at org.mule.routing.outbound.OutboundMessageRouter.route(OutboundMessageRouter.java:82) at org.mule.impl.model.DefaultMuleProxy.onCall(DefaultMuleProxy.java:247) at org.mule.impl.model.seda.SedaComponent.doSend(SedaComponent.java:209) at org.mule.impl.model.AbstractComponent.sendEvent(AbstractComponent.java:277) at org.mule.impl.MuleSession.sendEvent(MuleSession.java:201) at org.mule.routing.inbound.InboundMessageRouter.send(InboundMessageRouter.java:176) at org.mule.routing.inbound.InboundMessageRouter.route(InboundMessageRouter.java:143) at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:487) at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:266) at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:225) at com.mirth.connect.connectors.vm.VMMessageReceiver.getMessages(VMMessageReceiver.java:222) at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:108) at org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:97) at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575) at java.lang.Thread.run(Thread.java:724){code} This is because AttachmentUtil just does a replaceAll on the message, and the attachment content is used verbatim in the replacement parameter. Backspaces are currently escaped, but nothing else.

    Mirth Project | 3 years ago | Nick Rupley
    java.lang.IllegalArgumentException: Illegal group reference
  2. 0

    For example, if the attachment content contains a "$" character, you'll get the following error: \\ \\ {code}[2013-10-25 10:37:58,200] ERROR (com.mirth.connect.server.util.AttachmentUtil:40): Error reattaching attachments java.lang.IllegalArgumentException: Illegal group reference at java.util.regex.Matcher.appendReplacement(Matcher.java:808) at java.util.regex.Matcher.replaceAll(Matcher.java:906) at java.lang.String.replaceAll(String.java:2162) at com.mirth.connect.server.util.AttachmentUtil.reAttachMessage(AttachmentUtil.java:35) at com.mirth.connect.server.util.DICOMUtil.reAttachMessage(DICOMUtil.java:170) at org.mule.providers.TemplateValueReplacer.loadContextFromMessageObject(TemplateValueReplacer.java:161) at org.mule.providers.TemplateValueReplacer.replaceValues(TemplateValueReplacer.java:85) at org.mule.providers.TemplateValueReplacer.replaceValues(TemplateValueReplacer.java:79) at com.mirth.connect.connectors.vm.VMMessageDispatcher.routeTemplatedMessage(VMMessageDispatcher.java:178) at com.mirth.connect.connectors.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:265) at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:164) at org.mule.impl.MuleSession.sendEvent(MuleSession.java:191) at org.mule.impl.MuleSession.sendEvent(MuleSession.java:130) at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:85) at org.mule.routing.outbound.FilteringMulticastingRouter.route(FilteringMulticastingRouter.java:54) at org.mule.routing.outbound.OutboundMessageRouter$1.doInTransaction(OutboundMessageRouter.java:78) at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:48) at org.mule.routing.outbound.OutboundMessageRouter.route(OutboundMessageRouter.java:82) at org.mule.impl.model.DefaultMuleProxy.onCall(DefaultMuleProxy.java:247) at org.mule.impl.model.seda.SedaComponent.doSend(SedaComponent.java:209) at org.mule.impl.model.AbstractComponent.sendEvent(AbstractComponent.java:277) at org.mule.impl.MuleSession.sendEvent(MuleSession.java:201) at org.mule.routing.inbound.InboundMessageRouter.send(InboundMessageRouter.java:176) at org.mule.routing.inbound.InboundMessageRouter.route(InboundMessageRouter.java:143) at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:487) at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:266) at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:225) at com.mirth.connect.connectors.vm.VMMessageReceiver.getMessages(VMMessageReceiver.java:222) at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:108) at org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:97) at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575) at java.lang.Thread.run(Thread.java:724){code} This is because AttachmentUtil just does a replaceAll on the message, and the attachment content is used verbatim in the replacement parameter. Backspaces are currently escaped, but nothing else.

    Mirth Project | 3 years ago | Nick Rupley
    java.lang.IllegalArgumentException: Illegal group reference
  3. 0

    IllegalArgumentException into Mapper Generator

    GitHub | 3 years ago | Tolsi
    java.lang.IllegalArgumentException: Illegal group reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    NPE when cli run as remote is false

    GitHub | 2 years ago | liyang-gmt8
    java.lang.IllegalArgumentException: Illegal group reference
  6. 0

    experiment designer doesn't like $ in experiment text

    GitHub | 1 year ago | kamalhakim
    java.lang.IllegalArgumentException: Illegal group reference

  1. treanz 1 times, last 5 months ago
  2. Larten 2 times, last 9 months ago
8 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalArgumentException

    Illegal group reference

    at java.util.regex.Matcher.appendReplacement()
  2. Java RT
    String.replaceAll
    1. java.util.regex.Matcher.appendReplacement(Matcher.java:808)
    2. java.util.regex.Matcher.replaceAll(Matcher.java:906)
    3. java.lang.String.replaceAll(String.java:2162)
    3 frames
  3. com.mirth.connect
    DICOMUtil.reAttachMessage
    1. com.mirth.connect.server.util.AttachmentUtil.reAttachMessage(AttachmentUtil.java:35)
    2. com.mirth.connect.server.util.DICOMUtil.reAttachMessage(DICOMUtil.java:170)
    2 frames
  4. org.mule.providers
    TemplateValueReplacer.replaceValues
    1. org.mule.providers.TemplateValueReplacer.loadContextFromMessageObject(TemplateValueReplacer.java:161)
    2. org.mule.providers.TemplateValueReplacer.replaceValues(TemplateValueReplacer.java:85)
    3. org.mule.providers.TemplateValueReplacer.replaceValues(TemplateValueReplacer.java:79)
    3 frames
  5. com.mirth.connect
    VMMessageDispatcher.doSend
    1. com.mirth.connect.connectors.vm.VMMessageDispatcher.routeTemplatedMessage(VMMessageDispatcher.java:178)
    2. com.mirth.connect.connectors.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:265)
    2 frames
  6. org.mule.providers
    AbstractMessageDispatcher.send
    1. org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:164)
    1 frame
  7. org.mule.impl
    MuleSession.sendEvent
    1. org.mule.impl.MuleSession.sendEvent(MuleSession.java:191)
    2. org.mule.impl.MuleSession.sendEvent(MuleSession.java:130)
    2 frames
  8. Mule Core
    OutboundMessageRouter.route
    1. org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:85)
    2. org.mule.routing.outbound.FilteringMulticastingRouter.route(FilteringMulticastingRouter.java:54)
    3. org.mule.routing.outbound.OutboundMessageRouter$1.doInTransaction(OutboundMessageRouter.java:78)
    4. org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:48)
    5. org.mule.routing.outbound.OutboundMessageRouter.route(OutboundMessageRouter.java:82)
    5 frames
  9. org.mule.impl
    MuleSession.sendEvent
    1. org.mule.impl.model.DefaultMuleProxy.onCall(DefaultMuleProxy.java:247)
    2. org.mule.impl.model.seda.SedaComponent.doSend(SedaComponent.java:209)
    3. org.mule.impl.model.AbstractComponent.sendEvent(AbstractComponent.java:277)
    4. org.mule.impl.MuleSession.sendEvent(MuleSession.java:201)
    4 frames
  10. org.mule.routing
    InboundMessageRouter.route
    1. org.mule.routing.inbound.InboundMessageRouter.send(InboundMessageRouter.java:176)
    2. org.mule.routing.inbound.InboundMessageRouter.route(InboundMessageRouter.java:143)
    2 frames
  11. org.mule.providers
    AbstractMessageReceiver.routeMessage
    1. org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:487)
    2. org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:266)
    3. org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:225)
    3 frames
  12. com.mirth.connect
    VMMessageReceiver.getMessages
    1. com.mirth.connect.connectors.vm.VMMessageReceiver.getMessages(VMMessageReceiver.java:222)
    1 frame
  13. org.mule.providers
    PollingMessageReceiver.run
    1. org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:108)
    2. org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:97)
    2 frames
  14. org.mule.impl
    WorkerContext.run
    1. org.mule.impl.work.WorkerContext.run(WorkerContext.java:290)
    1 frame
  15. Backport of JSR 166
    ThreadPoolExecutor$Worker.run
    1. edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
    2. edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
    2 frames
  16. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:724)
    1 frame