java.lang.NullPointerException: Attempt to invoke interface method 'void java.sql.PreparedStatement.close()' on a null object reference

Stack Overflow | jhegedus | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Slick 3.0 Using AutoInc Primary key value in following update gives NullPointerException

    Stack Overflow | 6 months ago | jhegedus
    java.lang.NullPointerException: Attempt to invoke interface method 'void java.sql.PreparedStatement.close()' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke interface method 'void java.sql.PreparedStatement.close()' on a null object reference

      at slick.jdbc.JdbcBackend$SessionDef$class.withPreparedInsertStatement()
    2. slick.jdbc
      JdbcBackend$BaseSession.withPreparedInsertStatement
      1. slick.jdbc.JdbcBackend$SessionDef$class.withPreparedInsertStatement(JdbcBackend.scala:309)
      2. slick.jdbc.JdbcBackend$BaseSession.withPreparedInsertStatement(JdbcBackend.scala:386)
      2 frames
    3. slick.driver
      JdbcActionComponent$InsertActionComposerImpl$$anon$8.run
      1. slick.driver.JdbcInsertInvokerComponent$ReturningInsertInvoker.preparedInsert(JdbcInsertInvokerComponent.scala:321)
      2. slick.driver.JdbcInsertInvokerComponent$BaseInsertInvoker.internalInsert(JdbcInsertInvokerComponent.scala:187)
      3. slick.driver.JdbcInsertInvokerComponent$BaseInsertInvoker.insert(JdbcInsertInvokerComponent.scala:182)
      4. slick.driver.JdbcInsertInvokerComponent$InsertInvokerDef$class.$plus$eq(JdbcInsertInvokerComponent.scala:72)
      5. slick.driver.JdbcInsertInvokerComponent$BaseInsertInvoker.$plus$eq(JdbcInsertInvokerComponent.scala:152)
      6. slick.driver.JdbcActionComponent$InsertActionComposerImpl$$anonfun$$plus$eq$1.apply(JdbcActionComponent.scala:457)
      7. slick.driver.JdbcActionComponent$InsertActionComposerImpl$$anonfun$$plus$eq$1.apply(JdbcActionComponent.scala:457)
      8. slick.driver.JdbcActionComponent$InsertActionComposerImpl$$anon$8.run(JdbcActionComponent.scala:449)
      9. slick.driver.JdbcActionComponent$InsertActionComposerImpl$$anon$8.run(JdbcActionComponent.scala:447)
      9 frames
    4. slick.backend
      DatabaseComponent$DatabaseDef$$anon$2.run
      1. slick.backend.DatabaseComponent$DatabaseDef$$anon$2.liftedTree1$1(DatabaseComponent.scala:231)
      2. slick.backend.DatabaseComponent$DatabaseDef$$anon$2.run(DatabaseComponent.scala:231)
      2 frames
    5. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
      3. java.lang.Thread.run(Thread.java:818)
      3 frames