org.h2.jdbc.JdbcSQLException: Parameter "#11" is not set; SQL statement: SELECT INT_CHANNEL_MESSAGE.MESSAGE_ID, INT_CHANNEL_MESSAGE.MESSAGE_BYTES from INT_CHANNEL_MESSAGE where INT_CHANNEL_MESSAGE.GROUP_KEY = ? and INT_CHANNEL_MESSAGE.REGION = ? and INT_CHANNEL_MESSAGE.MESSAGE_ID not in (?, ?, ?, ?, ?, ?, ?, ?, ?) order by CREATED_DATE ASC LIMIT 1 [90012-161]

Spring JIRA | Jason Pell | 4 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    It is not easy to reproduce but every now and then I get an exception "Parameter "#??" is not set" like the below... I believe it is due to the fact that the Message Id's IN clause generation, so the MESSAGE_ID not in (?, ?, ?, ?, ?, ?, ?, ?, ?) and the binding to the actual parameter values is not atomic, so there can be a certain number of message id's in the list when we are generating the MESSAGE_ID not in (?, ?, ?, ?, ?, ?, ?, ?, ?), but there could have been message id's removed after this before we actually execute the statement. You will notice below that Parameter 11 is the last ? in the not in list. I would suggest that making a copy of the list in the synchronized (idCache) { would fix the issue. I know it's H2 and you don't support it, but I got this issue with HSQLDB as well, just not very often as it is not consistent because of the fact its a race condition. org.h2.jdbc.JdbcSQLException: Parameter "#11" is not set; SQL statement: SELECT INT_CHANNEL_MESSAGE.MESSAGE_ID, INT_CHANNEL_MESSAGE.MESSAGE_BYTES from INT_CHANNEL_MESSAGE where INT_CHANNEL_MESSAGE.GROUP_KEY = ? and INT_CHANNEL_MESSAGE.REGION = ? and INT_CHANNEL_MESSAGE.MESSAGE_ID not in (?, ?, ?, ?, ?, ?, ?, ?, ?) order by CREATED_DATE ASC LIMIT 1 [90012-161] at org.h2.message.DbException.getJdbcSQLException(DbException.java:329) at org.h2.message.DbException.get(DbException.java:169) at org.h2.message.DbException.get(DbException.java:146) at org.h2.expression.Parameter.checkSet(Parameter.java:73) at org.h2.command.Prepared.checkParameters(Prepared.java:162) at org.h2.command.CommandContainer.query(CommandContainer.java:81) at org.h2.command.Command.executeQuery(Command.java:185) at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:96) at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:644) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:662) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:702) at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:166) at org.springframework.integration.jdbc.store.JdbcChannelMessageStore.doPollForMessage(JdbcChannelMessageStore.java:456) at org.springframework.integration.jdbc.store.JdbcChannelMessageStore.pollMessageFromGroup(JdbcChannelMessageStore.java:568) at org.springframework.integration.store.MessageGroupQueue.doPoll(MessageGroupQueue.java:278) at org.springframework.integration.store.MessageGroupQueue.poll(MessageGroupQueue.java:130) at org.springframework.integration.store.MessageGroupQueue.poll(MessageGroupQueue.java:47) at org.springframework.integration.channel.QueueChannel.doReceive(QueueChannel.java:91) at org.springframework.integration.channel.AbstractPollableChannel.receive(AbstractPollableChannel.java:57) at org.springframework.integration.endpoint.PollingConsumer.receiveMessage(PollingConsumer.java:79) at org.springframework.integration.endpoint.AbstractTransactionSynchronizingPollingEndpoint.doPoll(AbstractTransactionSynchronizingPollingEndpoint.java:67) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144) at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy18.call(Unknown Source) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:236) at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 04-16 15:44:52 jdbc[7]: exception

    Spring JIRA | 4 years ago | Jason Pell
    org.h2.jdbc.JdbcSQLException: Parameter "#11" is not set; SQL statement: SELECT INT_CHANNEL_MESSAGE.MESSAGE_ID, INT_CHANNEL_MESSAGE.MESSAGE_BYTES from INT_CHANNEL_MESSAGE where INT_CHANNEL_MESSAGE.GROUP_KEY = ? and INT_CHANNEL_MESSAGE.REGION = ? and INT_CHANNEL_MESSAGE.MESSAGE_ID not in (?, ?, ?, ?, ?, ?, ?, ?, ?) order by CREATED_DATE ASC LIMIT 1 [90012-161]
  2. 0

    It is not easy to reproduce but every now and then I get an exception "Parameter "#??" is not set" like the below... I believe it is due to the fact that the Message Id's IN clause generation, so the MESSAGE_ID not in (?, ?, ?, ?, ?, ?, ?, ?, ?) and the binding to the actual parameter values is not atomic, so there can be a certain number of message id's in the list when we are generating the MESSAGE_ID not in (?, ?, ?, ?, ?, ?, ?, ?, ?), but there could have been message id's removed after this before we actually execute the statement. You will notice below that Parameter 11 is the last ? in the not in list. I would suggest that making a copy of the list in the synchronized (idCache) { would fix the issue. I know it's H2 and you don't support it, but I got this issue with HSQLDB as well, just not very often as it is not consistent because of the fact its a race condition. org.h2.jdbc.JdbcSQLException: Parameter "#11" is not set; SQL statement: SELECT INT_CHANNEL_MESSAGE.MESSAGE_ID, INT_CHANNEL_MESSAGE.MESSAGE_BYTES from INT_CHANNEL_MESSAGE where INT_CHANNEL_MESSAGE.GROUP_KEY = ? and INT_CHANNEL_MESSAGE.REGION = ? and INT_CHANNEL_MESSAGE.MESSAGE_ID not in (?, ?, ?, ?, ?, ?, ?, ?, ?) order by CREATED_DATE ASC LIMIT 1 [90012-161] at org.h2.message.DbException.getJdbcSQLException(DbException.java:329) at org.h2.message.DbException.get(DbException.java:169) at org.h2.message.DbException.get(DbException.java:146) at org.h2.expression.Parameter.checkSet(Parameter.java:73) at org.h2.command.Prepared.checkParameters(Prepared.java:162) at org.h2.command.CommandContainer.query(CommandContainer.java:81) at org.h2.command.Command.executeQuery(Command.java:185) at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:96) at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:644) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:662) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:702) at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:166) at org.springframework.integration.jdbc.store.JdbcChannelMessageStore.doPollForMessage(JdbcChannelMessageStore.java:456) at org.springframework.integration.jdbc.store.JdbcChannelMessageStore.pollMessageFromGroup(JdbcChannelMessageStore.java:568) at org.springframework.integration.store.MessageGroupQueue.doPoll(MessageGroupQueue.java:278) at org.springframework.integration.store.MessageGroupQueue.poll(MessageGroupQueue.java:130) at org.springframework.integration.store.MessageGroupQueue.poll(MessageGroupQueue.java:47) at org.springframework.integration.channel.QueueChannel.doReceive(QueueChannel.java:91) at org.springframework.integration.channel.AbstractPollableChannel.receive(AbstractPollableChannel.java:57) at org.springframework.integration.endpoint.PollingConsumer.receiveMessage(PollingConsumer.java:79) at org.springframework.integration.endpoint.AbstractTransactionSynchronizingPollingEndpoint.doPoll(AbstractTransactionSynchronizingPollingEndpoint.java:67) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144) at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy18.call(Unknown Source) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:236) at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 04-16 15:44:52 jdbc[7]: exception

    Spring JIRA | 4 years ago | Jason Pell
    org.h2.jdbc.JdbcSQLException: Parameter "#11" is not set; SQL statement: SELECT INT_CHANNEL_MESSAGE.MESSAGE_ID, INT_CHANNEL_MESSAGE.MESSAGE_BYTES from INT_CHANNEL_MESSAGE where INT_CHANNEL_MESSAGE.GROUP_KEY = ? and INT_CHANNEL_MESSAGE.REGION = ? and INT_CHANNEL_MESSAGE.MESSAGE_ID not in (?, ?, ?, ?, ?, ?, ?, ?, ?) order by CREATED_DATE ASC LIMIT 1 [90012-161]
  3. 0

    H2 Oracle decode function

    Stack Overflow | 5 years ago | SvRekaa
    org.h2.jdbc.JdbcSQLException: Hexadecimal string with odd number of characters: "6.0"; SQL statement: select 6.0 - decode(1.0,2.0,3.0,4.0) from dual ; [90003-157]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Failover @Type for h2?

    Stack Overflow | 2 years ago | xenoterracide
    org.h2.jdbc.JdbcSQLException: Hexadecimal string contains non-hex character: "aced0005-7372-000e-74c2-aa3c957d4f00"; SQL statement: select character0_.task_id as task_id1_0_0_, character0_.name as name2_0_0_ from characters character0_ where character0_.task_id=? [90004-176]
  6. 0

    Ebean/idIn Parameter not set

    Stack Overflow | 4 years ago | Janus Troelsen
    javax.persistence.PersistenceException: Query threw SQLException:Parameter "#1" is not set; SQL statement: select t0.virtuelle_adresse c0, t0.reale_adresse c1, t0.betr_nr c2, t0.bemerkung c3, t0.inbetriebnahme c4, t0.dekoder_typ_id c5, t0.model_tfz_typ_id c6, t0.eigentuemer_id c7 from tfz t0 where t0.virtuelle_adresse in (?) [90012-168] Bind values:[] Query was: select t0.virtuelle_adresse c0, t0.reale_adresse c1, t0.betr_nr c2, t0.bemerkung c3, t0.inbetriebnahme c4, t0.dekoder_typ_id c5, t0.model_tfz_typ_id c6, t0.eigentuemer_id c7 from tfz t0 where t0.virtuelle_adresse in (?)
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. org.h2.jdbc.JdbcSQLException

    Parameter "#11" is not set; SQL statement: SELECT INT_CHANNEL_MESSAGE.MESSAGE_ID, INT_CHANNEL_MESSAGE.MESSAGE_BYTES from INT_CHANNEL_MESSAGE where INT_CHANNEL_MESSAGE.GROUP_KEY = ? and INT_CHANNEL_MESSAGE.REGION = ? and INT_CHANNEL_MESSAGE.MESSAGE_ID not in (?, ?, ?, ?, ?, ?, ?, ?, ?) order by CREATED_DATE ASC LIMIT 1 [90012-161]

    at org.h2.message.DbException.getJdbcSQLException()
  2. H2 Database Engine
    JdbcPreparedStatement.executeQuery
    1. org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
    2. org.h2.message.DbException.get(DbException.java:169)
    3. org.h2.message.DbException.get(DbException.java:146)
    4. org.h2.expression.Parameter.checkSet(Parameter.java:73)
    5. org.h2.command.Prepared.checkParameters(Prepared.java:162)
    6. org.h2.command.CommandContainer.query(CommandContainer.java:81)
    7. org.h2.command.Command.executeQuery(Command.java:185)
    8. org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:96)
    8 frames
  3. Spring Framework
    NamedParameterJdbcTemplate.query
    1. org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:644)
    2. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587)
    3. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637)
    4. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:662)
    5. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:702)
    6. org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:166)
    6 frames
  4. org.springframework.integration
    JdbcChannelMessageStore.pollMessageFromGroup
    1. org.springframework.integration.jdbc.store.JdbcChannelMessageStore.doPollForMessage(JdbcChannelMessageStore.java:456)
    2. org.springframework.integration.jdbc.store.JdbcChannelMessageStore.pollMessageFromGroup(JdbcChannelMessageStore.java:568)
    2 frames
  5. Spring Integration Core
    AbstractPollingEndpoint$1.call
    1. org.springframework.integration.store.MessageGroupQueue.doPoll(MessageGroupQueue.java:278)
    2. org.springframework.integration.store.MessageGroupQueue.poll(MessageGroupQueue.java:130)
    3. org.springframework.integration.store.MessageGroupQueue.poll(MessageGroupQueue.java:47)
    4. org.springframework.integration.channel.QueueChannel.doReceive(QueueChannel.java:91)
    5. org.springframework.integration.channel.AbstractPollableChannel.receive(AbstractPollableChannel.java:57)
    6. org.springframework.integration.endpoint.PollingConsumer.receiveMessage(PollingConsumer.java:79)
    7. org.springframework.integration.endpoint.AbstractTransactionSynchronizingPollingEndpoint.doPoll(AbstractTransactionSynchronizingPollingEndpoint.java:67)
    8. org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
    9. org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144)
    9 frames
  6. Java RT
    Method.invoke
    1. sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
    2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    3. java.lang.reflect.Method.invoke(Method.java:597)
    3 frames
  7. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
    2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    3 frames
  8. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    1 frame
  9. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    2 frames
  10. Unknown
    $Proxy18.call
    1. $Proxy18.call(Unknown Source)
    1 frame
  11. Spring Integration Core
    ErrorHandlingTaskExecutor$1.run
    1. org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:236)
    2. org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
    2 frames
  12. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    3. java.lang.Thread.run(Thread.java:662)
    3 frames