[ 
https://issues.apache.org/jira/browse/ARTEMIS-5466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17950343#comment-17950343
 ] 

Lucian Burja edited comment on ARTEMIS-5466 at 5/8/25 5:15 PM:
---------------------------------------------------------------

How to reproduce, I'm not sure.

By looking at the class that throws the error, it says "This filter intercepts 
the login and audits its results". It seems that for me, the audit is 
triggered, leading to this error.

In any case, by debugging I see the following:

In
{{{}org.apache.activemq.artemis.component{}}}.{{{}AuthenticationFilter::doFilter{}}},
 there is a cast:

!image-2025-05-08-18-48-49-530.png|width=524,height=243!
and it seems that {{servletResponse}} (which implements 
{{{}HttpServletResponse{}}}) cannot be cast to {{Response}} (which is an 
interface that extends {{{}Content.Sink{}}})

Looks like a bad import? Should have been 
{{org.eclipse.jetty.ee9.nested.Response}} instead of 
{{org.eclipse.jetty.server.Response?}}

By the way, the same bad import seems to occur a bit further down, this time 
with the {{Request}} cast, which will likely also fail.


was (Author: lburja):
How to reproduce, I'm not sure, but by debugging I see the following.

In
{{{}org.apache.activemq.artemis.component{}}}.{{{}AuthenticationFilter::doFilter{}}},
 there is a cast:

!image-2025-05-08-18-48-49-530.png|width=524,height=243!
and it seems that {{servletResponse}} (which implements 
{{{}HttpServletResponse{}}}) cannot be cast to {{Response}} (which is an 
interface that extends {{{}Content.Sink{}}})

Looks like a bad import? Should have been 
{{org.eclipse.jetty.ee9.nested.Response}} instead of 
{{org.eclipse.jetty.server.Response}}

> ClassCastException in AuthenticationFilter after upgrade from 2.38.0
> --------------------------------------------------------------------
>
>                 Key: ARTEMIS-5466
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5466
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.41.0
>         Environment: OpenJDK version "21.0.1" (Temurin)
> Artemis 2.41.0
> Red Hat Linux
>            Reporter: Lucian Burja
>            Assignee: Justin Bertram
>            Priority: Major
>         Attachments: image-2025-05-08-12-01-35-010.png, 
> image-2025-05-08-18-48-49-530.png
>
>
> After upgrading from *2.38.0* to *2.41.0*, a {{ClassCastException}} occurs 
> when attempting to log in to the management console.
> Stacktrace:
> {noformat}
> java.lang.ClassCastException: class org.eclipse.jetty.ee9.nested.Response 
> cannot be cast to class org.eclipse.jetty.server.Response 
> (org.eclipse.jetty.ee9.nested.Response and org.eclipse.jetty.server.Response 
> are in unnamed module of loader java.net.URLClassLoader @33909752)
>     at 
> org.apache.activemq.artemis.component.AuthenticationFilter.doFilter(AuthenticationFilter.java:45)
>  ~[artemis-web-2.41.0.jar:2.41.0]
>     at 
> org.eclipse.jetty.ee9.servlet.FilterHolder.doFilter(FilterHolder.java:202) 
> ~[jetty-ee9-servlet-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1638)
>  ~[jetty-ee9-servlet-12.0.19.jar:12.0.19]
>     at 
> org.apache.activemq.artemis.component.JolokiaFilter.doFilter(JolokiaFilter.java:50)
>  ~[artemis-web-2.41.0.jar:2.41.0]
>     at 
> org.eclipse.jetty.ee9.servlet.FilterHolder.doFilter(FilterHolder.java:202) 
> ~[jetty-ee9-servlet-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1638)
>  ~[jetty-ee9-servlet-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.servlet.ServletHandler.doHandle(ServletHandler.java:526)
>  ~[jetty-ee9-servlet-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.ScopedHandler.handle(ScopedHandler.java:127) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.security.SecurityHandler.handle(SecurityHandler.java:603)
>  ~[jetty-ee9-security-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.HandlerWrapper.handle(HandlerWrapper.java:124) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.ScopedHandler.nextHandle(ScopedHandler.java:197) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.SessionHandler.doHandle(SessionHandler.java:612) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.ScopedHandler.nextHandle(ScopedHandler.java:195) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.ContextHandler.doHandle(ContextHandler.java:1045)
>  ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.ScopedHandler.nextScope(ScopedHandler.java:164) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.servlet.ServletHandler.doScope(ServletHandler.java:483) 
> ~[jetty-ee9-servlet-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.ScopedHandler.nextScope(ScopedHandler.java:162) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.SessionHandler.doScope(SessionHandler.java:589) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.ScopedHandler.nextScope(ScopedHandler.java:162) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.ContextHandler.doScope(ContextHandler.java:966) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.ScopedHandler.handle(ScopedHandler.java:125) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.ContextHandler.handle(ContextHandler.java:1719) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1564)
>  ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.HttpChannel.dispatch(HttpChannel.java:723) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at org.eclipse.jetty.ee9.nested.HttpChannel.handle(HttpChannel.java:511) 
> ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.ee9.nested.ContextHandler$CoreContextHandler$CoreToNestedHandler.handle(ContextHandler.java:2943)
>  ~[jetty-ee9-nested-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1064)
>  ~[jetty-server-12.0.19.jar:12.0.19]
>     at org.eclipse.jetty.server.Handler$Sequence.handle(Handler.java:805) 
> ~[jetty-server-12.0.19.jar:12.0.19]
>     at org.eclipse.jetty.server.Server.handle(Server.java:182) 
> ~[jetty-server-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:662)
>  ~[jetty-server-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:416)
>  ~[jetty-server-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
>  ~[jetty-io-12.0.19.jar:12.0.19]
>     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99) 
> ~[jetty-io-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
>  ~[jetty-io-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:480)
>  ~[jetty-util-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:443)
>  ~[jetty-util-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
>  ~[jetty-util-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
>  ~[jetty-util-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
>  ~[jetty-util-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
>  ~[jetty-util-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
>  ~[jetty-util-12.0.19.jar:12.0.19]
>     at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
>  ~[jetty-util-12.0.19.jar:12.0.19]
>     at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]{noformat}
> Here is a screenshot of the login screen (the message is misleading - 
> username/password is correct, but an exception occurs, with the above 
> stacktrace in the logs):
> !image-2025-05-08-12-01-35-010.png|width=693,height=336! 
> Additional notes:
>  * I have followed the upgrade instructions from the release page, including 
> updating the property  -Dhawtio.role{color:#de350b}s{color}="$HAWTIO_ROLE" , 
> where I removed the {color:#de350b}s{color}. What is strange, is that by 
> using the previous value (with an {color:#de350b}s{color}, which I assume is 
> incorrect), the login works again.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to