Skip to content

Make PrecursorKey serializable for ehCache compatibility - #1283

Closed
labkey-tchad wants to merge 1 commit into
developfrom
fb_serializePrecursorKey
Closed

labkey-tchad wants to merge 1 commit into
developfrom
fb_serializePrecursorKey

Conversation

@labkey-tchad

Copy link
Copy Markdown
Member

Rationale

After upgrade ehCache, TargetedMSSkydTextIdTest is encountering errors in PrecursorChromatogramChartAction. ehCache version 2.6.11 seems to be more strict about having serializable cache keys. Making LibrarySpectrumMatchGetter.PrecursorKey explicitly serializable fixes the error.

Stacktrace

net.sf.ehcache.CacheException: The key org.labkey.targetedms.view.spectrum.LibrarySpectrumMatchGetter$PrecursorKey@dad1e39e is not Serializable. Consider using Element.getObjectKey()
	at net.sf.ehcache.Element.getKey(Element.java:256)
	at net.sf.ehcache.store.MemoryStore.evict(MemoryStore.java:853)
	at net.sf.ehcache.store.NotifyingMemoryStore.evict(NotifyingMemoryStore.java:60)
	at net.sf.ehcache.store.MemoryStore.removeElementChosenByEvictionPolicy(MemoryStore.java:596)
	at net.sf.ehcache.store.MemoryStore.checkCapacity(MemoryStore.java:562)
	at net.sf.ehcache.store.MemoryStore.put(MemoryStore.java:262)
	at net.sf.ehcache.store.FrontEndCacheTier.put(FrontEndCacheTier.java:267)
	at net.sf.ehcache.Cache.putInternal(Cache.java:1455)
	at net.sf.ehcache.Cache.put(Cache.java:1383)
	at net.sf.ehcache.Cache.put(Cache.java:1348)
	at org.labkey.api.cache.ehcache.EhSimpleCache.put(EhSimpleCache.java:48)
	at org.labkey.api.cache.CacheWrapper.put(CacheWrapper.java:65)
	at org.labkey.api.cache.BlockingCache.get(BlockingCache.java:114)
	at org.labkey.api.cache.BlockingCache.get(BlockingCache.java:90)
	at org.labkey.targetedms.view.spectrum.LibrarySpectrumMatchGetter.getPeptideIdRts(LibrarySpectrumMatchGetter.java:302)
	at org.labkey.targetedms.chart.ChromatogramDataset$PrecursorDataset.getPeptideIdRetentionTimes(ChromatogramDataset.java:917)
	at org.labkey.targetedms.chart.ChromatogramDataset$PrecursorDataset.build(ChromatogramDataset.java:892)
	at org.labkey.targetedms.chart.ChromatogramChartMaker.make(ChromatogramChartMaker.java:91)
	at org.labkey.targetedms.chart.ChromatogramChartMaker.make(ChromatogramChartMaker.java:86)
	at org.labkey.targetedms.chart.ChromatogramChartMakerFactory.createPrecursorChromChart(ChromatogramChartMakerFactory.java:91)
	at org.labkey.targetedms.TargetedMSController$PrecursorChromatogramChartAction.export(TargetedMSController.java:2131)
	at org.labkey.targetedms.TargetedMSController$PrecursorChromatogramChartAction.export(TargetedMSController.java:2106)

Related Pull Requests

Changes

  • Make PrecursorKey serializable for ehCache compatibility

@labkey-susanh labkey-susanh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thank you!

@labkey-tchad

Copy link
Copy Markdown
Member Author

I think this is working around a regression in ehCache. Going to update ehCache (or roll back to an earlier version) rather than merge this and risk a similar error elsewhere.

@labkey-tchad
labkey-tchad deleted the fb_serializePrecursorKey branch September 16, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants