java.lang.ClassCastException: com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter cannot be cast to javax.servlet.http.HttpServletRequest

Atlassian JIRA | Deric Lee | 2 years ago
  1. 0

    Hi, I do not know if it is ok to directly create a bug report - so I'm writing my findings here: We are using an SSH Request Handler Plugin (that uses the command "pull-request") to create Pull-Requests via SSH. As far as I see it, your newly introduced analytics part which collects information assumes that pull-requests are created by HttpServlets and hence tries to cast an _SshScmRequestCommandAdapter_ into a _HttpServletRequest_. Here a snippet from the access log: {code} 10.17.74.124 | ssh | i@1T83OM1x541x250245x2 | horst.wanek | 2014-08-18 09:01:34,483 | SSH - pull-request | - | - | - | 18tjj35 | 10.17.74.124 | ssh | o@1T83OM1x541x250245x2 | horst.wanek | 2014-08-18 09:01:35,364 | SSH - pull-request | - | ssh:id:331, ssh:label:'horstw@socbl215' | 880 | 18tjj35 | {code} Here the error / stacktrace from the log: {code} 2014-08-18 09:01:35,257 ERROR [ssh-scm-request-handler] horst.wanek @1T83OM1x541x250245x2 18tjj35 10.17.74.124 SSH - pull-request c.a.a.c.l.ProductEventListener Failed to send analytics event com.atlassian.stash.event.pull.PullRequestOpenRequestedEvent[source=com.atlassian.stash.internal.pull.PullRequestServiceImpl@39da6d42] java.lang.ClassCastException: com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter cannot be cast to javax.servlet.http.HttpServletRequest at com.atlassian.analytics.client.request.StashHttpRequestProvider.getRequest(StashHttpRequestProvider.java:22) ~[analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.serialize.EventSerializer.getHttpRequest(EventSerializer.java:91) ~[analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.serialize.EventSerializer.toMessage(EventSerializer.java:60) ~[analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.listener.ProductEventListener.processEventWithTiming(ProductEventListener.java:78) [analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.listener.ProductEventListener.processEvent(ProductEventListener.java:69) [analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.listener.ProductEventListener.processEvent(ProductEventListener.java:61) [analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.listener.StashEventListener.onEvent(StashEventListener.java:60) [analytics-client-3.35_1406678900000.jar:na] at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) [atlassian-event-2.3.5.jar:na] at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) [atlassian-event-2.3.5.jar:na] at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) [guava-11.0.2-atlassian-01.jar:na] at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107) [atlassian-event-2.3.5.jar:na] at com.atlassian.stash.internal.event.LockFreeEventPublisher$Publisher.dispatch(LockFreeEventPublisher.java:202) [stash-platform-3.2.2.jar:na] at com.atlassian.stash.internal.event.LockFreeEventPublisher.publish(LockFreeEventPublisher.java:75) [stash-platform-3.2.2.jar:na] at com.atlassian.stash.internal.event.TransactionAwareEventPublisher.publish(TransactionAwareEventPublisher.java:84) [stash-platform-3.2.2.jar:na] at com.atlassian.stash.internal.pull.PullRequestServiceImpl.fireOpenRequested(PullRequestServiceImpl.java:1152) [stash-service-impl-3.2.2.jar:na] at com.atlassian.stash.internal.pull.PullRequestServiceImpl.create(PullRequestServiceImpl.java:376) [stash-service-impl-3.2.2.jar:na] at com.atlassian.stash.internal.pull.PullRequestServiceImpl.create(PullRequestServiceImpl.java:71) [stash-service-impl-3.2.2.jar:na] at de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.createPullRequestInStash(CreatePullRequestHandler.java:83) [plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na] at de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.tryPullRequestCreation(CreatePullRequestHandler.java:73) [plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na] at de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.handleRequest(CreatePullRequestHandler.java:38) [plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na] at com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable$1.withRequest(SshScmRequestCommandAdapter.java:289) [stash-ssh-3.2.2_1407984114000.jar:na] at com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable$1.withRequest(SshScmRequestCommandAdapter.java:277) [stash-ssh-3.2.2_1407984114000.jar:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84) [stash-service-impl-3.2.2.jar:na] at com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable.run(SshScmRequestCommandAdapter.java:277) [stash-ssh-3.2.2_1407984114000.jar:na] at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [stash-ssh-3.2.2_1407984114000.jar:na] at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:69) [stash-platform-3.2.2.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_51] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_51] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_51] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [na:1.7.0_51] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51] ... 66 frames trimmed {code}

    Atlassian JIRA | 2 years ago | Deric Lee [Atlassian]
    java.lang.ClassCastException: com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter cannot be cast to javax.servlet.http.HttpServletRequest
  2. 0

    Hi, I do not know if it is ok to directly create a bug report - so I'm writing my findings here: We are using an SSH Request Handler Plugin (that uses the command "pull-request") to create Pull-Requests via SSH. As far as I see it, your newly introduced analytics part which collects information assumes that pull-requests are created by HttpServlets and hence tries to cast an _SshScmRequestCommandAdapter_ into a _HttpServletRequest_. Here a snippet from the access log: {code} 10.17.74.124 | ssh | i@1T83OM1x541x250245x2 | horst.wanek | 2014-08-18 09:01:34,483 | SSH - pull-request | - | - | - | 18tjj35 | 10.17.74.124 | ssh | o@1T83OM1x541x250245x2 | horst.wanek | 2014-08-18 09:01:35,364 | SSH - pull-request | - | ssh:id:331, ssh:label:'horstw@socbl215' | 880 | 18tjj35 | {code} Here the error / stacktrace from the log: {code} 2014-08-18 09:01:35,257 ERROR [ssh-scm-request-handler] horst.wanek @1T83OM1x541x250245x2 18tjj35 10.17.74.124 SSH - pull-request c.a.a.c.l.ProductEventListener Failed to send analytics event com.atlassian.stash.event.pull.PullRequestOpenRequestedEvent[source=com.atlassian.stash.internal.pull.PullRequestServiceImpl@39da6d42] java.lang.ClassCastException: com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter cannot be cast to javax.servlet.http.HttpServletRequest at com.atlassian.analytics.client.request.StashHttpRequestProvider.getRequest(StashHttpRequestProvider.java:22) ~[analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.serialize.EventSerializer.getHttpRequest(EventSerializer.java:91) ~[analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.serialize.EventSerializer.toMessage(EventSerializer.java:60) ~[analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.listener.ProductEventListener.processEventWithTiming(ProductEventListener.java:78) [analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.listener.ProductEventListener.processEvent(ProductEventListener.java:69) [analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.listener.ProductEventListener.processEvent(ProductEventListener.java:61) [analytics-client-3.35_1406678900000.jar:na] at com.atlassian.analytics.client.listener.StashEventListener.onEvent(StashEventListener.java:60) [analytics-client-3.35_1406678900000.jar:na] at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) [atlassian-event-2.3.5.jar:na] at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) [atlassian-event-2.3.5.jar:na] at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253) [guava-11.0.2-atlassian-01.jar:na] at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107) [atlassian-event-2.3.5.jar:na] at com.atlassian.stash.internal.event.LockFreeEventPublisher$Publisher.dispatch(LockFreeEventPublisher.java:202) [stash-platform-3.2.2.jar:na] at com.atlassian.stash.internal.event.LockFreeEventPublisher.publish(LockFreeEventPublisher.java:75) [stash-platform-3.2.2.jar:na] at com.atlassian.stash.internal.event.TransactionAwareEventPublisher.publish(TransactionAwareEventPublisher.java:84) [stash-platform-3.2.2.jar:na] at com.atlassian.stash.internal.pull.PullRequestServiceImpl.fireOpenRequested(PullRequestServiceImpl.java:1152) [stash-service-impl-3.2.2.jar:na] at com.atlassian.stash.internal.pull.PullRequestServiceImpl.create(PullRequestServiceImpl.java:376) [stash-service-impl-3.2.2.jar:na] at com.atlassian.stash.internal.pull.PullRequestServiceImpl.create(PullRequestServiceImpl.java:71) [stash-service-impl-3.2.2.jar:na] at de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.createPullRequestInStash(CreatePullRequestHandler.java:83) [plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na] at de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.tryPullRequestCreation(CreatePullRequestHandler.java:73) [plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na] at de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.handleRequest(CreatePullRequestHandler.java:38) [plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na] at com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable$1.withRequest(SshScmRequestCommandAdapter.java:289) [stash-ssh-3.2.2_1407984114000.jar:na] at com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable$1.withRequest(SshScmRequestCommandAdapter.java:277) [stash-ssh-3.2.2_1407984114000.jar:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84) [stash-service-impl-3.2.2.jar:na] at com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable.run(SshScmRequestCommandAdapter.java:277) [stash-ssh-3.2.2_1407984114000.jar:na] at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [stash-ssh-3.2.2_1407984114000.jar:na] at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:69) [stash-platform-3.2.2.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_51] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_51] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_51] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [na:1.7.0_51] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51] ... 66 frames trimmed {code}

    Atlassian JIRA | 2 years ago | Deric Lee
    java.lang.ClassCastException: com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter cannot be cast to javax.servlet.http.HttpServletRequest
  3. 0

    JSF sample application in WLP 10.3.2 | Oracle Community

    oracle.com | 8 months ago
    javax.faces.FacesException: #{JSFLoginPortletRequestBean.authenticate}: java.lang.ClassCastException: com.bea.portlet.container.ActionRequestImpl cannot be cast to javax.servlet.http.HttpServletRequest
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    JSF sample application in WLP 10.3.2 | Oracle Community

    oracle.com | 8 months ago
    javax.faces.el.EvaluationException: java.lang.ClassCastException: com.bea.portlet.container.ActionRequestImpl cannot be cast to javax.servlet.http.HttpServletRequest

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter cannot be cast to javax.servlet.http.HttpServletRequest

      at com.atlassian.analytics.client.request.StashHttpRequestProvider.getRequest()
    2. com.atlassian.analytics
      StashEventListener.onEvent
      1. com.atlassian.analytics.client.request.StashHttpRequestProvider.getRequest(StashHttpRequestProvider.java:22)[analytics-client-3.35_1406678900000.jar:na]
      2. com.atlassian.analytics.client.serialize.EventSerializer.getHttpRequest(EventSerializer.java:91)[analytics-client-3.35_1406678900000.jar:na]
      3. com.atlassian.analytics.client.serialize.EventSerializer.toMessage(EventSerializer.java:60)[analytics-client-3.35_1406678900000.jar:na]
      4. com.atlassian.analytics.client.listener.ProductEventListener.processEventWithTiming(ProductEventListener.java:78)[analytics-client-3.35_1406678900000.jar:na]
      5. com.atlassian.analytics.client.listener.ProductEventListener.processEvent(ProductEventListener.java:69)[analytics-client-3.35_1406678900000.jar:na]
      6. com.atlassian.analytics.client.listener.ProductEventListener.processEvent(ProductEventListener.java:61)[analytics-client-3.35_1406678900000.jar:na]
      7. com.atlassian.analytics.client.listener.StashEventListener.onEvent(StashEventListener.java:60)[analytics-client-3.35_1406678900000.jar:na]
      7 frames
    3. com.atlassian.event
      AsynchronousAbleEventDispatcher$1$1.run
      1. com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36)[atlassian-event-2.3.5.jar:na]
      2. com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48)[atlassian-event-2.3.5.jar:na]
      2 frames
    4. Guava
      MoreExecutors$SameThreadExecutorService.execute
      1. com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253)[guava-11.0.2-atlassian-01.jar:na]
      1 frame
    5. com.atlassian.event
      AsynchronousAbleEventDispatcher.dispatch
      1. com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107)[atlassian-event-2.3.5.jar:na]
      1 frame
    6. com.atlassian.stash
      PullRequestServiceImpl.create
      1. com.atlassian.stash.internal.event.LockFreeEventPublisher$Publisher.dispatch(LockFreeEventPublisher.java:202)[stash-platform-3.2.2.jar:na]
      2. com.atlassian.stash.internal.event.LockFreeEventPublisher.publish(LockFreeEventPublisher.java:75)[stash-platform-3.2.2.jar:na]
      3. com.atlassian.stash.internal.event.TransactionAwareEventPublisher.publish(TransactionAwareEventPublisher.java:84)[stash-platform-3.2.2.jar:na]
      4. com.atlassian.stash.internal.pull.PullRequestServiceImpl.fireOpenRequested(PullRequestServiceImpl.java:1152)[stash-service-impl-3.2.2.jar:na]
      5. com.atlassian.stash.internal.pull.PullRequestServiceImpl.create(PullRequestServiceImpl.java:376)[stash-service-impl-3.2.2.jar:na]
      6. com.atlassian.stash.internal.pull.PullRequestServiceImpl.create(PullRequestServiceImpl.java:71)[stash-service-impl-3.2.2.jar:na]
      6 frames
    7. de.aeffle.stash
      CreatePullRequestHandler.handleRequest
      1. de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.createPullRequestInStash(CreatePullRequestHandler.java:83)[plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na]
      2. de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.tryPullRequestCreation(CreatePullRequestHandler.java:73)[plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na]
      3. de.aeffle.stash.plugins.ssh.requestHandler.CreatePullRequestHandler.handleRequest(CreatePullRequestHandler.java:38)[plugin.5695302897666225133.create-pull-request-via-ssh-2.2_1400414625000.jar:na]
      3 frames
    8. com.atlassian.stash
      SshScmRequestCommandAdapter$ScmRequestRunnable.run
      1. com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable$1.withRequest(SshScmRequestCommandAdapter.java:289)[stash-ssh-3.2.2_1407984114000.jar:na]
      2. com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable$1.withRequest(SshScmRequestCommandAdapter.java:277)[stash-ssh-3.2.2_1407984114000.jar:na]
      3. com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84)[stash-service-impl-3.2.2.jar:na]
      4. com.atlassian.stash.internal.ssh.server.SshScmRequestCommandAdapter$ScmRequestRunnable.run(SshScmRequestCommandAdapter.java:277)[stash-ssh-3.2.2_1407984114000.jar:na]
      4 frames
    9. MINA
      NamePreservingRunnable.run
      1. org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)[stash-ssh-3.2.2_1407984114000.jar:na]
      1 frame
    10. com.atlassian.stash
      StateTransferringExecutor$StateTransferringRunnable.run
      1. com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:69)[stash-platform-3.2.2.jar:na]
      1 frame
    11. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[na:1.7.0_51]
      2. java.util.concurrent.FutureTask.run(FutureTask.java:262)[na:1.7.0_51]
      3. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[na:1.7.0_51]
      4. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[na:1.7.0_51]
      5. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[na:1.7.0_51]
      6. java.lang.Thread.run(Thread.java:744)[na:1.7.0_51]
      6 frames