Announcement

Collapse
No announcement yet.

error filter

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

  • error filter

    I am tried to consult a row in the data base and to give back to a communication point the value of a field of that is same row.
    This it is the code that I am using in the filter:


    var driver, address, username, password //variables initialized previously

    dbConn = DatabaseConnectionFactory.createDatabaseConnection (driver, address, username, password);

    var campo = msg['message']['message.01']['message.01.1'];

    var expression = "SELECT * FROM demograficos WHERE idpaciente = 1;";
    var resultado = dbConn.executeQuery(expression);

    resultado.next();

    var texto = resultado.getClob["responsexml"];

    var cantidad = resultado.getLength();

    resultado.close();
    dbConn.close();

    globalMap.put('Prueba',texto);
    globalMap.put('xml',cantidad);

    //msg = texto;
    return true;


    This is the error message that shows to me in logs:

    ERROR-200: Filter error
    ERROR MESSAGE: Error evaluating filter
    org.mozilla.javascript.WrappedException: Wrapped org.postgresql.util.PSQLException: This ResultSet is closed. (b7d96e74-5ee5-4f77-90df-eb4fe5578a16#20)
    at org.mozilla.javascript.Context.throwAsScriptRuntim eEx(Context.java:1693)
    at org.mozilla.javascript.MemberBox.invoke(MemberBox. java:157)
    at org.mozilla.javascript.NativeJavaMethod.call(Nativ eJavaMethod.java:201)
    at org.mozilla.javascript.optimizer.OptRuntime.callPr op0(OptRuntime.java:117)
    at org.mozilla.javascript.gen.c683._c3(b7d96e74-5ee5-4f77-90df-eb4fe5578a16:20)
    at org.mozilla.javascript.gen.c683.call(b7d96e74-5ee5-4f77-90df-eb4fe5578a16)
    at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
    at org.mozilla.javascript.gen.c683._c2(b7d96e74-5ee5-4f77-90df-eb4fe5578a16:55)
    at org.mozilla.javascript.gen.c683.call(b7d96e74-5ee5-4f77-90df-eb4fe5578a16)
    at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
    at org.mozilla.javascript.gen.c683._c0(b7d96e74-5ee5-4f77-90df-eb4fe5578a16:57)
    at org.mozilla.javascript.gen.c683.call(b7d96e74-5ee5-4f77-90df-eb4fe5578a16)
    at org.mozilla.javascript.ContextFactory.doTopCall(Co ntextFactory.java:337)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr iptRuntime.java:2755)
    at org.mozilla.javascript.gen.c683.call(b7d96e74-5ee5-4f77-90df-eb4fe5578a16)
    at org.mozilla.javascript.gen.c683.exec(b7d96e74-5ee5-4f77-90df-eb4fe5578a16)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateFilterScript(JavaScriptTra nsformer.java:268)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:221)
    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:276)
    at com.webreach.mirth.server.mule.providers.tcp.TcpMe ssageDispatcher.doDispatch(TcpMessageDispatcher.ja va:124)
    at com.webreach.mirth.server.mule.providers.tcp.TcpMe ssageDispatcher.doSend(TcpMessageDispatcher.java:2 15)
    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:492)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:243)
    at com.webreach.mirth.server.mule.providers.tcp.TcpMe ssageReceiver$TcpWorker.processData(TcpMessageRece iver.java:278)
    at com.webreach.mirth.server.mule.providers.tcp.TcpMe ssageReceiver$TcpWorker.run(TcpMessageReceiver.jav a:250)
    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)
    Caused by: org.postgresql.util.PSQLException: This ResultSet is closed.
    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkC losed(AbstractJdbc2ResultSet.java:2442)
    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.next(A bstractJdbc2ResultSet.java:1816)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.mozilla.javascript.MemberBox.invoke(MemberBox. java:142)
    ... 45 more


    Somebody can help me, please?

  • #2
    Re:error filter

    Try:
    var texto="Sin texto";
    var cantidad=0;
    if (resultado.next()){
    texto = resultado.getClob["responsexml"];
    cantidad = resultado.getLength();
    }

    Comment


    • #3
      Re:error filter

      Thank you very much Alberto, I am going to prove it right now and I tell you .

      An indiscreet question: You are Spanish?

      Comment


      • #4
        Re:error filter

        The code that I have use is the following one:

        var dbConn = DatabaseConnectionFactory.createDatabaseConnection (driver, address, username, password);

        var campo = msg['message']['message.01']['message.01.1'];

        //var expression = "SELECT responsexml FROM demograficos WHERE idpaciente = to_number(123123123)";
        var expression = "SELECT * FROM demograficos d WHERE d.idpaciente = 1;";

        //var stmt = dbConn.prepareStatement(expression);
        var resultado = dbConn.executeCachedQuery(expression);

        var texto="Sin texto";
        var cantidad=0;
        if (resultado.next()){
        texto = resultado.getClob["responsexml"];
        cantidad = resultado.getLength();
        }


        And the error:

        ERROR-200: Filter error
        ERROR MESSAGE: Error evaluating filter
        org.mozilla.javascript.WrappedException: Wrapped java.sql.SQLException: Invalid column display size. Cannot be less than zero (ed60297b-f25f-4133-83b9-0cc965b6a524#18)


        But, when I use the function:
        var resultado = dbConn.executeCachedQuery(expression);
        when executing the query appears to me the following error:

        ERROR-200: Filter error
        ERROR MESSAGE: Error evaluating filter
        org.mozilla.javascript.WrappedException: Wrapped org.postgresql.util.PSQLException: This ResultSet is closed. (1e35c4c4-c191-4795-a32e-704c16c2860e#22)
        at org.mozilla.javascript.Context.throwAsScriptRuntim eEx(Context.java:1693)

        What Can I do?

        Comment


        • #5
          Re:error filter

          I'm sorry, Lourdes. Your code looks right. I don't know why are you getting this problems.


          Have you tested the sql using a java generic db console (squirrel, aquadataStudio,...) ?

          Have you other dbCon opened? Other recordset ?

          And, yes, I'm spanish, From Burgos. If you prefer, we could continue in spanish at albersato [at] gmail [dot] com

          Comment

          Working...
          X