writing aborted; java.io.NotSerializableException: org.springframework.jdbc

I am tring to do database operation and every java class I had implemented is serialized but when I am starts Tomcat 7, I get this error every time.
I use to get this error previously but when I serialized related java classes, it use to be gone. other words, it use to give which java class need serialze but this time its asking to serialze spring class
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException:

My question is: how can I get rid of this error?

error are as attached, setting are as follows. Any help will be great…

file: DataSourceDetails.xml

<?xml version="1.0" encoding="UTF-8"?> com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/rem root root

package com.example.database;
import java.io.Serializable;
import javax.sql.DataSource;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.jdbc.core.JdbcTemplate;

public class Template implements Serializable{
public static JdbcTemplate getTemplate(){
Resource resource = new ClassPathResource(“DataSourceDetails.xml”);
BeanFactory factory = new XmlBeanFactory(resource);
DataBaseImpl ds = (DataBaseImpl) factory.getBean(“s1”);
DataSource dbconn = ds.getDbConnection();
return new JdbcTemplate(dbconn);
} catch (Exception e){
return null;
17927.rtf (13.1 KB)

I’m guessing that this happens on Tomcat startup/shutdown.

In that case, this is probably because Tomcat by default serializes your sessions on shutdown and reloads them on startup. The message is harmless (although those sessions won’t be deserialized). You can disable this feature by uncommenting the “Manager” line in your Tomcat context.xml (if I remember correctly).