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

how to call a custom java class with Mirth 1.7?

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

  • how to call a custom java class with Mirth 1.7?

    [ul]I have a simple Java class called MessageSegments with two String attributes with simple getter and setter methods for both.
    I have created multiple constructors including one that has no parameters.
    I have one package called 'test' where the single MessageSegments class is.
    I created a jar using: jar cfv newtest.jar ./test
    I placed my newtest.jar into the MIRTH_HOME/lib/custom directory and then started mirth.[/ul]


    My javascript transformer step I have tried a number of the suggestions on the forum:

    Code:
    importPackage(Packages.test);
    var obj = new MessageSegments();

    --and also tried---
    Code:
    var obj = new Packages.test.MessageSegments();
    both approaches produce this error:
    ERROR-300: Transformer error
    ERROR MESSAGE: Error evaluating transformer
    com.webreach.mirth.server.MirthJavascriptTransform erException:
    CHANNEL: tuesday testing
    CONNECTOR: Destination 1
    SCRIPT SOURCE:
    LINE NUMBER: 3
    DETAILS: Java constructor for "test.MessageSegments" with arguments "" not found.
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateScript(JavaScriptTransform er.java:397)
    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.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at com.webreach.mirth.server.controllers.MessageObjec tController.getMessageObjectFromEvent(MessageObjec tController.java:507)
    at com.webreach.mirth.connectors.file.FileMessageDisp atcher.doDispatch(FileMessageDispatcher.java:74)
    at com.webreach.mirth.connectors.file.FileMessageDisp atcher.doSend(FileMessageDispatcher.java:207)
    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)

  • #2
    Re:how to call a custom java class with Mirth 1.7?

    that sounds like it should work...i've gotten it to work in 1.7...your error is saying the Java Constructor can't be found...maybe check that you made the constructor and the class public?

    goodluck.

    Comment

    Working...
    X