Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Ticket #1604 (closed defect: fixed)

Opened 9 months ago

Last modified 8 months ago

ConversionException during deserialization of a saved cohort definition

Reported by: jmiranda Assigned to: luzhuangwei
Priority: blocker Milestone:
Component: OpenMRS Code Base Keywords:
Cc: bwolfe, mseaton, djazayeri Introductory Ticket: 0
Code Review Status:

Description

Mike recommended that I switch back to using the openmrs 1.5 branch. Upon doing so, the LazyInitializationException was resolved (yay!), but there's a new issue that occurs during the deserialization of a saved cohort definition. See the stacktrace.

Attachments

stacktrace-ConversionException-during-deserialization-of-Patient-CharacteristicCohortDefinition.txt (10.1 kB) - added by jmiranda on 06/29/09 21:07:04.
stacktrace-1604-from-log-file.txt (26.6 kB) - added by jmiranda on 06/29/09 21:22:50.
full stacktrace from catalina.out
stacktrace-1604-using-xstream-1.3.1-jar.txt (16.4 kB) - added by jmiranda on 06/30/09 18:11:20.
stacktrace for com.thoughtworks.xstream.mapper.CannotResolveClassException: org.openmrs.User$$EnhancerByCGLIB$$fff1cb7d

Change History

06/29/09 21:07:04 changed by jmiranda

  • attachment stacktrace-ConversionException-during-deserialization-of-Patient-CharacteristicCohortDefinition.txt added.

06/29/09 21:07:21 changed by jmiranda

  • summary changed from ConverterException during deserialization of a saved cohort definition to ConversionException during deserialization of a saved cohort definition.

06/29/09 21:22:50 changed by jmiranda

  • attachment stacktrace-1604-from-log-file.txt added.

full stacktrace from catalina.out

06/30/09 01:58:27 changed by luzhuangwei

Hmm, i think the reason is that in branch 1.5.x, the xstream's jar file is old. we should convert from xstream-1.3.jar to xstream-1.3.1.jar in its directory.

Because, in xstrema-1.3.jar, it can not deal with CGLIB-enhanced-proxy's deserialization.

06/30/09 18:11:20 changed by jmiranda

  • attachment stacktrace-1604-using-xstream-1.3.1-jar.txt added.

stacktrace for com.thoughtworks.xstream.mapper.CannotResolveClassException: org.openmrs.User$$EnhancerByCGLIB$$fff1cb7d

06/30/09 18:16:54 changed by jmiranda

  • cc changed from bwolfe, jmiranda to bwolfe, mseaton, djazayeri.

OpenMRS Version: 1.5.0 beta2 Build 8803

I added the xstream-1.3.1.jar to my local openmrs-branches-1.5.x workspace, ran a clean build, and deployed the new WAR to Tomcat. I was able to save, retrieve, edit a few cohort definitions (serialization and deserialization was working fine). Then on restart of Tomcat, the exception above is thrown on any request that tries to deserialize the cohort definitions that were saved.

I assume this is due to the fact that the classpath has been refreshed and the class org.openmrs.User$$EnhancerByCGLIB$$fff1cb7d no longer exists. We need to make sure all proxy class references are converted back to openmrs classes during serialization.

Please let me know when that is done in the 1.5.x branch.

Thanks,

Justin

07/01/09 04:18:45 changed by luzhuangwei

Thanks, Justin

In fact, serialization framework in serialization branch will convert every proxy class reference back to openmrs class during serialization. This work has been done in both serialization branch and openmrs trunk 1.5

But, now the only problem is remain that you have described in ticket #1588, In reporting module, while xstream serializer want to convert proxy class reference to openmrs class, it can not get the session and throw an LazyInitializationException.

I think if we can resolve this problem, this problem will no longer exist.

07/27/09 14:39:49 changed by bwolfe

  • status changed from new to closed.
  • resolution set to fixed.

I assume this was cleared up with the serialization.xstream module having all updated serialization code.