Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6530073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:42:43+00:00 2026-05-25T09:42:43+00:00

What could be wrong? val is = IntegerSerializer.get mutator.addInsertion(deviceId, COLUMN_FAMILY_CARSTATUS, createColumn(mileage, 111, ss, is))}

  • 0

What could be wrong?

val is = IntegerSerializer.get
mutator.addInsertion(deviceId, COLUMN_FAMILY_CARSTATUS, createColumn("mileage", 111, ss, is))}


ModelOperation.scala:96: error: type mismatch;
[INFO]  found   : me.prettyprint.cassandra.serializers.IntegerSerializer
[INFO]  required: me.prettyprint.hector.api.Serializer[Any]
[INFO] Note: java.lang.Integer <: Any (and me.prettyprint.cassandra.serializers.IntegerSerializer <: me.prettyprint.cassandra.serializers.AbstractSerializer[java.lang.Integer]), but Java-defined trait Serializer is invariant in type T.
[INFO] You may wish to investigate a wildcard type such as `_ <: Any`. (SLS 3.2.10)
[INFO]      mutator.addInsertion(deviceId, COLUMN_FAMILY_CARSTATUS, createColumn("mileage", 111, ss, is))}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:42:44+00:00Added an answer on May 25, 2026 at 9:42 am

    The error is saying that createColumn requires a serializer of type Serializer[Any], but you’re passing one of type Serializer[Integer]. This would only work if Serializer were covariant in its type parameter (i.e., defined as Serializer[+T]). But instead, Serializer comes from Java, where covariance works differently.

    The type Serializer[Integer] can be safely cast to Serializer[_ <: Any], so the Scala compiler is suggesting that maybe createColumn should have been written to expect that less specific wildcard type instead.

    If you can’t modify createColumn, then a last resort is to use the “type system escape hatch” asInstanceOf to cast to the expected type:

    val is = IntegerSerializer.get.asInstanceOf[Serializer[Any]] // defeats type system
    mutator.addInsertion(... is ...)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could anybody tell me what is wrong with this code ?? jQuery(document).ready(function(){ var val
What could possibly go wrong with the following transaction if executed by concurrent users
I am not sure what I could be doing wrong that causes info level
OpenFileDialog^ dialog = gcnew OpenFileDialog; dialog->ShowDialog(); What could possibly be wrong with this? I'm
Could someone explain what I am doing wrong with my classes that my JTabbedPane
I could be not more sorry guys - the question was a very wrong
I was wondering if someone could tell me what I am doing wrong that
I can't see where I'm going wrong. I've tried everything I could think of,
Could someone please suggest where I might be going wrong with the following code?
I don't know what I've done wrong, or what could have caused this bug.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.