ObjectDB ObjectDB

Issue #1131: Enhanced classes problem

Type: Bug ReoprtPriority: HighStatus: FixedReplies: 13
#1

Hell,

we have problem with the OEM enhancement licencing. When we used runtime licencing using machine activation code,

everything works fine. But when we enhanced our classes with OEM licence, following errors occurs:

Caused by: com.objectdb.o._PersistenceException: Failed to set reference value of field field eu.ysoft.safeq.core.cache.entity.CacheableJobStat.jais using enhanced method
at com.objectdb.o._PersistenceException.b(_PersistenceException.java:45)
at com.objectdb.o.JPE.g(JPE.java:142)
at com.objectdb.o.ERR.f(ERR.java:60)
at com.objectdb.o.OBC.onObjectDBError(OBC.java:1513)
at com.objectdb.o.ENT.aj(ENT.java:1629)
at com.objectdb.o.ENT.beforeAccess(ENT.java:1123)
at eu.ysoft.safeq.core.cache.entity.CacheableJobStat.__odbGet_jobId(CacheableJobStat.java:1)
at eu.ysoft.safeq.core.cache.entity.CacheableJobStat.toString(CacheableJobStat.java:136)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuilder.append(Unknown Source)
at eu.ysoft.cache.replicator.ReplicatorImpl.addForReplication(ReplicatorImpl.java:326)
at eu.ysoft.cache.replicator.ReplicatorImpl.handleCacheEvent(ReplicatorImpl.java:217)
at eu.ysoft.cache.AbstractCacheDB.fireEvent(AbstractCacheDB.java:18)
at com.ysoft.cache.objectdb.ObjectCacheDB.createInNewTransaction(ObjectCacheDB.java:201)
at com.ysoft.cache.objectdb.ObjectCacheDB.create(ObjectCacheDB.java:177)
at eu.ysoft.safeq.ors.CacheDBWrapper.create(CacheDBWrapper.java:63)
at ysoft.sqcore.job.CacheJobManager.createReplicationMark(CacheJobManager.java:535)
at eu.ysoft.safeq.core.scheduler.ReplicationMarkerGeneratorJob.execute(ReplicationMarkerGeneratorJob.java:36)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
... 1 more
Caused by: com.objectdb.o.UserException: Failed to set reference value of field field eu.ysoft.safeq.core.cache.entity.CacheableJobStat.jais using enhanced method
at com.objectdb.o.MSG.d(MSG.java:74)
at com.objectdb.o.UMR.P(UMR.java:925)
at com.objectdb.o.UMR.D(UMR.java:679)
at com.objectdb.o.UMR.u(UMR.java:485)
at com.objectdb.o.MMM.ae(MMM.java:1009)
at com.objectdb.o.ENH.c(ENH.java:136)
at com.objectdb.o.ENH.b(ENH.java:111)
at com.objectdb.o.LDR.J(LDR.java:796)
at com.objectdb.o.LDR.UW(LDR.java:1023)
at com.objectdb.o.MST.aT(MST.java:508)
at com.objectdb.o.MST.aS(MST.java:434)
at com.objectdb.o.MST.U3(MST.java:407)
at com.objectdb.o.WRA.U3(WRA.java:249)
at com.objectdb.o.LDR.F(LDR.java:532)
at com.objectdb.o.LDR.E(LDR.java:466)
at com.objectdb.o.OBC.UJ(OBC.java:1102)
at com.objectdb.o.OBC.aK(OBC.java:795)
at com.objectdb.o.ENT.beforeAccess(ENT.java:1115)
... 14 more
Caused by: java.lang.ClassCastException: eu.ysoft.safeq.core.cache.entity.CacheableJobAccountingInfo cannot be cast to [Leu.ysoft.safeq.core.cache.entity.CacheableJobAccountingInfo;
at eu.ysoft.safeq.core.cache.entity.CacheableJobStat.__odbSetMember(CacheableJobStat.java:1)
at com.objectdb.o.UMR.E(UMR.java:692)
at com.objectdb.o.UMR.D(UMR.java:676)
... 29 more

We really need help with this, because we have already spent much time with the OEM licencing and we are really confused with this.

Thanks

Marta

 

 

edit
delete
#2

We will try to help, but are you sure that this is related to the OEM enhancement? It is strange because OEM enhancement and non OEM enhancement are the same, except the license check, which cannot cause this exception.

ObjectDB Support
edit
delete
#3

The stack trace indicates an attempt to load a CacheableJobAccountingInfo[] array into a CacheableJobAccountingInfo field. Do you have a field that changed its type from CacheableJobAccountingInfo to CacheableJobAccountingInfo[]?

ObjectDB Support
edit
delete
#4

I would like to avoid misunderstanding.

The problem maybe occurs also when using non OEM enhancement.

I ment that without using enhancer, everything works fine.

But using it, we are facing this exceptions.

Marta

edit
delete
#5

Regarding the field CacheableJobAccountingInfo[]. No it has not been changed.

edit
delete
#6

Could you please check your application with the last build of ObjectDB (2.5.0_05)?

If you still get an exception, please post the stack trace of that exception.

ObjectDB Support
edit
delete
#7

We have checked our application with the ObjectDB (2.5.0_05), but the problem is still the same:

 

2013/05/23 09:25:26.152 | 2013-05-23 11:25:26,066 ERROR mpleThreadPoolWorker-4|            JobRunShell| Job DEFAULT.ReplicationMarkerGenerator-startup threw an unhandled Exception:
2013/05/23 09:25:26.154 | [ObjectDB 2.5.0_05] javax.persistence.PersistenceException
2013/05/23 09:25:26.156 | Failed to set reference value of field field eu.ysoft.safeq.core.cache.entity.CacheableJobStat.jais using enhanced method (error 362)
2013/05/23 09:25:26.158 |       at eu.ysoft.safeq.core.cache.entity.CacheableJobStat.__odbGet_jobId(CacheableJobStat.java:1)
2013/05/23 09:25:26.160 |       at eu.ysoft.safeq.core.cache.entity.CacheableJobStat.toString(CacheableJobStat.java:136)
2013/05/23 09:25:26.162 |       at java.lang.String.valueOf(String.java:2826)
2013/05/23 09:25:26.164 |       at java.lang.StringBuilder.append(StringBuilder.java:115)
2013/05/23 09:25:26.166 |       at eu.ysoft.cache.replicator.ReplicatorImpl.addForReplication(ReplicatorImpl.java:326)
2013/05/23 09:25:26.168 |       at eu.ysoft.cache.replicator.ReplicatorImpl.handleCacheEvent(ReplicatorImpl.java:217)
2013/05/23 09:25:26.170 |       at eu.ysoft.cache.AbstractCacheDB.fireEvent(AbstractCacheDB.java:18)
2013/05/23 09:25:26.172 |       at com.ysoft.cache.objectdb.ObjectCacheDB.createInNewTransaction(ObjectCacheDB.java:201)
2013/05/23 09:25:26.173 |       at com.ysoft.cache.objectdb.ObjectCacheDB.create(ObjectCacheDB.java:177)
2013/05/23 09:25:26.176 |       at eu.ysoft.safeq.ors.CacheDBWrapper.create(CacheDBWrapper.java:63)
2013/05/23 09:25:26.177 |       at ysoft.sqcore.job.CacheJobManager.createReplicationMark(CacheJobManager.java:535)
2013/05/23 09:25:26.180 |       at eu.ysoft.safeq.core.scheduler.ReplicationMarkerGeneratorJob.execute(ReplicationMarkerGeneratorJob.java:36)
2013/05/23 09:25:26.182 |       at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
2013/05/23 09:25:26.184 |       at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
2013/05/23 09:25:26.186 | Caused by: com.objectdb.o.UserException: Failed to set reference value of field field eu.ysoft.safeq.core.cache.entity.CacheableJobStat.jais using enhanced method
2013/05/23 09:25:26.188 |       at com.objectdb.o.MSG.d(MSG.java:74)
2013/05/23 09:25:26.190 |       at com.objectdb.o.UMR.P(UMR.java:925)
2013/05/23 09:25:26.192 |       at com.objectdb.o.UMR.D(UMR.java:679)
2013/05/23 09:25:26.194 |       at com.objectdb.o.UMR.u(UMR.java:485)
2013/05/23 09:25:26.196 |       at com.objectdb.o.MMM.ae(MMM.java:1014)
2013/05/23 09:25:26.198 |       at com.objectdb.o.ENH.c(ENH.java:136)
2013/05/23 09:25:26.200 |       at com.objectdb.o.ENH.b(ENH.java:111)
2013/05/23 09:25:26.202 |       at com.objectdb.o.LDR.J(LDR.java:796)
2013/05/23 09:25:26.204 |       at com.objectdb.o.LDR.UW(LDR.java:1023)
2013/05/23 09:25:26.206 |       at com.objectdb.o.MST.aU(MST.java:508)
2013/05/23 09:25:26.208 |       at com.objectdb.o.MST.aT(MST.java:434)
2013/05/23 09:25:26.210 |       at com.objectdb.o.MST.U3(MST.java:407)
2013/05/23 09:25:26.212 |       at com.objectdb.o.WRA.U3(WRA.java:251)
2013/05/23 09:25:26.214 |       at com.objectdb.o.LDR.F(LDR.java:532)
2013/05/23 09:25:26.216 |       at com.objectdb.o.LDR.E(LDR.java:466)
2013/05/23 09:25:26.218 |       at com.objectdb.o.OBC.UJ(OBC.java:1073)
2013/05/23 09:25:26.219 |       at com.objectdb.o.OBC.aK(OBC.java:763)
2013/05/23 09:25:26.222 |       at com.objectdb.o.ENT.beforeAccess(ENT.java:1115)
2013/05/23 09:25:26.224 |       ... 14 more
2013/05/23 09:25:26.225 | Caused by: java.lang.ClassCastException: eu.ysoft.safeq.core.cache.entity.CacheableJobAccountingInfo cannot be cast to [Leu.ysoft.safeq.core.cache.entity.CacheableJobAccountingInfo;
2013/05/23 09:25:26.227 |       at eu.ysoft.safeq.core.cache.entity.CacheableJobStat.__odbSetMember(CacheableJobStat.java:1)
2013/05/23 09:25:26.230 |       at com.objectdb.o.UMR.E(UMR.java:692)
2013/05/23 09:25:26.231 |       at com.objectdb.o.UMR.D(UMR.java:676)
2013/05/23 09:25:26.233 |       ... 29 more
2013/05/23 09:25:26.235 | 2013-05-23 11:25:26,067 ERROR mpleThreadPoolWorker-4|            ErrorLogger| Job (DEFAULT.ReplicationMarkerGenerator-startup threw an exception.
2013/05/23 09:25:26.237 | org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: com.objectdb.o._PersistenceException: Failed to set reference value of field field eu.ysoft.safeq.core.cache.en
tity.CacheableJobStat.jais using enhanced method]
2013/05/23 09:25:26.240 |       at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
2013/05/23 09:25:26.242 |       at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
2013/05/23 09:25:26.244 | Caused by: com.objectdb.o._PersistenceException: Failed to set reference value of field field eu.ysoft.safeq.core.cache.entity.CacheableJobStat.jais using enhanced method
2013/05/23 09:25:26.246 |       at com.objectdb.o._PersistenceException.b(_PersistenceException.java:45)
2013/05/23 09:25:26.248 |       at com.objectdb.o.JPE.g(JPE.java:142)
2013/05/23 09:25:26.250 |       at com.objectdb.o.ERR.f(ERR.java:60)
2013/05/23 09:25:26.252 |       at com.objectdb.o.OBC.onObjectDBError(OBC.java:1484)
2013/05/23 09:25:26.254 |       at com.objectdb.o.ENT.aj(ENT.java:1632)
2013/05/23 09:25:26.256 |       at com.objectdb.o.ENT.beforeAccess(ENT.java:1123)
2013/05/23 09:25:26.258 |       at eu.ysoft.safeq.core.cache.entity.CacheableJobStat.__odbGet_jobId(CacheableJobStat.java:1)
2013/05/23 09:25:26.260 |       at eu.ysoft.safeq.core.cache.entity.CacheableJobStat.toString(CacheableJobStat.java:136)
2013/05/23 09:25:26.262 |       at java.lang.String.valueOf(String.java:2826)
2013/05/23 09:25:26.264 |       at java.lang.StringBuilder.append(StringBuilder.java:115)
2013/05/23 09:25:26.265 |       at eu.ysoft.cache.replicator.ReplicatorImpl.addForReplication(ReplicatorImpl.java:326)
2013/05/23 09:25:26.267 |       at eu.ysoft.cache.replicator.ReplicatorImpl.handleCacheEvent(ReplicatorImpl.java:217)
2013/05/23 09:25:26.269 |       at eu.ysoft.cache.AbstractCacheDB.fireEvent(AbstractCacheDB.java:18)
2013/05/23 09:25:26.271 |       at com.ysoft.cache.objectdb.ObjectCacheDB.createInNewTransaction(ObjectCacheDB.java:201)
2013/05/23 09:25:26.273 |       at com.ysoft.cache.objectdb.ObjectCacheDB.create(ObjectCacheDB.java:177)
2013/05/23 09:25:26.275 |       at eu.ysoft.safeq.ors.CacheDBWrapper.create(CacheDBWrapper.java:63)
2013/05/23 09:25:26.277 |       at ysoft.sqcore.job.CacheJobManager.createReplicationMark(CacheJobManager.java:535)
2013/05/23 09:25:26.279 |       at eu.ysoft.safeq.core.scheduler.ReplicationMarkerGeneratorJob.execute(ReplicationMarkerGeneratorJob.java:36)
2013/05/23 09:25:26.281 |       at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
2013/05/23 09:25:26.283 |       ... 1 more
2013/05/23 09:25:26.285 | Caused by: com.objectdb.o.UserException: Failed to set reference value of field field eu.ysoft.safeq.core.cache.entity.CacheableJobStat.jais using enhanced method
2013/05/23 09:25:26.287 |       at com.objectdb.o.MSG.d(MSG.java:74)
2013/05/23 09:25:26.289 |       at com.objectdb.o.UMR.P(UMR.java:925)
2013/05/23 09:25:26.291 |       at com.objectdb.o.UMR.D(UMR.java:679)
2013/05/23 09:25:26.293 |       at com.objectdb.o.UMR.u(UMR.java:485)
2013/05/23 09:25:26.294 |       at com.objectdb.o.MMM.ae(MMM.java:1014)
2013/05/23 09:25:26.296 |       at com.objectdb.o.ENH.c(ENH.java:136)
2013/05/23 09:25:26.298 |       at com.objectdb.o.ENH.b(ENH.java:111)
2013/05/23 09:25:26.300 |       at com.objectdb.o.LDR.J(LDR.java:796)
2013/05/23 09:25:26.302 |       at com.objectdb.o.LDR.UW(LDR.java:1023)
2013/05/23 09:25:26.304 |       at com.objectdb.o.MST.aU(MST.java:508)
2013/05/23 09:25:26.306 |       at com.objectdb.o.MST.aT(MST.java:434)
2013/05/23 09:25:26.308 |       at com.objectdb.o.MST.U3(MST.java:407)
2013/05/23 09:25:26.310 |       at com.objectdb.o.WRA.U3(WRA.java:251)
2013/05/23 09:25:26.312 |       at com.objectdb.o.LDR.F(LDR.java:532)
2013/05/23 09:25:26.313 |       at com.objectdb.o.LDR.E(LDR.java:466)
2013/05/23 09:25:26.315 |       at com.objectdb.o.OBC.UJ(OBC.java:1073)
2013/05/23 09:25:26.317 |       at com.objectdb.o.OBC.aK(OBC.java:763)
2013/05/23 09:25:26.319 |       at com.objectdb.o.ENT.beforeAccess(ENT.java:1115)
2013/05/23 09:25:26.321 |       ... 14 more
2013/05/23 09:25:26.323 | Caused by: java.lang.ClassCastException: eu.ysoft.safeq.core.cache.entity.CacheableJobAccountingInfo cannot be cast to [Leu.ysoft.safeq.core.cache.entity.CacheableJobAccountingInfo;
2013/05/23 09:25:26.325 |       at eu.ysoft.safeq.core.cache.entity.CacheableJobStat.__odbSetMember(CacheableJobStat.java:1)
2013/05/23 09:25:26.327 |       at com.objectdb.o.UMR.E(UMR.java:692)
2013/05/23 09:25:26.328 |       at com.objectdb.o.UMR.D(UMR.java:676)
2013/05/23 09:25:26.331 |       ... 29 more

 

Do you have any workaround for us?

Thanks

Marta

edit
delete
#8

The cause is unclear yet, but I can confirm that it happens in lazy loading, which is supported only when classes are enhanced. As a workaround, please try to disable this lazy loading by setting the following system property.

In your code before connecting to ObjectDB:

    System.setProperty("objectdb.temp.no-lazy-o2o-inverse", "true");

or as a JVM parameter:

> java -Dobjectdb.temp.no-lazy-o2o-inverse=true ...

Please let me know if it makes any difference.

ObjectDB Support
edit
delete
#9

In order to understand and fix the problem, could you please provide some information about your use of a CacheableJobAccountingInfo[] persistent field? Do you have such a field? Can you post its complete definition, including JPA annotations?

ObjectDB Support
edit
delete
#10

Hello,

disabling lazy loading seems to work, but we have question regarding the impact on performance in case this option is disabled?

We wíll provide you example asap.

Thanks

Marta

edit
delete
#11

We are preparing example, but we are not successfull to simulate problem yet, so just brief info for now:

Info about the field and annotations:

@OneToMany(fetch = FetchType.EAGER, mappedBy = "jobInfoId")  // relation is unidirectional
    private CacheableJobAccountingInfo[] jais;

The class itself contains just several long, int, float and boolean values.

Both CacheableJobAccountingInfo and CacheableJobStat extends same parent class.

 

Marta

edit
delete
#12

We succeeded in reproducing the problem and hope to have a fix soon.

However, please consider replacing CacheableJobAccountingInfo[] with List<CacheableJobAccountingInfo>, which should solve the problem. Using arrays for relationships is non standard (not supported by JPA), rarely used, and usually less efficient.

ObjectDB Support
edit
delete
#13

We were testing our application with the List instead of array and another problem occurs:

 

java.lang.ArrayIndexOutOfBoundsException: -1
at com.objectdb.o.MMM.J(MMM.java:606)
at com.objectdb.o.TYT.b(TYT.java:43)
at com.objectdb.o.EMT.beforeAccess(EMT.java:155)
at eu.ysoft.safeq.core.cache.entity.CacheableDate.writeObject(CacheableDate.java:1)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:188)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1007)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:885)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1063)
at org.jboss.marshalling.river.RiverObjectOutputStream.defaultWriteObject(RiverObjectOutputStream.java:159)
at eu.ysoft.safeq.core.cache.entity.CacheableJobStat.writeObject(CacheableJobStat.java:1)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:188)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1007)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:885)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1063)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:885)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:585)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1063)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:885)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1063)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1019)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:885)
at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62)
at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:119)
at eu.ysoft.communicator.protocols.river.RiverSerializer.serialize(RiverSerializer.java:36)
at eu.ysoft.communicator.BMCMessagingPort.externalizeMessage(BMCMessagingPort.java:619)
at eu.ysoft.communicator.BMCMessagingPort.send(BMCMessagingPort.java:587)
at eu.ysoft.communicator.MessagingThread.processOperation(MessagingThread.java:423)
at eu.ysoft.communicator.MessagingThread.run(MessagingThread.java:297)
at java.lang.Thread.run(Unknown Source)
Caused by: an exception which occurred:
in field date
in field entity
in field replicas
in field replicas

 

Could you please provide us some help?

CacheableDate is Embedded entity.

Marta

edit
delete
#14

Build 2.5.0_06 should fix both problems:

  • Array ([]) relationship are now always excluded from this optimization because of technical limitation (an array cannot be represented  by a proxy object as a Java collection). Anyway, this should not affect you if you already switched to List.
  • The exception in #13 should not be thrown.

Please note that the ability to load mapped by relationships in bulk, which these reports are related to, are still new in ObjectDB (added in version 2.4.5), so unfortunately you may still have issues after this fix. Please open a new issue for each new problem that you see.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.