org.mule.api.store.ObjectStoreException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in (java.sql.SQLException)

MuleSoft JIRA | Mariano Capurro | 5 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    The method that inititalises the query runner is not passing the dataSource when creating it: if (queryRunner == null) { if (this.queryTimeout >= 0) { queryRunner = new ExtendedQueryRunner(dataSource, this.queryTimeout); } else { queryRunner = new QueryRunner(); } } The line queryRunner = new QueryRunner(); should be replaced by queryRunner = new QueryRunner(dataSource); If not, you get the following exception: org.mule.api.store.ObjectStoreException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in (java.sql.SQLException) org.mule.api.store.ObjectStoreException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in (java.sql.SQLException) at org.mule.transport.jdbc.store.JdbcObjectStore.query(JdbcObjectStore.java:172) at org.mule.transport.jdbc.store.JdbcObjectStore.retrieve(JdbcObjectStore.java:87) at org.mule.transport.jdbc.store.JdbcObjectStore.remove(JdbcObjectStore.java:77) at org.mule.transport.sap.store.MuleObjectStoreTIdStore.remove(MuleObjectStoreTIdStore.java:56) at org.mule.transport.sap.jco3.SapJcoServerTIdHandler.confirmTID(SapJcoServerTIdHandler.java:86) at com.sap.conn.jco.rt.DefaultServerWorker.onConfirmTID(DefaultServerWorker.java:228) at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.handletRfcConfirm(MiddlewareJavaRfc.java:2867) at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.listen(MiddlewareJavaRfc.java:2375) at com.sap.conn.jco.rt.DefaultServerWorker.dispatch(DefaultServerWorker.java:284) at com.sap.conn.jco.rt.DefaultServerWorker.loop(DefaultServerWorker.java:369) at com.sap.conn.jco.rt.DefaultServerWorker.run(DefaultServerWorker.java:245) at java.lang.Thread.run(Thread.java:680)

    MuleSoft JIRA | 5 years ago | Mariano Capurro
    org.mule.api.store.ObjectStoreException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in (java.sql.SQLException)
  2. 0

    The method that inititalises the query runner is not passing the dataSource when creating it: if (queryRunner == null) { if (this.queryTimeout >= 0) { queryRunner = new ExtendedQueryRunner(dataSource, this.queryTimeout); } else { queryRunner = new QueryRunner(); } } The line queryRunner = new QueryRunner(); should be replaced by queryRunner = new QueryRunner(dataSource); If not, you get the following exception: org.mule.api.store.ObjectStoreException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in (java.sql.SQLException) org.mule.api.store.ObjectStoreException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in (java.sql.SQLException) at org.mule.transport.jdbc.store.JdbcObjectStore.query(JdbcObjectStore.java:172) at org.mule.transport.jdbc.store.JdbcObjectStore.retrieve(JdbcObjectStore.java:87) at org.mule.transport.jdbc.store.JdbcObjectStore.remove(JdbcObjectStore.java:77) at org.mule.transport.sap.store.MuleObjectStoreTIdStore.remove(MuleObjectStoreTIdStore.java:56) at org.mule.transport.sap.jco3.SapJcoServerTIdHandler.confirmTID(SapJcoServerTIdHandler.java:86) at com.sap.conn.jco.rt.DefaultServerWorker.onConfirmTID(DefaultServerWorker.java:228) at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.handletRfcConfirm(MiddlewareJavaRfc.java:2867) at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.listen(MiddlewareJavaRfc.java:2375) at com.sap.conn.jco.rt.DefaultServerWorker.dispatch(DefaultServerWorker.java:284) at com.sap.conn.jco.rt.DefaultServerWorker.loop(DefaultServerWorker.java:369) at com.sap.conn.jco.rt.DefaultServerWorker.run(DefaultServerWorker.java:245) at java.lang.Thread.run(Thread.java:680)

    MuleSoft JIRA | 5 years ago | Mariano Capurro
    org.mule.api.store.ObjectStoreException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in (java.sql.SQLException)

    Root Cause Analysis

    1. org.mule.api.store.ObjectStoreException

      QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in (java.sql.SQLException)

      at org.mule.transport.jdbc.store.JdbcObjectStore.query()
    2. org.mule.transport
      SapJcoServerTIdHandler.confirmTID
      1. org.mule.transport.jdbc.store.JdbcObjectStore.query(JdbcObjectStore.java:172)
      2. org.mule.transport.jdbc.store.JdbcObjectStore.retrieve(JdbcObjectStore.java:87)
      3. org.mule.transport.jdbc.store.JdbcObjectStore.remove(JdbcObjectStore.java:77)
      4. org.mule.transport.sap.store.MuleObjectStoreTIdStore.remove(MuleObjectStoreTIdStore.java:56)
      5. org.mule.transport.sap.jco3.SapJcoServerTIdHandler.confirmTID(SapJcoServerTIdHandler.java:86)
      5 frames
    3. com.sap.conn
      DefaultServerWorker.run
      1. com.sap.conn.jco.rt.DefaultServerWorker.onConfirmTID(DefaultServerWorker.java:228)
      2. com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.handletRfcConfirm(MiddlewareJavaRfc.java:2867)
      3. com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcServer.listen(MiddlewareJavaRfc.java:2375)
      4. com.sap.conn.jco.rt.DefaultServerWorker.dispatch(DefaultServerWorker.java:284)
      5. com.sap.conn.jco.rt.DefaultServerWorker.loop(DefaultServerWorker.java:369)
      6. com.sap.conn.jco.rt.DefaultServerWorker.run(DefaultServerWorker.java:245)
      6 frames
    4. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:680)
      1 frame