Spring cache - "Null key returned for cache operation"
<pre><code>@Transactional
@Repository
@RepositoryDefinition(domainClass = UserApi.class, idClass = String.class)
public interface UserApiRepository{

    @Cacheable(value="byUserId",key="#userId")
    List&lt;UserApi&gt; findByUserId(String userId);

    @CacheEvict(value="byUserId",key="#userApi.userId")
    void save(UserApi userApi);
}
</code></pre>

<p>UsrApi.java</p>

<pre><code>@Entity
@Table(name = "user_api")
public class UserApi {
    private String id;
    private String userId;
    private String api;
    private String platform;
    private String apiType;

    @Id
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getApi() {
        return api;
    }

    public void setApi(String api) {
        this.api = api;
    }

    public String getPlatform() {
        return platform;
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }

    public String getApiType() {
        return apiType;
    }

    public void setApiType(String apiType) {
        this.apiType = apiType;
    }
}
</code></pre>

<p>It's ERROR When I add <code>key="#userId"</code>.</p>

<pre><code>java.lang.IllegalArgumentException: Null key returned for cache operation
(maybe you are using named params on classes without debug info?)
Builder[public abstract java.util.List com.awinson.repository.UserApiRepository.findByUserId(java.lang.String)]
caches=[byUserId] | key='#userId' | keyGenerator='' | cacheManager='' | cacheResolver='' | condition='' | unless='' | sync='false'
</code></pre>

<p>It's doesn't update the cache when I use "<code>save</code>" method.</p>