Hello,
I'm developping an application in java that regulary saves objects onto the hard disk using this simple method:
public void save(String filename)
{
try
{
FileOutputStream fos = new FileOutputStream(filename);
GZIPOutputStream gzos = new GZIPOutputStream(fos);
ObjectOutputStream out = new ObjectOutputStream(gzos);
out.writeObject(this);
out.flush();
out.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
The object is an instance of sebbot.learning.DirectPolicySearch class.
The problem is, after some refactoring, the learning package was renamed to 'ballcapture'. Now, when I try to load a saved file, I get the following exception:
java.lang.ClassNotFoundException: sebbot.learning.DirectPolicySearch
The method I use to load the file is:
public static synchronized DirectPolicySearch load(String filename)
{
DirectPolicySearch dps = null;
try
{
FileInputStream fis = new FileInputStream(filename);
GZIPInputStream gzis = new GZIPInputStream(fis);
ObjectInputStream in = new ObjectInputStream(gzis);
dps = (DirectPolicySearch) in.readObject();
in.close();
}
catch (Exception e)
{
e.printStackTrace();
}
System.out.println(dps);
return dps;
}
Can anyone help me with this ? Thanks a lot.