java.lang.UnsupportedOperationException when querying via API
Closed this issue ยท 0 comments
danielkastner commented
I just noticed that my code for NzbKing causes an bug when querying via API ๐
Reason is that Javas Map.of(...)
creates an immutable Map which leads to an java.lang.UnsupportedOperationException
when transforming the response:
2024-08-15 16:09:53.852 ERROR --- [http-nio-0.0.0.0-5] org.nzbhydra.api.ExternalApi : [ID: 62415, Host: 89.58.30.215] Unexpected error while handling API request
java.lang.UnsupportedOperationException: null
at java.base@22.0.1/java.util.ImmutableCollections.uoe(ImmutableCollections.java:142)
at java.base@22.0.1/java.util.ImmutableCollections$AbstractImmutableMap.put(ImmutableCollections.java:1079)
at org.nzbhydra.api.NewznabJsonTransformer.buildRssItem(NewznabJsonTransformer.java:87)
at org.nzbhydra.api.NewznabJsonTransformer.transformToRoot(NewznabJsonTransformer.java:66)
at org.nzbhydra.api.ExternalApi.transformResults(ExternalApi.java:315)
at org.nzbhydra.api.ExternalApi.search(ExternalApi.java:273)
at org.nzbhydra.api.ExternalApi.api(ExternalApi.java:181)
at org.nzbhydra.auth.HydraAnonymousAuthenticationFilter.doFilter(HydraAnonymousAuthenticationFilter.java:101) [19 skipped]
at org.nzbhydra.auth.AsyncSupportFilter.doFilterInternal(AsyncSupportFilter.java:35) [2 skipped]
at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:100) [12 skipped]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107) [20 skipped]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:93)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62) [14 skipped]
at org.nzbhydra.auth.ForwardedForRecognizingFilter.doFilterInternal(ForwardedForRecognizingFilter.java:37) [9 skipped]
at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) [4 skipped]
at org.nzbhydra.auth.HydraEmbeddedServletContainer$1.invoke(HydraEmbeddedServletContainer.java:91) [22 skipped]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391) [4 skipped]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
at java.base@22.0.1/java.lang.Thread.runWith(Thread.java:1583) [5 skipped]
at java.base@22.0.1/java.lang.Thread.run(Thread.java:1570)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:853)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:829)
Sorry for the trouble ๐ Fix will be there as soon as I have an issue number for referencing in the branch