V
VisionSet
Fresh compile
clean out the database
objects persisted to database okay
objects retrieved from database okay using the below code.
Then I terminate my java server and client, restart and I get an
EOFException in the below deserialisation. I understand this is because the
runtime can't find a compatible class definition - but it hasn't changed -
it is running the same code!
I am manually deserialising because I couldn't get autoDeserialize=true to
work in MySQL apparantly because the driver could not see my persisted
objects class on the classpath. Perhaps I've been lucky with classpath
issues in the past, but I don't know how to make ConnectorJ see my classes -
how do I do this?
private static Game deserializeGame(ResultSet rs) throws SQLException {
byte[] byteArray = (byte[]) rs.getObject(GameDB.Col.GAME);
try {
return (Game) new ObjectInputStream(
new ByteArrayInputStream(byteArray)).readObject();
}
catch (ClassNotFoundException cnfe) {
throw new RuntimeException(cnfe);
}
catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
TIA
clean out the database
objects persisted to database okay
objects retrieved from database okay using the below code.
Then I terminate my java server and client, restart and I get an
EOFException in the below deserialisation. I understand this is because the
runtime can't find a compatible class definition - but it hasn't changed -
it is running the same code!
I am manually deserialising because I couldn't get autoDeserialize=true to
work in MySQL apparantly because the driver could not see my persisted
objects class on the classpath. Perhaps I've been lucky with classpath
issues in the past, but I don't know how to make ConnectorJ see my classes -
how do I do this?
private static Game deserializeGame(ResultSet rs) throws SQLException {
byte[] byteArray = (byte[]) rs.getObject(GameDB.Col.GAME);
try {
return (Game) new ObjectInputStream(
new ByteArrayInputStream(byteArray)).readObject();
}
catch (ClassNotFoundException cnfe) {
throw new RuntimeException(cnfe);
}
catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
TIA