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 8664153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:10:27+00:00 2026-06-12T17:10:27+00:00

I am trying to set a list of objects(serializable) in Memcached client. I am

  • 0

I am trying to set a list of objects(serializable) in Memcached client. I am doing it using the set method. I am getting this error message:

Exception occurred in target VM: Non-serializable object

So it’s not allowing me to set the value in the MemcachedClient object. Here’s my code:

MemcachedClient client = CacheConnectionUtil.connectToCacheServer(this.applicationEnv);
client.set(generateCacheKey(namespace, key), expireInSeconds, value);
// value is a list of objects that implements serializable

Why am I getting this error message?

  • 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-06-12T17:10:28+00:00Added an answer on June 12, 2026 at 5:10 pm

    From the Serializable javadocs:

    When traversing a graph, an object may be encountered that does not support the Serializable interface. In this case the NotSerializableException will be thrown and will identify the class of the non-serializable object.

    Memcached seems to be hiding the rest of the exception message, so you’ll have to identify the non-serializable object yourself.

    You say that values is a list of your own object. My guess is your object holds something that isn’t also Serializable, or it holds something that holds something else that isn’t Serializable. Go through the class of the objects in your list and make sure that every object underneath it implements Serializable.

    As an example, if I have A implements Serializable:

    public class A implements Serializable {
        private B b;
        // ...
    }
    

    And B doesn’t:

    public class B { ... }
    

    Then any attempt to serialize A using an ObjectOutputStream (which is probably what the default serializer in the Memcached library is doing) will throw a NotSerializableException because its field, private B b, is a non-serializable type, which is what you’re getting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting a TypeError: cannot concatenate 'str' and 'list' objects. I'm trying to pass
I'm trying to filter a list of objects using linq. When i filter by
I'm trying to output a list of objects to a json format using the
I'm trying to set up distinct listeners for a list of objects: for(i=0;i<numInputs;i++) {
I'm trying to convert to list of hibernate objects to XML using JAXB. Are
I'm trying to set up an accordian style list of tabs where I can
I am trying to create a list box that displays a set of data
So I am trying to get a UITableView to show a list of objects
I have a DataGridView to which I've set a list of objects to the
I am trying to use LINQ to query a list of objects wherever appropriate.

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.