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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:28:58+00:00 2026-06-10T23:28:58+00:00

I have Java class configuration which is serializable. I want to create an instance

  • 0

I have Java class configuration which is serializable.

I want to create an instance of configuration which contains data of type string,Document (org.w3c.dom.Document) and save it into Db which is of type BLOB.

But when i am going to save it into the DB it’s throwing exception :

java.io.NotSerializableException: org.w3c.tidy.DOMElementImpl

My configuration class is:

public class Configuration extends Tag implements Serializable{

    private Document doc = null ;
    private String checkpoint=null; 

}

I have used following code when saving configuration object to DB :

ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(bos);   
out.writeObject(configuration);
byte[] confBytes = bos.toByteArray(); 

I am first converting it to byte array and then saving.

can anyone help me to get out of this issue..

  • 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-10T23:29:00+00:00Added an answer on June 10, 2026 at 11:29 pm
    java.io.NotSerializableException: org.w3c.tidy.DOMElementImpl
    

    This is saying that the DOMElementImpl class is not marked as Serializable. Even though your Configuration class implements Serializable, all of the fields in your class need to do so as well. I assume that Document is the field that is the problem. To quote from this serialization tutorial:

    Notice that for a class to be serialized successfully, two conditions must be met:

    • The class must implement the java.io.Serializable interface.

    • All of the fields in the class must be serializable. If a field is not serializable, it must be marked transient.

    Looking at the DOMElementImpl class, it does implement Serializable. If you need to serialize this to a database then you will need to export it to another class before storing to the database.

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

Sidebar

Related Questions

I have a Java class which handles both single valued and multi-valued data. Therefore,
I have a java package which contains all my test case classes. Each class
If I have a java class which is package-private (declared with class, not public
I'm new to learning JSPs and Servlets. I have a Java class which calls
I have a CustomerRelation class which has a method getInstance() and instance variable i.e
I have a small Java application which uses some configuration settings, which are saved
I have a JAVA class in which I have implemented parsing of XML using
I have a jar with main-class which can be executed like: java -jar test.jar
I have a java class and I need to debug it (put breakpoints and
I have a java class containing all the columns of a database table as

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.