sometimes we see following error in log files.
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.openjpa.enhance.Reflection.set(Reflection.java:696)
at org.apache.openjpa.kernel.ObjectIdStateManager.setValue(ObjectIdStateManager.java:736)
at org.apache.openjpa.kernel.ObjectIdStateManager.store(ObjectIdStateManager.java:507)
at org.apache.openjpa.jdbc.meta.strats.EmbedValueHandler.toObjectValue(EmbedValueHandler.java:168)
at org.apache.openjpa.jdbc.meta.strats.ObjectIdValueHandler.toObjectValue(ObjectIdValueHandler.java:77)
at org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy.getPrimaryKeyValue(HandlerFieldStrategy.java:330)
at org.apache.openjpa.jdbc.meta.ClassMapping.getObjectId(ClassMapping.java:188)
at org.apache.openjpa.jdbc.meta.ClassMapping.getObjectId(ClassMapping.java:147)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:976)
at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:278)
at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2415)
at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:272)
at org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:59)
at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36)
at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1228)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:990)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:848)