java.lang.ClassCastException: com.sforce.soap.partner.SaveResult cannot be cast to java.lang.Class

MuleSoft JIRA | Mariano Gonzalez | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I have the expression #[payload['Id']] since I was expecting a Map. However I was wrong and instead of that I got a POJO. Instead of telling me that payload was not a map, MEL throws ClassCastException Error below: -------------------------------------------------------------------------------- Exception stack is: 1. com.sforce.soap.partner.SaveResult cannot be cast to java.lang.Class (java.lang.ClassCastException) org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer:912 (null) 2. [Error: com.sforce.soap.partner.SaveResult cannot be cast to java.lang.Class] [Near : {... payload['Id'] ....}] ^ [Line: 1, Column: 1] (org.mvel2.CompileException) org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer:435 (null) 3. Execution of the expression "payload['Id']" failed. (org.mule.api.expression.ExpressionRuntimeException) org.mule.el.mvel.MVELExpressionLanguage:208 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/expression/ExpressionRuntimeException.html) 4. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=jdbc://updateSfdcAccountAsCompleted, connector=EEJdbcConnector { name=Database lifecycle=start this=5eb536e6 numberOfConcurrentTransactedReceivers=4 createMultipleTransactedReceivers=false connected=true supportedProtocols=[jdbc] serviceOverrides=<none> } , name='endpoint.jdbc.updateSfdcAccountAsCompleted', mep=REQUEST_RESPONSE, properties={queryTimeout=-1}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: Arrays$ArrayList (org.mule.api.transport.DispatchException) org.mule.transport.AbstractMessageDispatcher:109 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html) -------------------------------------------------------------------------------- Root Exception stack trace: java.lang.ClassCastException: com.sforce.soap.partner.SaveResult cannot be cast to java.lang.Class at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getCollectionPropertyAO(ReflectiveAccessorOptimizer.java:912) at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:380) at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:143) + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) ********************************************************************************

    MuleSoft JIRA | 4 years ago | Mariano Gonzalez
    java.lang.ClassCastException: com.sforce.soap.partner.SaveResult cannot be cast to java.lang.Class
  2. 0

    I have the expression #[payload['Id']] since I was expecting a Map. However I was wrong and instead of that I got a POJO. Instead of telling me that payload was not a map, MEL throws ClassCastException Error below: -------------------------------------------------------------------------------- Exception stack is: 1. com.sforce.soap.partner.SaveResult cannot be cast to java.lang.Class (java.lang.ClassCastException) org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer:912 (null) 2. [Error: com.sforce.soap.partner.SaveResult cannot be cast to java.lang.Class] [Near : {... payload['Id'] ....}] ^ [Line: 1, Column: 1] (org.mvel2.CompileException) org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer:435 (null) 3. Execution of the expression "payload['Id']" failed. (org.mule.api.expression.ExpressionRuntimeException) org.mule.el.mvel.MVELExpressionLanguage:208 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/expression/ExpressionRuntimeException.html) 4. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=jdbc://updateSfdcAccountAsCompleted, connector=EEJdbcConnector { name=Database lifecycle=start this=5eb536e6 numberOfConcurrentTransactedReceivers=4 createMultipleTransactedReceivers=false connected=true supportedProtocols=[jdbc] serviceOverrides=<none> } , name='endpoint.jdbc.updateSfdcAccountAsCompleted', mep=REQUEST_RESPONSE, properties={queryTimeout=-1}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: Arrays$ArrayList (org.mule.api.transport.DispatchException) org.mule.transport.AbstractMessageDispatcher:109 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html) -------------------------------------------------------------------------------- Root Exception stack trace: java.lang.ClassCastException: com.sforce.soap.partner.SaveResult cannot be cast to java.lang.Class at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getCollectionPropertyAO(ReflectiveAccessorOptimizer.java:912) at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:380) at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:143) + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) ********************************************************************************

    MuleSoft JIRA | 4 years ago | Mariano Gonzalez
    java.lang.ClassCastException: com.sforce.soap.partner.SaveResult cannot be cast to java.lang.Class
  3. 0

    ClassCastException with null payload in expression language - MuleSoft

    mulesoft.com | 1 year ago
    java.lang.ClassCastException: org.mule.transport.NullPayload cannot be cast to java.lang.Class
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      com.sforce.soap.partner.SaveResult cannot be cast to java.lang.Class

      at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getCollectionPropertyAO()
    2. org.mvel2.optimizers
      ReflectiveAccessorOptimizer.optimizeAccessor
      1. org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getCollectionPropertyAO(ReflectiveAccessorOptimizer.java:912)
      2. org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:380)
      3. org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:143)
      3 frames