You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assuming we have declared a an increment command. An exception is raised.
Caused by: io.lettuce.core.dynamic.CommandMethodSyntaxException: Command INCR accepts 1 parameters but method declares 2 parameter(s). Offending method: public abstract java.lang.Long org.bigbluebutton.common2.redis.commands.RecordingCommands.incrementRecords(java.lang.String)
at io.lettuce.core.dynamic.DefaultCommandMethodVerifier.validateParameters(DefaultCommandMethodVerifier.java:109)
at io.lettuce.core.dynamic.DefaultCommandMethodVerifier.validate(DefaultCommandMethodVerifier.java:71)
at io.lettuce.core.dynamic.ExecutableCommandLookupStrategySupport$DefaultCommandFactoryResolver.resolveRedisCommandFactory(ExecutableCommandLookupStrategySupport.java:74)
at io.lettuce.core.dynamic.ExecutableCommandLookupStrategySupport.resolveCommandFactory(ExecutableCommandLookupStrategySupport.java:48)
at io.lettuce.core.dynamic.AsyncExecutableCommandLookupStrategy.resolveCommandMethod(AsyncExecutableCommandLookupStrategy.java:47)
at io.lettuce.core.dynamic.RedisCommandFactory$CompositeCommandLookupStrategy.resolveCommandMethod(RedisCommandFactory.java:273)
at io.lettuce.core.dynamic.RedisCommandFactory$BatchAwareCommandLookupStrategy.resolveCommandMethod(RedisCommandFactory.java:321)
at io.lettuce.core.dynamic.RedisCommandFactory$CommandFactoryExecutorMethodInterceptor.<init>(RedisCommandFactory.java:212)
at io.lettuce.core.dynamic.RedisCommandFactory.getCommands(RedisCommandFactory.java:192)
The problem is that DefaultCommandMethodVerifier counts the parameters given by the method signature and adds any parameter bind markers to that. Therefore, it ends up with twice as many arguments.
mp911de
changed the title
Error : Command INCR accepts 1 parameters but method declares 2 parameter(s)
DefaultCommandMethodVerifier reports invalid parameter count
Nov 23, 2018
Lettuce now considers declared parameters when bound by using annotations. Previously, DefaultCommandMethodVerifier counted method arguments and bind markers as individual parameters which doubled the number of command args so command validation failed.
Lettuce now considers declared parameters when bound by using annotations. Previously, DefaultCommandMethodVerifier counted method arguments and bind markers as individual parameters which doubled the number of command args so command validation failed.
Bug Report
Current Behavior
Assuming we have declared a an increment command. An exception is raised.
Input Code
Expected behavior/code
The code above should work without raising any exception.
Environment
The text was updated successfully, but these errors were encountered: