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

MuleSoft JIRA | Mariano Gonzalez | 4 years ago
  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 | 7 months 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

  5. 0

    Issue with Retrofit and Simple - attempt at making a RSS Reader for Android

    Stack Overflow | 2 years ago | M. Underhill
    retrofit.RetrofitError: java.lang.ClassCastException: libcore.reflect.ParameterizedTypeImpl cannot be cast to java.lang.Class
  6. 0

    Generics and TopLink

    Oracle Community | 9 years ago | 594417
    java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class

    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.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