Questions tagged [notserializableexception]

Exception thrown when an instance is required to have a Serializable interface.

In Java, NotSerializableException class which extends ObjectStreamException class is responsible for notserializableexception. Thrown when an instance is required to have a Serializable interface. The serialization runtime or the class of the instance can throw this exception. The argument should be the name of the class.

121 questions
4
votes
1 answer

NotSerializableException(UpdateHandler)

I wrote a GUI which connects with a server application using RMI. Because the GUI has to show the online users a thread refreshes the JLabel which includes the "Online-User-List". Sometimes I get this exception on runtime: Caused by:…
The Kanguru
  • 313
  • 1
  • 2
  • 9
4
votes
1 answer

Apache Spark with Cassandra behavior

I am writing a standalone Spark program that gets its data from Cassandra. I followed the examples and created the RDD via the newAPIHadoopRDD() and the ColumnFamilyInputFormat class. The RDD is created, but I get a NotSerializableException when I…
4
votes
3 answers

Not Serializable Exception on custom class - Android

So I'm trying to pass an instance of a class I create by intent to a new activity. public class Room implements Serializable{ /** * */ private static final long serialVersionUID = 6857044522819206055L; int roomID; …
pat
  • 1,005
  • 4
  • 12
  • 29
3
votes
1 answer

Why does Spark Dataset.map require all parts of the query to be serializable?

I would like to use the Dataset.map function to transform the rows of my dataset. The sample looks like this: val result = testRepository.readTable(db, tableName) .map(testInstance.doSomeOperation) .count() where testInstance is a class that…
RvdV
  • 406
  • 3
  • 10
3
votes
0 answers

java.io.NotSerializableException in generic protobuf parser

I want to create generic parser for protobufs and use it in Dataflow in GCP. I've already read that i need Parser class, I pass it as a parametr. Here's code that i wrote: public static DoFn> ProtoTransformation (Parser…
Champer
  • 95
  • 5
3
votes
1 answer

How to fix 'NotSerializableException: java.time.format.DateTimeFormatter' Error

I am trying to use ObjectOutputStream to save all objects in an Arraylist to file. An attribute of the object is a LocalDate and whenever I try to write to file an error NotSerializableException: java.time.format.DateTimeFormatter returns despite…
Chornologic
  • 117
  • 2
  • 8
3
votes
1 answer

Why does custom DefaultSource give java.io.NotSerializableException?

this is my first post on SO and my apology if the improper format is being used. I'm working with Apache Spark to create a new source (via DefaultSource), BaseRelations, etc... and run into a problem with serialization that I would like to…
3
votes
2 answers

Java RMI Exception Error

I am just starting to learn RMI and JFrame and I have been stuck on an exception for a bit. I'm writing a client/server interaction that will access stock information from yahoo's database. Here's my code: package stockquote; public class…
Nicholas
  • 918
  • 1
  • 8
  • 14
3
votes
1 answer

java.io.NotSerializableException for unknown classes

I'm trying to make my classes Serializable. All of my classes are, but still it throws me NotSerializableException for some other classes that I can't find it's usages (e.g. com.sun.java.swing.plaf.windows.XPStyle, WClipboard). What can I do and how…
Aleksandar
  • 1,163
  • 22
  • 41
3
votes
3 answers

Java unable to serialize a objects which contain TreeMaps with Comparators

I have as an assignment (for the OOP course from Uni) a pretty large project: a school register, where students can see their grades, teachers can add grades and so on. The "base" class is a singleton which contains all the classes (Java) used, such…
3
votes
3 answers

NotSerializableException on saving custom class

My two classes are designed too create an array of StudentData objects (name, Date Of Birth, and ID), that include a toString override to print out all variables. It then serializes the array and saves it to a file named studentdata.txt. It should…
Quinn
  • 577
  • 2
  • 6
  • 14
2
votes
1 answer

Why I receive NotSerializableException while attempting to Serialize an Object

I have the following class: public class GameWorld implements Serializable { int sumu_dist = 30; public List tileGroup = new ArrayList<>(); public List loadingTiles = new ArrayList<>(); // constructor etc. } in…
2
votes
1 answer

How do I make JavaFX TreeView and TreeItem serializable?

I'm got this error (java.io.NotSerializableException: javafx.scene.control.TreeView) when trying to save my TreeView using ObjectOutputStream. I have 2 classes which implements Serializable and 1 main class which doesn't implements Serializable. The…
papert1ger
  • 59
  • 5
2
votes
3 answers

Storing object in database in Java

I am trying to store my object in MySQL database using java language. I am trying to convert object into byte so I can store it into LONGBLOB. But I am facing error i.e "NotSerializable Exception". My Class whose object I want to sore: public class…
nix
  • 165
  • 2
  • 4
  • 19
2
votes
1 answer

How to avoid the serialization exception (NotSerializableException) with Spring Data

I have a problem with Spring Data, I receive some exception of NotSerializableException type. Below an example to explain how I have this problem : @Component @Scope("session") public class Bean implements Serializable { @Autowired private …
user2049200
  • 127
  • 2
  • 10
1
2
3
8 9