Opened 9 years ago

Closed 9 years ago

#1915 closed defect (fixed)

List page breaks when snapshot contains deleted annotation

Reported by: Nicklas Nordborg Owned by: everyone
Priority: minor Milestone: BASE 3.4.1
Component: core Version:
Keywords: Cc:

Description

The extracts list page failed to load correctly. It was just aborted in the middle and no error messages in the log. After adding some debug code I got:

net.sf.basedb.core.ItemNotFoundException: Item not found: AnnotationType[id=103]
	at net.sf.basedb.core.AnnotationType.getById(AnnotationType.java:118)
	at net.sf.basedb.core.snapshot.AnnotationSnapshot.getAnnotationType(AnnotationSnapshot.java:250)
	at net.sf.basedb.core.snapshot.AnnotationSnapshot.hasPermission(AnnotationSnapshot.java:188)
	at net.sf.basedb.core.snapshot.SnapshotManager.findAnnotations(SnapshotManager.java:187)
	at net.sf.basedb.core.snapshot.AnnotationLoaderUtil.findAll(AnnotationLoaderUtil.java:152)
	at net.sf.basedb.core.snapshot.AnnotationLoaderUtil.find(AnnotationLoaderUtil.java:142)
	at org.apache.jsp.biomaterials.extracts.list_005fextracts_jsp._jspService(list_005fextracts_jsp.java:2834)

There is no annotation type with id 103 but it seems like a reference is still found in one snapshot file. Don't know exactly how this could happen since an annotation type can't be deleted if it is used and if it is not used it should not appear in a snapshot file. My best guess is that it is a leftover snapshot file from a different BASE installation. In any case, it would be nice if the code was more stable.

Change History (1)

comment:1 by Nicklas Nordborg, 9 years ago

Resolution: fixed
Status: newclosed

(In [6710]) Fixes #1915: List page breaks when snapshot contains deleted annotation

Now check if an annotation matches the filter before the permission check. Also make the permission check more robust against unexpected exceptions.

Note: See TracTickets for help on using tickets.