I've deployed a CMP entity bean and created several entities. Now I want to add a field to the bean.
When I restart JBoss and deploy the new version of the bean, an exception is thrown when JBoss goes to retrieve the currently persisted (older version) beans from the database. How can I get around this? Is there some way to tell JBoss to ignore the new fields when loading those entities for the first time? Is there a way to have JBoss add columns to the database?
The exception that gets thrown currently is like this:
javax.ejb.EJBException: Load failed; CausedByException is: Column not found: NEWFIELD in statement <snip...>
javax.ejb.EJBException: Internal error getting results for field member myField; CausedByException is: Unable to load to deserialize result: java.io.InvalidClassException: my.package.MyClass; local class incompatible: stream classdesc serialVersionUID = 2378131147583431167, local class serialVersionUID = 663476389263984086
you may try to tell jboss to update your tables:
Should the persistence manager attempt to update the table structure at deployment
The remove-table element must be one of the two following:
ELEMENT alter-table (#PCDATA)