Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.UnsupportedOperationException when querying via API #965

Closed
danielkastner opened this issue Aug 15, 2024 · 0 comments
Closed

java.lang.UnsupportedOperationException when querying via API #965

danielkastner opened this issue Aug 15, 2024 · 0 comments
Labels

Comments

@danielkastner
Copy link
Contributor

danielkastner commented Aug 15, 2024

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

danielkastner pushed a commit to danielkastner/nzbhydra2 that referenced this issue Aug 15, 2024
theotherp pushed a commit that referenced this issue Aug 17, 2024
Co-authored-by: Daniel Kastner <daniel@daniel-kastner.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants