Skip to content

fix(explore): make RdfSource serializable and answer a missing id plainly - #775

Merged
tkuhn merged 1 commit into
masterfrom
fix/explore-page-not-serializable
Oct 9, 2026
Merged

tkuhn merged 1 commit into
masterfrom
fix/explore-page-not-serializable

Conversation

@tkuhn

@tkuhn tkuhn commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What was wrong

The "Status:" line on /explore never resolved — nor did any other panel the page loads over Ajax. It was not about any particular nanopublication: get-newer-versions-of-np answers in under 0.4 s on all healthy query instances, and the spinner kept turning for every nanopublication I tried.

Each request on nanodash.knowledgepixels.com (5.17.0) logged, in this order:

ERROR JavaSerializer - Error serializing object class com.knowledgepixels.nanodash.page.ExplorePage
Caused by: java.io.NotSerializableException: com.knowledgepixels.nanodash.page.RdfSource
IllegalArgumentException: Argument 'data' may not be null
    at SerializedPage.<init> / SerializingPageStore.addPage

so the page never reached the page store. The follow-up Ajax request found nothing stored and re-instantiated the page without its parameters:

WicketRuntimeException: Can't instantiate page using constructor
    'public com.knowledgepixels.nanodash.page.ExplorePage(PageParameters)' and argument ''
Caused by: java.lang.NullPointerException: Cannot invoke "String.replaceFirst(String, String)"
    because "tempRef" is null

which answered the Ajax channel with a 500 and <redirect>./error/500</redirect>. In today's Tomcat access log, 320 of 356 explore Ajax requests were answered that way.

RdfSource is the record ExplorePage has kept in a field since #710 (commit 6afa221), released in 5.16.0 — so the regression has been out since then.

What this changes

  • RdfSource implements Serializable. A page field has to be; the nanopublications it carries already are (NanopubImpl).
  • An explore request without an id is answered as a 400 rather than failing as a server error, which also covers a stale link. This follows what CalendarFeedPage already does for a missing space.

Tests

RdfSourceTest#survivesPageSerialization and ExplorePageTest#anExploreRequestWithoutAnIdIsRejected. Each one fails without its fix, with exactly the error from production above.

🤖 Generated with Claude Code

…inly

The Explore page's status line, and every other panel it loads over Ajax,
kept spinning forever. Each request logged

  ERROR JavaSerializer - Error serializing object class ...ExplorePage
  Caused by: java.io.NotSerializableException: ...page.RdfSource
  IllegalArgumentException: Argument 'data' may not be null
      at SerializedPage.<init> / SerializingPageStore.addPage

so the page never reached the page store. The follow-up Ajax request then
found nothing stored and re-instantiated the page without its parameters:

  WicketRuntimeException: Can't instantiate page using constructor
      'public ...ExplorePage(PageParameters)' and argument ''
  Caused by: NullPointerException: Cannot invoke
      "String.replaceFirst(String, String)" because "tempRef" is null

which answered the Ajax channel with a 500. On nanodash.knowledgepixels.com
320 of 356 explore Ajax requests were answered that way today.

RdfSource is the record ExplorePage has kept in a field since #710, and a
page field has to be serializable, so it now is -- the nanopublications it
carries already are. An explore request without an 'id' is answered as a bad
request rather than failing as a server error, which also covers a stale link.

Both tests fail without their fix, with the two errors above.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tkuhn
tkuhn merged commit 270db2a into master Oct 9, 2026
8 checks passed
@tkuhn
tkuhn deleted the fix/explore-page-not-serializable branch October 9, 2026 11:37
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.17.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant