Skip to content

Fix BeanInstantiationException when searching for blacklisted entities#1649

Merged
ppavlidis merged 2 commits into
hotfix-1.32.7from
copilot/fix-blacklisted-entity-search-error
Apr 28, 2026
Merged

Fix BeanInstantiationException when searching for blacklisted entities#1649
ppavlidis merged 2 commits into
hotfix-1.32.7from
copilot/fix-blacklisted-entity-search-error

Conversation

Copilot AI commented Apr 27, 2026

Copy link
Copy Markdown

Searching for a blacklisted accession (e.g. GSE112631) surfaced a BeanInstantiationException to the user because DatabaseSearchSource registers results under the abstract BlacklistedEntity.class type, and EntityUrlChooser.entity(Class<T>, Long) blindly called BeanUtils.instantiate() on it. Since getResultObjectUrlSafely only catches UnsupportedEntityUrlException, the error escaped to the UI.

Changes

  • EntityUrlBuilder.EntityUrlChooser.entity(Class<T>, Long) — guard against abstract types upfront with Modifier.isAbstract(), throwing UnsupportedEntityUrlException instead of letting BeanUtils.instantiate blow up:
if ( Modifier.isAbstract( entityType.getModifiers() ) ) {
    throw new UnsupportedEntityUrlException(
        "Cannot generate a URL for abstract entity type " + entityType.getSimpleName() + ".", entityType );
}
  • EntityUrlBuilderTest — adds testAbstractEntityType() covering this path with BlacklistedEntity.class.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • maven2.pavlab.msl.ubc.ca
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Gemma/Gemma org.codehaus.plexus.classworlds.launcher.Launcher -pl gemma-core test -Dtest=EntityUrlBuilderTest -q (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

…tract types in EntityUrlBuilder

Agent-Logs-Url: https://github.com/PavlidisLab/Gemma/sessions/e530df81-06df-47bf-8279-d09d604b7ed3

Co-authored-by: ppavlidis <206415+ppavlidis@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error when searching for a blacklisted entity Fix BeanInstantiationException when searching for blacklisted entities Apr 27, 2026
Copilot AI requested a review from ppavlidis April 27, 2026 22:44
@ppavlidis ppavlidis marked this pull request as ready for review April 28, 2026 00:35
@ppavlidis ppavlidis merged commit 1f407d2 into hotfix-1.32.7 Apr 28, 2026
2 checks passed
@ppavlidis ppavlidis deleted the copilot/fix-blacklisted-entity-search-error branch June 8, 2026 00:13
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.

error when searching for a blacklisted entity

2 participants