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.

111 questions
120
votes
4 answers

Why does writeObject throw java.io.NotSerializableException and how do I fix it?

I have this exception and I don't understand why it would be thrown or, how I should handle it. try { os.writeObject(element); } catch (IOException e) { e.printStackTrace(); } Where element is a TransformGroup containing some other…
Mihai Bujanca
  • 3,779
  • 9
  • 38
  • 80
25
votes
3 answers

How serialization works when only subclass implements serializable

Only subclass has implemented Serializable interface. import java.io.*; public class NewClass1{ private int i; NewClass1(){ i=10; } int getVal() { return i; } void setVal(int i) { this.i=i; …
Ravi
  • 28,657
  • 41
  • 110
  • 158
24
votes
2 answers

java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException

What causes this kind of error in Tomcat? SEVERE: Exception loading sessions from persistent storage java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: bean.ProjectAreaBean at…
deven
  • 787
  • 3
  • 8
  • 10
21
votes
3 answers

What causes a NotSerializableException in Tomcat 7?

My DAO implementation is throwing a not serializable exception on server start up with Tomcat7. Any idea what causes this? None of my other DAOs are doing this. Here's the class: package com.project.dao; import java.util.List; import…
coder
  • 5,537
  • 19
  • 50
  • 71
12
votes
1 answer

JSF managed bean causing java.io.NotSerializableException during Tomcat deployment

At deployment of my webApplication on Tomcat 7 I am getting the console output below. After restarting the server twice or three times it works without exceptions. I am using JSF, Tomcat and an RMI connection to businesslogic part (which shouldn't…
Sven
  • 5,990
  • 23
  • 69
  • 110
9
votes
3 answers

ViewScoped Bean cause NotSerializableException

Hello I'm using a ViewScoped Bean the Problem is that when call it I get the NotSerializableException. This is the code of my Managed Bean : @ManagedBean(name="demandesBean") @ViewScoped public class DemandesBean implements Serializable { …
imrabti
  • 285
  • 4
  • 11
8
votes
2 answers

ViewExpiredException: No saved view state could be found: on submitting a form in JSF

I get the below exception while trying to submit a form. javax.faces.application.ViewExpiredException: /page1.xhtml No saved view state could be found for the view identifier: /page1.xhtml at…
7
votes
1 answer

NotSerializableException when sorting in Spark

I'm trying to write a simple stream processing Spark job which will take a list of messages (JSON-formatted), each belonging to a user, count the messages of each user and print the top ten users. However, when I define the Comparator> to sort the…
6
votes
6 answers

Flask TypeError 'is not JSON serializable' - nested dictionary

i am using Flask as framework for my server, and while returning a response i get the following error: > Traceback (most recent call last): File "C:\Python27\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request rv =…
Rafael Marques
  • 928
  • 2
  • 15
  • 24
6
votes
2 answers

How can I identify an anonymous inner class in a NotSerializableException

I have received the following error message when trying to debug an application in NetBeans: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: board.Board$1 In the course of debugging I have had to insert…
forsate
  • 63
  • 6
5
votes
1 answer

NotSerializableException when FragmentActivity goes to background in Android

I have 5 fragments inside my activity where one fragment stays active at one time. Clicking on a recyclerview item opens another fragment and puts current fragment in the backstack. The same code was working fine some days ago, but now the app is…
5
votes
2 answers

java.io.NotSerializableException when @ViewScoped is used

If I use @ViewScoped in JSF, then the following exception occurs: java.io.NotSerializableException: com.solv.basics.Basics java.io.ObjectOutputStream.writeObject0(Unknown Source) java.io.ObjectOutputStream.writeObject(Unknown Source) …
vijaya kumar
  • 757
  • 2
  • 11
  • 20
5
votes
6 answers

NotSerializableException on SimpleListProperty

I'm using Javafx, and I wrap my objects into ListProperty to let the tableview updates for any changes on the objects of the list. Now I'm trying to serialize my project and the ListProperty of objects and it throw me this exception.…
user2704938
  • 81
  • 2
  • 5
4
votes
1 answer

Java Serializable and lambda expressions

I need to save an object on file, then retrieve it later. The object itself implements the interface Serializable, but one of its fields contains lambda expressions. Apparently this counts as a field that does not implements the Serializable…
Asghabard
  • 184
  • 11
4
votes
2 answers

Spark UDF exception when accessing broadcast variable

I'm having difficulty accessing a scala.collection.immutable.Map from inside a spark UDF. I'm broadcasting the map val browserLangMap = sc.broadcast (Source.fromFile(browserLangFilePath).getLines.map(_.split(,)).map(e =>…
Cheeko
  • 993
  • 10
  • 19
1
2 3 4 5 6 7 8