java.lang.ArrayIndexOutOfBoundsException: 22
at io.ebean.bean.EntityBeanIntercept.isLoadedProperty(EntityBeanIntercept.java:547)
at io.ebean.bean.EntityBeanIntercept.preGetter(EntityBeanIntercept.java:938)
--
---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/a8b6130d-f203-4f5c-a438-266d2e25556f%40googlegroups.com.
@Entity
public class TestModel {
public static Finder<Integer, TestModel> finder = new Finder<>(TestModel.class);
@Id
Integer id;
String field1;
...
}
FSTConfiguration fst = FSTConfiguration.createDefaultConfiguration();
Path target = Paths.get("model_v1.log");
TestModel model = TestModel.finder.byId(id);
byte[] bb = fst.asByteArray(model);
Files.write(target, bb);
@Entity
public class TestModel {
public static Finder<Integer, TestModel> finder = new Finder<>(TestModel.class, ChargeToolApplication.DB_NAME);
@Id
Integer id;
String field1;
@org.nustaq.serialization.annotations.Version(1)
String field2;
...
}
FSTConfiguration fst = FSTConfiguration.createDefaultConfiguration();
Path target = Paths.get("model_v1.log");
byte[] bb = Files.readAllBytes(target);
TestModel model = (TestModel) fst.asObject(bb);
System.out.println(model.getField1());
System.out.println(model.getField2()); // --> it will throw Exception
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
at io.ebean.bean.EntityBeanIntercept.isLoadedProperty(EntityBeanIntercept.java:547)
at io.ebean.bean.EntityBeanIntercept.preGetter(EntityBeanIntercept.java:938)
at soda.charge.tool.vm.TestModel._ebean_get_field2(TestModel.java:6)
at soda.charge.tool.vm.TestModel.getField2(TestModel.java:41)
You might want to create a test case?
On Wed, 20 May 2020 at 01:39, xc s <pep...@gmail.com> wrote:
Hello,--I run two spring application: app1 & app2, model object cached share in redis.Then I add a new field to model object and upgrade app2 and fresh model object cache.Now I load model object in app1, will throw ArrayIndexOutOfBoundsException, like this:java.lang.ArrayIndexOutOfBoundsException: 22
at io.ebean.bean.EntityBeanIntercept.isLoadedProperty(EntityBeanIntercept.java:547)
at io.ebean.bean.EntityBeanIntercept.preGetter(EntityBeanIntercept.java:938)How to avoid this issue? I think may be return null if index is over the array.My ebean version is 12.1.8.ThanksXc
---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eb...@googlegroups.com.