java.lang.ClassCastException: java.util.Collections$UnmodifiableList cannot be cast to java.lang.String

MuleSoft JIRA | David Cisneros | 4 months ago
  1. 0

    When sending a request with duplicate Content-Type headers an exception is raised: {quote} Exception occurred processing request: java.lang.ClassCastException: java.util.Collections$UnmodifiableList cannot be cast to java.lang.String at org.mule.DefaultMuleMessage.updateDataTypeWithProperty(DefaultMuleMessage.java:537) at org.mule.DefaultMuleMessage.setProperty(DefaultMuleMessage.java:496) at org.mule.DefaultMuleMessage.setProperty(DefaultMuleMessage.java:488) at org.mule.DefaultMuleMessage.addProperties(DefaultMuleMessage.java:1336) at org.mule.DefaultMuleMessage.<init>(DefaultMuleMessage.java:193) at org.mule.DefaultMuleMessage.<init>(DefaultMuleMessage.java:170) at org.mule.module.http.internal.listener.HttpRequestToMuleEvent.transform(HttpRequestToMuleEvent.java:126) at org.mule.module.http.internal.listener.DefaultHttpListener.createEvent(DefaultHttpListener.java:180) at org.mule.module.http.internal.listener.DefaultHttpListener.access$000(DefaultHttpListener.java:46) at org.mule.module.http.internal.listener.DefaultHttpListener$1.handleRequest(DefaultHttpListener.java:131) at org.mule.module.http.internal.listener.grizzly.GrizzlyRequestDispatcherFilter.handleRead(GrizzlyRequestDispatcherFilter.java:83) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:526) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.run0(ExecutorPerServerAddressIOStrategy.java:102) at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.access$100(ExecutorPerServerAddressIOStrategy.java:30) at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy$WorkerThreadRunnable.run(ExecutorPerServerAddressIOStrategy.java:125) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {quote} Steps to reproduce: - Create a simple Mule Project with a HttpListener and a Logger. - Send a request (POST) with duplicate Content-Type header {quote} LISTENER POST /test HTTP/1.1 Host: cisco-spark-test-endpoint.cloudhub.io X-Real-IP: 54.216.252.112 Content-Length: 1293 Accept: / Content-type: application/json; charset=utf-8 Content-type: application/json; charset=utf-8 User-Agent: AHC/1.0 X-Forwarded-For: 54.216.252.112 X-Forwarded-Port: 80 X-Forwarded-Proto: http \{"message":"123"} {quote} Insight: It seems to be a problem when the properties are set based on the received headers and then passed to the constructor of a DefaultMuleMessage https://github.com/mulesoft/mule/blob/mule-3.8.0/modules/http/src/main/java/org/mule/module/http/internal/listener/HttpRequestToMuleEvent.java Lines: 56-63 https://github.com/mulesoft/mule/blob/mule-3.8.0/core/src/main/java/org/mule/DefaultMuleMessage.java Line: 537 Notes: Cisco is facing this problem due to an external system that is duplicating the headers and they don't have control over it.

    MuleSoft JIRA | 4 months ago | David Cisneros
    java.lang.ClassCastException: java.util.Collections$UnmodifiableList cannot be cast to java.lang.String
  2. 0

    [Regression] Exception is thrown out when highlight condition with "In" [0302]

    Eclipse Bugzilla | 8 years ago | xwang
    org.eclipse.birt.report.service.api.ReportServiceException: Error happened while running the report
  3. 0

    [Regression] Exception is thrown out when highlight condition with "In" [0302]

    Eclipse Bugzilla | 8 years ago | xwang
    org.eclipse.birt.report.service.api.ReportServiceException: Error happened while running the report
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    /feedbackSubmissionAdjustmentWorker is failing

    GitHub | 3 years ago | damithc
    java.lang.ClassCastException: java.util.Collections$UnmodifiableMap cannot be cast to java.util.HashMap
  6. 0

    metrics typo

    GitHub | 1 year ago | clockfly
    akka.actor.ActorInitializationException: exception during creation

    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

      java.util.Collections$UnmodifiableList cannot be cast to java.lang.String

      at org.mule.DefaultMuleMessage.updateDataTypeWithProperty()
    2. Mule Core
      DefaultMuleMessage.<init>
      1. org.mule.DefaultMuleMessage.updateDataTypeWithProperty(DefaultMuleMessage.java:537)
      2. org.mule.DefaultMuleMessage.setProperty(DefaultMuleMessage.java:496)
      3. org.mule.DefaultMuleMessage.setProperty(DefaultMuleMessage.java:488)
      4. org.mule.DefaultMuleMessage.addProperties(DefaultMuleMessage.java:1336)
      5. org.mule.DefaultMuleMessage.<init>(DefaultMuleMessage.java:193)
      6. org.mule.DefaultMuleMessage.<init>(DefaultMuleMessage.java:170)
      6 frames
    3. Mule HTTP Connector
      GrizzlyRequestDispatcherFilter.handleRead
      1. org.mule.module.http.internal.listener.HttpRequestToMuleEvent.transform(HttpRequestToMuleEvent.java:126)
      2. org.mule.module.http.internal.listener.DefaultHttpListener.createEvent(DefaultHttpListener.java:180)
      3. org.mule.module.http.internal.listener.DefaultHttpListener.access$000(DefaultHttpListener.java:46)
      4. org.mule.module.http.internal.listener.DefaultHttpListener$1.handleRequest(DefaultHttpListener.java:131)
      5. org.mule.module.http.internal.listener.grizzly.GrizzlyRequestDispatcherFilter.handleRead(GrizzlyRequestDispatcherFilter.java:83)
      5 frames
    4. Grizzly
      AbstractIOStrategy.fireIOEvent
      1. org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      2. org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
      3. org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
      4. org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
      5. org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
      6. org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      7. org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:526)
      8. org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
      8 frames
    5. Mule HTTP Connector
      ExecutorPerServerAddressIOStrategy$WorkerThreadRunnable.run
      1. org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.run0(ExecutorPerServerAddressIOStrategy.java:102)
      2. org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.access$100(ExecutorPerServerAddressIOStrategy.java:30)
      3. org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy$WorkerThreadRunnable.run(ExecutorPerServerAddressIOStrategy.java:125)
      3 frames
    6. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames