Reminder: Create & find trunk-related issues here. Legacy Trac tickets are still available. Problems? Workflow feedback? Need a module project? Open a support ticket.

OpenMRS Trunk

ConversionException during deserialization of a saved cohort definition

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Severity:
    3
  • Keywords:
  • 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.

  1. stacktrace-1604-from-log-file.txt
    (27 kB)
    Burke Mamlin
    2009-06-29 21:22:50 EDT
  2. stacktrace-1604-using-xstream-1.3.1-jar.txt
    (16 kB)
    Burke Mamlin
    2009-06-30 18:11:20 EDT
  3. stacktrace-ConversionException-during-deserialization-of-Patient-CharacteristicCohortDefinition.txt
    (10 kB)
    Burke Mamlin
    2009-06-29 21:07:04 EDT

Issue Links

Activity

Hide
Justin Miranda added a comment - 2009-06-29 21:22:50 EDT

full stacktrace from catalina.out

Show
Justin Miranda added a comment - 2009-06-29 21:22:50 EDT full stacktrace from catalina.out
Hide
Zhuangwei Lu added a comment - 2009-06-30 01:58:27 EDT

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.

Show
Zhuangwei Lu added a comment - 2009-06-30 01:58:27 EDT 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.
Hide
Justin Miranda added a comment - 2009-06-30 18:11:20 EDT

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

Show
Justin Miranda added a comment - 2009-06-30 18:11:20 EDT stacktrace for com.thoughtworks.xstream.mapper.CannotResolveClassException: org.openmrs.User$$EnhancerByCGLIB$$fff1cb7d
Hide
Justin Miranda added a comment - 2009-06-30 18:16:54 EDT

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

Show
Justin Miranda added a comment - 2009-06-30 18:16:54 EDT 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
Hide
Zhuangwei Lu added a comment - 2009-07-01 04:18:45 EDT

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 TRAC-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.

Show
Zhuangwei Lu added a comment - 2009-07-01 04:18:45 EDT 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 TRAC-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.
Hide
Ben Wolfe added a comment - 2009-07-27 14:39:49 EDT

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

Show
Ben Wolfe added a comment - 2009-07-27 14:39:49 EDT I assume this was cleared up with the serialization.xstream module having all updated serialization code.

People

Dates

  • Created:
    2009-06-29 21:06:42 EDT
    Updated:
    2010-07-09 01:19:33 EDT
    Resolved:
    2010-07-01 22:44:21 EDT